Skip to content
This repository has been archived by the owner on Feb 12, 2025. It is now read-only.

Commit

Permalink
check that aws credentials are set
Browse files Browse the repository at this point in the history
  • Loading branch information
schnipseljagd committed Jan 6, 2015
1 parent fd92724 commit 423e2c9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sqs-dead-letter-requeue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,24 @@ var (
)

func main() {
var awsAccessKey = os.Getenv("AWS_ACCESS_KEY_ID")
if len(awsAccessKey) == 0 {
log.Fatalf("Please set environment variable AWS_ACCESS_KEY_ID")
}
var awsSecretKey = os.Getenv("AWS_SECRET_ACCESS_KEY")
if len(awsSecretKey) == 0 {
log.Fatalf("Please set environment variable AWS_SECRET_ACCESS_KEY")
}

kingpin.MustParse(app.Parse(os.Args[1:]))

activeQueueName := *queueName

var deadLetterQueueName = activeQueueName + "_dead_letter"

var auth = aws.Auth{
AccessKey: os.Getenv("AWS_ACCESS_KEY_ID"),
SecretKey: os.Getenv("AWS_SECRET_ACCESS_KEY"),
AccessKey: awsAccessKey,
SecretKey: awsSecretKey,
}

conn := sqs.New(auth, aws.EUWest)
Expand Down

0 comments on commit 423e2c9

Please sign in to comment.