diff --git a/roles/aws/aws_backup_validation/tasks/testing_resources.yml b/roles/aws/aws_backup_validation/tasks/testing_resources.yml index 56fd50eda..20be1df00 100644 --- a/roles/aws/aws_backup_validation/tasks/testing_resources.yml +++ b/roles/aws/aws_backup_validation/tasks/testing_resources.yml @@ -66,21 +66,29 @@ - name: Set instance type for template. ansible.builtin.set_fact: _instance_type_restore: "{{ instance_type[backup.resource_type] }}" + _template_prefix: "{{ instance_type[backup.resource_type] }}" when: backup.resource_type != 'file-system' +- name: Set instance type to Aurora if defined. + ansible.builtin.set_fact: + _instance_type_restore: "Aurora" + when: + - backup.resource_type == 'db' + - "'aurora' in aws_rds.engine" + - name: Create restore testing query file. ansible.builtin.template: - src: "{{ _instance_type_restore }}_restore_testing.j2" + src: "{{ _template_prefix }}_restore_testing.j2" dest: /tmp/restore_testing.json register: _restore_testing_query - when: _instance_type_restore is defined + when: _template_prefix is defined - name: Check if protected reource exist. ansible.builtin.command: > aws backup list-protected-resources --query "Results[?ResourceArn=='{{ _resource_arn }}']" --region {{ _aws_region }} register: _protected_res -- name: Assign {{ _instance_type_restore }} resource to AWS restore testing plan. +- name: Assign {{ _template_prefix }} resource to AWS restore testing plan. ansible.builtin.command: > aws backup create-restore-testing-selection --cli-input-json file:///tmp/restore_testing.json --region {{ _aws_region }} - when: _instance_type_restore is defined and _testing_plan_info.stdout != "null" and _testing_selection_exists.stdout | length == 0 and _protected_res.stdout | length != 0 + when: _template_prefix is defined and _testing_plan_info.stdout != "null" and _testing_selection_exists.stdout | length == 0 and _protected_res.stdout | length != 0 diff --git a/roles/aws/aws_cloudfront_distribution/defaults/main.yml b/roles/aws/aws_cloudfront_distribution/defaults/main.yml index f264cac35..66b17fd9d 100644 --- a/roles/aws/aws_cloudfront_distribution/defaults/main.yml +++ b/roles/aws/aws_cloudfront_distribution/defaults/main.yml @@ -12,6 +12,7 @@ aws_cloudfront_distribution: # description: "This is example function." # runtime: "nodejs22.x" # lambda runtimes can be found here https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html # code: "lambda-function-example.zip" # Name of the function file in files folder next to plays and vars, can handle git URLs +# handler: "main_file.main_function" aws_profile: "{{ _aws_profile }}" region: "{{ _aws_region }}" tags: {}