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

[6.0.0] ec2_eip - Remove instance_id alias. #1176

Closed
1 task done
tremble opened this issue Oct 18, 2022 · 2 comments · Fixed by #1194
Closed
1 task done

[6.0.0] ec2_eip - Remove instance_id alias. #1176

tremble opened this issue Oct 18, 2022 · 2 comments · Fixed by #1194
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)
Milestone

Comments

@tremble
Copy link
Contributor

tremble commented Oct 18, 2022

Summary

The instance_id alias is slated for removal after 2022-12-01, We're now close enough to 2022-12-01 and have only just released 5.0.0, so let's bump the date over to a specific version to make tracking easier.

Issue Type

Feature Idea

Component Name

ec2_eip

Additional Information

Original deprecation: ansible-collections/community.aws#349

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@tremble tremble added this to the 6.0.0 milestone Oct 18, 2022
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) labels Oct 18, 2022
softwarefactory-project-zuul bot pushed a commit that referenced this issue Oct 24, 2022
ec2_eip - Remove deprecated instance_id alias

SUMMARY
fixes: #1176
Removes deprecated instance_id alias
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_eip
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…n var (ansible-collections#1176)

SUMMARY

Fix issue where syntax error is reported if using ssm connection and the target node is located in a different region to the s3 bucket.

Fixes ansible-collections#1190, ansible-collections#637
ISSUE TYPE

    Bugfix Pull Request

COMPONENT NAME

aws_ssm connection plugin
ADDITIONAL INFORMATION

When using SSM for ansible connection and the target node is in a different region to the s3 bucket used, the playbook immediately errors with the following. (There are no issues when both target and s3 bucket are in the same region)

fatal: [i-04444a7f03cc2bffd]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"failed": true, "module_stderr": "", "module_stdout": " File \"/tmp/ansible/ansible-tmp-1653576081.8378458-29658-258097978113216/AnsiballZ_setup.py\", line 1\r\r\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\r\n ^\r\r\nSyntaxError: invalid syntax\r\r", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}

The tmp file has the following contents

<?xml version="1.0" encoding="UTF-8"?> <Error><Code>AuthorizationQueryParametersError</Code><Message>Error parsing the X-Amz-Credential parameter; the region 'us-east-1' is wrong; expecting 'eu-west-1'</Message><Region>eu-west-1</Region><RequestId>4VTAGR4C1V9ATBJT</RequestId><HostId>OahjGsFQHlr3ihxobH/yyH7Mzxq98mwjcb6+J3Y2EifDU7FykCe8b6QJTNodIG5WSquVeJF+Zsk=</HostId></Error>

Steps to reproduce: run an ansible playbook using the following:

    aws_ec2 inventory
    aws_ssm connection type
    specify an s3 bucket (ansible_aws_ssm_bucket_name var) that is in a different location to the target node

The presigned url generated includes the region the s3 bucket is in, so this region must be used for the session obtained in the _get_url function.
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
Fix detection of ssm connection bucket region

Fix detection of ssm connection bucket region by ensuring that the boto client is created normally and able to use supported credential sources
SUMMARY
PR ansible-collections#1176 introduced detection of an S3 bucket's region to handle cases where the bucket is in a different region than the SSM connection itself. This change did not use the preferred mechanism for creating client objects, which caused it to not have access to credentials from all supported sources. It also broke the ability to use this plugin in partitions other than aws. (e.g. aws-us-gov).
This change fixes this by building the bucket location client using _get_boto_client and the region for the connection to ensure it is both getting the proper credentials and starting in a region from the same partition as the client itself. From the default global region (or a hard-coded region), it will detect the bucket's region and continue S3 API calls using the bucket's own region.
Fixes bug introduced from ansible-collections#1176
Fixes ansible-collections#1413
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
aws_ssm connection plugin

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants