-
Notifications
You must be signed in to change notification settings - Fork 342
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
Botocore sets bad endpoint_url #1170
Comments
Files identified in the description:
If these files are inaccurate, please update the |
I agree this is confusing given the 'EC2' in the name, it's a relic of the earliest modules where we only supported EC2, and I think it's time to deprecate support for the EC2_ environment variables. It is however behaving as documented:
Since deprecation will take multiple years, I'm going to close this issue as "Works as expected". However, I will be following up with a change to deprecate the EC2_ variables. |
Cleanup shared 'EC2' parameters SUMMARY As seen in both #1170 and ansible-collections/community.aws#1458 the "EC2_" prefix for a number of fall-back environment variables results in confusion. "EC2_" implies it's specific to the EC2 API, not all of AWS. Deprecates the ec2_ parameter aliases Deprecates the EC2_ environment variables Deprecates the security_token/aws_security_token/access_token parameter aliases which were based on the original boto parameter names ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/module_utils/botocore.py plugins/module_utils/modules.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None>
Cleanup shared 'EC2' parameters SUMMARY As seen in both #1170 and ansible-collections/community.aws#1458 the "EC2_" prefix for a number of fall-back environment variables results in confusion. "EC2_" implies it's specific to the EC2 API, not all of AWS. Deprecates the ec2_ parameter aliases Deprecates the EC2_ environment variables Deprecates the security_token/aws_security_token/access_token parameter aliases which were based on the original boto parameter names ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/module_utils/botocore.py plugins/module_utils/modules.py ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None> (cherry picked from commit 06cecac)
[PR #1172/06cecace backport][stable-5] Cleanup shared 'EC2' parameters This is a backport of PR #1172 as merged into main (06cecac). SUMMARY As seen in both #1170 and ansible-collections/community.aws#1458 the "EC2_" prefix for a number of fall-back environment variables results in confusion. "EC2_" implies it's specific to the EC2 API, not all of AWS. Deprecates the ec2_ parameter aliases Deprecates the EC2_ environment variables Deprecates the security_token/aws_security_token/access_token parameter aliases which were based on the original boto parameter names ISSUE TYPE Feature Pull Request COMPONENT NAME plugins/module_utils/botocore.py plugins/module_utils/modules.py ADDITIONAL INFORMATION Reviewed-by: Mark Chappell <None>
…ections#1170) ecs_service - fix validation for `placementConstraints` SUMMARY Fixes ansible-collections#1058 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ecs_service Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Oleksandr Novak <[email protected]> Reviewed-by: Alina Buzachis <None>
…ections#1170) ecs_service - fix validation for `placementConstraints` SUMMARY Fixes ansible-collections#1058 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ecs_service Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Oleksandr Novak <[email protected]> Reviewed-by: Alina Buzachis <None>
…ections#1170) ecs_service - fix validation for `placementConstraints` SUMMARY Fixes ansible-collections#1058 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ecs_service Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Oleksandr Novak <[email protected]> Reviewed-by: Alina Buzachis <None>
Summary
The botocore utility can (but does not need to) set the endpoint_url based on two env vars: (https://github.com/ansible-collections/amazon.aws/blob/main/plugins/module_utils/botocore.py#L190)
AWS_URL
orEC2_URL
. If both are unset everything works as expected. However, ifEC2_URL
is set to the correct address for EC2, and AWL_URL is unset, when you use a non-ec2 module, such as the route53 module, it fails with a very unhelpful error message:When you try and use an ec2-based module everything works fine, which does point you towards it being a r53-specific issue, but it also muddles the issue, as apparently boto3 is working fine!
When used directly (ie importing boto3 and making a client in the interactive interpreter) boto3 does not follow this pattern, and given the unhelpful error message and the counterintuitive behavior that setting
EC2_URL
breaks the route53 module, this seems like a case that could be handled better. Frankly I don't understand whyEC2_URL
is brought in at all, but if it needs to be for backwards compatibility with something, it should only be used when you are creating an EC2 client, I think.Issue Type
Bug Report
Component Name
botocore
Ansible Version
Collection Versions
AWS SDK versions
Configuration
No response
OS / Environment
No response
Steps to Reproduce
Expected Results
A record should be created as described.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: