-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws_ssm - split S3 region/endpoint discovery into dedicated function (#…
…1674) aws_ssm - split S3 region/endpoint discovery into dedicated function Depends-On: #1670 SUMMARY fixes: #1616 Newer AWS regions don't generate valid presigned URLs unless you explicitly pass the endpoint_url for the region (see also boto/boto3#3015) ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION Reviewed-by: Markus Bergholz <git@osuv.de> Reviewed-by: Alina Buzachis <None> (cherry picked from commit 8237ebb)
- Loading branch information
1 parent
026534a
commit 9fcd4ef
Showing
7 changed files
with
91 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- aws_ssm - fixes bug with presigned S3 URLs in post-2019 AWS regions (https://github.com/ansible-collections/community.aws/issues/1616). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/integration/targets/connection_aws_ssm_cross_region/aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
time=10m | ||
|
||
cloud/aws | ||
connection_aws_ssm |
10 changes: 10 additions & 0 deletions
10
tests/integration/targets/connection_aws_ssm_cross_region/aws_ssm_integration_test_setup.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- hosts: localhost | ||
roles: | ||
- role: ../setup_connection_aws_ssm | ||
vars: | ||
target_os: fedora | ||
s3_bucket_region: 'eu-central-1' | ||
# Post 2019 regions behave differently from other regions | ||
# they're worth testing but it's not possible in CI today. | ||
#s3_bucket_region: 'eu-south-1' | ||
test_suffix: crossregion |
5 changes: 5 additions & 0 deletions
5
...integration/targets/connection_aws_ssm_cross_region/aws_ssm_integration_test_teardown.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- hosts: localhost | ||
tasks: | ||
- include_role: | ||
name: ../setup_connection_aws_ssm | ||
tasks_from: cleanup.yml |
3 changes: 3 additions & 0 deletions
3
tests/integration/targets/connection_aws_ssm_cross_region/meta/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies: | ||
- connection | ||
- setup_connection_aws_ssm |
31 changes: 31 additions & 0 deletions
31
tests/integration/targets/connection_aws_ssm_cross_region/runme.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
PLAYBOOK_DIR=$(pwd) | ||
set -eux | ||
|
||
CMD_ARGS=("$@") | ||
|
||
# Destroy Environment | ||
cleanup() { | ||
|
||
cd "${PLAYBOOK_DIR}" | ||
ansible-playbook -c local aws_ssm_integration_test_teardown.yml "${CMD_ARGS[@]}" | ||
|
||
} | ||
|
||
trap "cleanup" EXIT | ||
|
||
# Setup Environment | ||
ansible-playbook -c local aws_ssm_integration_test_setup.yml "$@" | ||
|
||
# Export the AWS Keys | ||
set +x | ||
. ./aws-env-vars.sh | ||
set -x | ||
|
||
cd ../connection | ||
|
||
# Execute Integration tests | ||
INVENTORY="${PLAYBOOK_DIR}/ssm_inventory" ./test.sh \ | ||
-e target_hosts=aws_ssm \ | ||
"$@" |