Skip to content

Example in the README does not work #3

@ababkin

Description

@ababkin

I would really like to see a simple example of sending a SNS message using AWS credentials in environment variables. (It's trivial to get them from the environment, but i cannot figure out how to put them into aws-sns)

The existing example below does not work.
It looks like creds is not used anywhere.

Getting this error (which makes sense, because credentials are not passed correctly)

SnsErrorResponse {snsErrorStatusCode = Status {statusCode = 403, statusMessage = "Forbidden"}, snsErrorCode = "InvalidClientTokenId", snsErrorMessage = "The security token included in the request is invalid", snsErrorResource = Nothing, snsErrorHostId = Nothing, snsErrorAccessKeyId = Nothing, snsErrorStringToSign = Nothing}
import Aws
import Aws.Core
import Aws.General
import Aws.Sns
import Data.IORef

cfg <- Aws.baseConfiguration
creds <- Credentials "access-key-id" "secret-access-key" `fmap` newIORef []
let snsCfg = SnsConfiguration HTTPS UsWest2
simpleAws cfg snsCfg $ ListTopics Nothing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions