forked from ansible-collections/amazon.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove integration test reliance on the pre-existence of ansible_lamb…
…da_role (ansible-collections#63) * Migrate lambda tests to a unique IAM role (and clean up afterwards) * Migrate lambda_policy to a unique IAM role per-test (and clean up) * Use the Amazon provided AWSXrayWriteOnlyAccess policy rather than creating something custom * Migrate sns_topic to a unique IAM role per-test (and clean up) * Migrate s3_bucket_notifications to a unique IAM role per-test (and clean up) * CI relies on the very specific ansible-test-* pattern for role names * Minor lambda test cleanup - Reorder - Comments and spacing - Remove testing for standard AnsibleAWSModule boto behaviour, we have thorough tests for this now This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@60a4758
- Loading branch information
Showing
5 changed files
with
155 additions
and
119 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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
--- | ||
# defaults file for aws_lambda test | ||
lambda_function_name: '{{resource_prefix}}' | ||
# defaults file for lambda integration test | ||
lambda_function_name: '{{ resource_prefix }}' | ||
# IAM role names have to be less than 64 characters | ||
# The 8 digit identifier at the end of resource_prefix helps determine during | ||
# which test something was created and allows tests to be run in parallel | ||
# Shippable resource_prefixes are in the format shippable-123456-123, so in those cases | ||
# we need both sets of digits to keep the resource name unique | ||
unique_id: "{{ resource_prefix | regex_search('(\\d+-?)(\\d+)$') }}" | ||
lambda_role_name: 'ansible-test-{{ unique_id }}-lambda' |
12 changes: 12 additions & 0 deletions
12
tests/integration/targets/lambda/files/minimal_trust_policy.json
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,12 @@ | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
} |
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
Oops, something went wrong.