Closed shatil closed 7 years ago
For some reason I decided that if I'm using a KMS key I should use the metadata service to find the region I'm in, rather than parsing it from the key id ARN, for example. Not sure why I did this.
A quick workaround for you would be to launch an AWS instance and run this generate command there. That would work. I do support setting a KmsRegion in the config file but that's for runserver, not for generate. So doesn't help you yet.
And then let me add code to make this parse the region from the key id ARN.
I now parse the region from the key id. I managed to generate and encrypt a key on my local computer using a command nearly identical to what you pasted so I'm pretty sure this will work for you.
Wow, you are fast 👍
Does
ssh-cert-authority
work outside of AWS? On my laptop outside of AWS, built off 5c22404e3b6a1884450dfd02318fc36e7e261865, something attempts to read EC2 Instance metadata, and fails:I tried with and without
~/.ssh_ca/sign_certd_config.json
orAWS_DEFAULT_REGION
andAWS_REGION
environment variables and received the same error.I am happy to send a PR, but the only
Dial
invocations I see are:Unrelated, but
region
is readily available from http://169.254.169.254/latest/dynamic/instance-identity/document rather than having to query http://169.254.169.254/latest/meta-data/placement/availability-zone and then trim the Availability Zone's last character to get the Region.