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

Error handling for unspecified AWS region #2

Open
pda opened this issue Dec 6, 2017 · 2 comments
Open

Error handling for unspecified AWS region #2

pda opened this issue Dec 6, 2017 · 2 comments

Comments

@pda
Copy link
Contributor

pda commented Dec 6, 2017

When an AWS region isn't specified, the behaviour is correct but the error message is unclear;

$ PARAMETER_STORE_EXEC_PATH=/foo parameter-store-exec true
2017/12/06 15:47:08 MissingRegion: could not find region configuration

It would be nice if the error made it clear how to configure the region. This might mean linking to AWS SDK documentation, since the logic isn't implemented in parameter-store-exec. Or it might mean suggesting setting AWS_DEFAULT_REGION.

(I don't think there's any strong reason to support non-environment flags like --region; that would complicate the argument processing)

@mrck
Copy link

mrck commented May 3, 2018

I have the same problem, I'm trying to execute this within a docker container based on the dotnet core images from microsoft https://hub.docker.com/r/microsoft/dotnet/
I have attached a role to the task definition within AWS ECS, which should allow parameter-store-exec to get the parameters from the parameter store. I have also tried to set up config and credentials in a .aws folder in both the /app and /root folder, but I don't see any difference. I keep getting the error message: MissingRegion: could not find region configuration

Can you @pda give me any hints on what to try?

@pda
Copy link
Contributor Author

pda commented May 3, 2018

You need to set AWS_DEFAULT_REGION and/or AWS_REGION in your environment. (I'm not entirely clear on which one to use when — it's all implemented in https://github.com/aws/aws-sdk-go .

Here's an example from an ECS TaskDefinition CloudFormation that works for me:

          Environment:
          - Name: AWS_REGION
            Value: !Ref AWS::Region
          - Name: PARAMETER_STORE_EXEC_PATH
            Value: /foo/bar

Or you can manually set AWS_REGION to e.g. us-east-1 in your TaskDefinition if you're not using CloudFormation.

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