Skip to content

Commit

Permalink
Add profile flag
Browse files Browse the repository at this point in the history
  • Loading branch information
psi59 committed Nov 5, 2019
1 parent cf2dc34 commit 68c58c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Flags:
-s, --source=SOURCE Source queue to move messages from
-d, --destination=DESTINATION Destination queue to move messages to
-r, --region="us-west-2" AWS Region for source and destination queues
-p, --profile="" Use a specific profile from your credential file.
```

Examples:
Expand All @@ -82,5 +83,9 @@ sqsmover --source=my_source_queue_name --destination=my_destination_queuename --
sqsmover -s my_source_queue_name -d my_destination_queuename -r eu-west-1
```

Profile will default to `Default`, you can also override it with `--profile` flag

```
sqsmover --source=my_source_queue_name --destination=my_destination_queuename --profile=user
```

2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var (
sourceQueue = kingpin.Flag("source", "Source queue to move messages from").Short('s').Required().String()
destinationQueue = kingpin.Flag("destination", "Destination queue to move messages to").Short('d').Required().String()
region = kingpin.Flag("region", "AWS Region for source and destination queues").Short('r').Default("us-west-2").String()
profile = kingpin.Flag("profile", "Use a specific profile from your credential file.").Short('p').Default("").String()
)

func main() {
Expand All @@ -34,6 +35,7 @@ func main() {
sess, err := session.NewSessionWithOptions(
session.Options{
Config: aws.Config{Region: aws.String(*region)},
Profile: *profile,
SharedConfigState: session.SharedConfigEnable,
},
)
Expand Down

0 comments on commit 68c58c6

Please sign in to comment.