Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to subscriber results in 404 #138

Open
dmacthedestroyer opened this issue Feb 9, 2018 · 1 comment
Open

Connecting to subscriber results in 404 #138

dmacthedestroyer opened this issue Feb 9, 2018 · 1 comment

Comments

@dmacthedestroyer
Copy link

While trying to run the sqs-sub pubsub example, I keep encountering this error:

InvalidAddress: The address https://sqs.us-east-1.amazonaws.com/ is not valid for this endpoint.
status code: 404, request id: 14c12121-5d1c-5583-a35d-73d68936cbf6dmcdonald@dmcdonald-mbp15:~/go/src/dmcdonald/pubsubspike/

This traces to the s.sqs.GetQueueUrl call. I tried calling this api method myself with the following code, and got success:

	cfg := aws.NewConfig().WithCredentials(
		awscredentials.NewEnvCredentials(),
	).WithRegion(region)
	sqsClient := sqs.New(session.New(cfg))
	if resp, err := sqsClient.GetQueueUrl(&sqs.GetQueueUrlInput{QueueName: &queueName}); err != nil {
		fmt.Printf("failed to get queue url: \n%v\n", err)
	} else {
		fmt.Println(resp)
	}

I'm using the same permissions, region and queuename with both the gizmo example and my own test code.

The error response indicates possibly a permissions issue, but I can't seem to reproduce it outside of the gizmo codebase. Any suggestions on how to troubleshoot this further?

@DavyJ0nes
Copy link

I came across the same issue with the example code and you're correct that it is to do with permissions and how this is handled in the example code base.

Firstly, you'll either want to remove the AccessKey and SecretKeyfrom the config.json. In my opinion these should either be handled byawsclior through the envars:AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY`. Checkout this page for more info about handling AWS credentials.

Secondly, you'll need to add your AccountId to config.json. e.g.: "QueueOwnerAccountId":"123456789012"

This worked for me so hopefully will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants