Skip to content

Commit

Permalink
Follow up on ansible-collections#167 - (permission preservation when …
Browse files Browse the repository at this point in the history
…copying lambdas) (ansible-collections#168)

lambda_policy should now be stable
apply same change to s3_bucket_notification

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@0bad2c0
  • Loading branch information
tremble authored and alinabuzachis committed Sep 16, 2022
1 parent 8e6249f commit e295857
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/integration/targets/lambda/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@
- name: move lambda into place for archive module
copy:
src: mini_lambda.py
dest: '{{output_dir}}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.py'
mode: preserve
- name: bundle lambda into a zip
register: zip_res
archive:
format: zip
path: '{{output_dir}}/mini_lambda.py'
dest: '{{output_dir}}/mini_lambda.zip'
path: '{{ output_dir }}/mini_lambda.py'
dest: '{{ output_dir }}/mini_lambda.zip'
- name: test state=present - upload the lambda
lambda:
name: '{{lambda_function_name}}'
name: '{{ lambda_function_name }}'
runtime: python2.7
handler: mini_lambda.handler
role: ansible_lambda_role
zip_file: '{{zip_res.dest}}'
zip_file: '{{ zip_res.dest }}'
register: result
- name: assert lambda upload succeeded
assert:
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/targets/lambda_policy/aliases
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
cloud/aws
shippable/aws/group1
# https://github.com/ansible-collections/community.aws/issues/155
unstable
6 changes: 3 additions & 3 deletions tests/integration/targets/lambda_policy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
- name: move lambda into place for archive module
copy:
src: mini_http_lambda.py
dest: '{{output_dir}}/mini_http_lambda.py'
dest: '{{ output_dir }}/mini_http_lambda.py'
mode: preserve
- name: bundle lambda into a zip
register: zip_res
archive:
format: zip
path: '{{output_dir}}/mini_http_lambda.py'
dest: '{{output_dir}}/mini_http_lambda.zip'
path: '{{ output_dir }}/mini_http_lambda.py'
dest: '{{ output_dir }}/mini_http_lambda.zip'
- name: create minimal lambda role
iam_role:
aws_region: '{{ aws_region }}'
Expand Down

0 comments on commit e295857

Please sign in to comment.