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

AWS Authentication not working in region eu-central-1 #35

Open
joakimcs opened this issue Dec 2, 2016 · 4 comments
Open

AWS Authentication not working in region eu-central-1 #35

joakimcs opened this issue Dec 2, 2016 · 4 comments

Comments

@joakimcs
Copy link

joakimcs commented Dec 2, 2016

Excellent library - works fine in eu-west-1 and default region. Does not work in eu-central-1, and fails with the following error message:

ec2-expire-snapshots: ERROR: describe_snapshots: AuthFailure: AWS was not able to validate the provided access credentials at /usr/bin/ec2-expire-snapshots line 186.

Have tried to locate possible fixes, and suspect a pointer to the solution might be found here: alestic/ec2-consistent-snapshot#47

It's to do with eu-central requiring requests be signed with the v4 signature. This is not currently supported in the underlying Perl EC2 module: https://rt.cpan.org/Public/Bug/Display.html?id=99779

A possible fix with code is on the bottom on the page.

I'm no a Perl programmer myself, so sorry I can't contribute. Hope this is of help!

@dirar
Copy link

dirar commented Nov 17, 2017

did you manage to solve the issue?

@dirar
Copy link

dirar commented Nov 18, 2017

Found the same issue with ec2-consistent-snapshot:
alestic/ec2-consistent-snapshot#47 (comment)

So replaced the code:

line: 113-118

my $ec2 = Net::Amazon::EC2->new(
    ((! $use_iam_role) ? (AWSAccessKeyId  => $aws_access_key_id,) : () ),
    ((! $use_iam_role) ? (SecretAccessKey => $aws_secret_access_key) : () ),
    ($ec2_endpoint ? (base_url => $ec2_endpoint) : ()),
    # ($Debug ? (debug => 1) : ()),
);

with:

my $ec2 = Net::Amazon::EC2->new(
    ((! $use_iam_role) ? (AWSAccessKeyId  => $aws_access_key_id,) : () ),
    ((! $use_iam_role) ? (SecretAccessKey => $aws_secret_access_key) : () ),
    signature_version => 4,
    ($region ? (region => $region) : ()),
    ($ec2_endpoint ? (base_url => $ec2_endpoint) : ()),
    ($Debug ? (debug => 1) : ()),
);

mpdude added a commit to mpdude/ec2-expire-snapshots that referenced this issue Dec 10, 2018
@mpdude
Copy link

mpdude commented Dec 10, 2018

PR #37 contains this fix and is awaiting a merge.

@mpdude
Copy link

mpdude commented Dec 10, 2018

I've included the #37 PR in a Launchpad PPA build: https://launchpad.net/~webfactory/+archive/ubuntu/ppa/+build/15758536

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

3 participants