Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 2288fc8

Browse files
author
Matej Stajduhar
committed
Resolving-conflicts
2 parents e0b68e5 + c742d8d commit 2288fc8

File tree

1 file changed

+27
-2
lines changed
  • roles/aws/aws_backup_validation/tasks

1 file changed

+27
-2
lines changed

roles/aws/aws_backup_validation/tasks/main.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343

4444
- name: Clean and set python functions
4545
block:
46+
- name: Create S3 bucket for lambda functions
47+
- amazon.aws.s3_bucket:
48+
name: "ce-{{ _aws_profile }}-lambda-functions"
49+
state: present
50+
4651
- name: Check and clean any previous backup validation files
4752
ansible.builtin.file:
4853
path: "{{ _ce_provision_build_dir }}/{{ item }}_validation.py"
@@ -78,13 +83,32 @@
7883
dest: "{{ _ce_provision_build_dir }}/validation_report.zip"
7984
format: zip
8085

86+
- name: Place backup validation functions in S3 bucket
87+
amazon.aws.s3_object:
88+
bucket: "ce-{{ _aws_profile }}-lambda-functions"
89+
object: "{{ item }}}_validation.zip"
90+
src: "{{ _ce_provision_build_dir }}/{{ item }}_validation.zip"
91+
mode: "create"
92+
region: "{{ _aws_region }}"
93+
loop: "{{ aws_backup_validation.resources }}"
94+
95+
- name: Place report function in S3 bucket
96+
amazon.aws.s3_object:
97+
bucket: "ce-{{ _aws_profile }}-lambda-functions"
98+
object: "validation_report.zip"
99+
src: "{{ _ce_provision_build_dir }}/validation_report.zip"
100+
mode: "create"
101+
region: "{{ _aws_region }}"
102+
loop: "{{ aws_backup_validation.resources }}"
103+
81104
- name: Create Lambda functions
82105
amazon.aws.lambda:
83106
name: "{{ aws_backup_validation.name }}_{{ item }}"
84107
description: "{{ aws_backup_validation.description }} {{ item }} new comment to update function"
85108
region: "{{ _aws_region }}"
86109
timeout: "{{ aws_backup_validation.timeout }}"
87-
zip_file: "{{ _ce_provision_build_dir }}/{{ item }}_validation.zip"
110+
s3_bucket: "ce-{{ _aws_profile }}-lambda-functions"
111+
s3_key: "{{ item }}}_validation.zip"
88112
state: present
89113
runtime: "{{ aws_backup_validation.runtime }}"
90114
role: "{{ _created_iam_lambda_role.iam_role.arn }}"
@@ -101,7 +125,8 @@
101125
description: "Function that will send report about previous validations"
102126
region: "{{ _aws_region }}"
103127
timeout: 30
104-
zip_file: "{{ _ce_provision_build_dir }}/validation_report.zip"
128+
s3_bucket: "ce-{{ _aws_profile }}-lambda-functions"
129+
s3_key: "{{ item }}}_validation.zip"
105130
state: present
106131
runtime: "{{ aws_backup_validation.runtime }}"
107132
role: "{{ _created_iam_lambda_role.iam_role.arn }}"

0 commit comments

Comments
 (0)