diff --git a/tests/integration/targets/rds_instance/inventory b/tests/integration/targets/rds_instance/inventory deleted file mode 100644 index 960ac7a2dcf..00000000000 --- a/tests/integration/targets/rds_instance/inventory +++ /dev/null @@ -1,21 +0,0 @@ -# inventory names shortened down to fit resource name length limits -[tests] -processor -restore -sgroups -complex -states -modify -tagging -replica -upgrade -snapshot -aurora - -# TODO: uncomment after adding iam:CreatePolicy and iam:DeletePolicy -# iam_roles - - -[all:vars] -ansible_connection=local -ansible_python_interpreter="{{ ansible_playbook_python }}" diff --git a/tests/integration/targets/rds_instance/main.yml b/tests/integration/targets/rds_instance/main.yml deleted file mode 100644 index 178e569a666..00000000000 --- a/tests/integration/targets/rds_instance/main.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/rds_instance/tasks/ - -- hosts: all - gather_facts: no - strategy: free - roles: - - rds_instance diff --git a/tests/integration/targets/rds_instance/meta/main.yml b/tests/integration/targets/rds_instance/meta/main.yml deleted file mode 100644 index 32cf5dda7ed..00000000000 --- a/tests/integration/targets/rds_instance/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ -dependencies: [] diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/main.yml b/tests/integration/targets/rds_instance/roles/rds_instance/tasks/main.yml deleted file mode 100644 index 9d4bce8b863..00000000000 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: rds_instance integration tests - collections: - - community.aws - module_defaults: - group/aws: - aws_access_key: '{{ aws_access_key }}' - aws_secret_key: '{{ aws_secret_key }}' - security_token: '{{ security_token | default(omit) }}' - region: '{{ aws_region }}' - block: - - include: ./test_{{ inventory_hostname }}.yml - #- include: ./test_restore_instance.yml # TODO: snapshot, s3 diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_iam_roles.yml b/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_iam_roles.yml deleted file mode 100644 index 534d1d254a5..00000000000 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_iam_roles.yml +++ /dev/null @@ -1,336 +0,0 @@ -- block: - - name: Ensure the resource doesn't exist - rds_instance: - id: '{{ instance_id }}' - state: absent - skip_final_snapshot: true - register: result - - - assert: - that: - - not result.changed - ignore_errors: yes - - - name: Create postgresql instance - rds_instance: - id: '{{ instance_id }}' - state: present - engine: postgres - engine_version: '{{ postgres_db_engine_version }}' - username: '{{ username }}' - password: '{{ password }}' - db_instance_class: '{{ postgres_db_instance_class }}' - allocated_storage: '{{ allocated_storage }}' - allow_major_version_upgrade: yes - register: result - - - assert: - that: - - result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - - name: Create s3 integration policy - iam_managed_policy: - policy_name: '{{ instance_id }}-s3-policy' - policy: "{{ lookup('file','files/s3_integration_policy.json') }}" - state: present - register: s3_integration_policy - - - name: Create an s3 integration role - iam_role: - assume_role_policy_document: "{{ lookup('file','files/s3_integration_trust_policy.json')\ - \ }}" - name: '{{ instance_id }}-s3-role-1' - state: present - managed_policy: '{{ s3_integration_policy.policy.arn }}' - register: s3_integration_role_1 - - - name: Create an s3 integration role - iam_role: - assume_role_policy_document: "{{ lookup('file','files/s3_integration_trust_policy.json')\ - \ }}" - name: '{{ instance_id }}-s3-role-2' - state: present - managed_policy: '{{ s3_integration_policy.policy.arn }}' - register: s3_integration_role_2 - - - name: Create an s3 integration role - iam_role: - assume_role_policy_document: "{{ lookup('file','files/s3_integration_trust_policy.json')\ - \ }}" - name: '{{ instance_id }}-s3-role-3' - state: present - managed_policy: '{{ s3_integration_policy.policy.arn }}' - register: s3_integration_role_3 - - # ------------------------------------------------------------------------------------------ - - - name: Add IAM roles - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - - role_arn: '{{ s3_integration_role_3.arn }}' - feature_name: s3Import - register: result - check_mode: yes - - - assert: - that: - - result.changed - - - name: Add IAM roles - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - - role_arn: '{{ s3_integration_role_3.arn }}' - feature_name: s3Import - register: result - - - assert: - that: - - result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 3 - - "{{ 's3Export' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - "{{ 'Lambda' in result.associated_roles | map(attribute='feature_name') }}" - - "{{ 's3Import' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - - name: Add IAM roles (idempotence) - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - - role_arn: '{{ s3_integration_role_3.arn }}' - feature_name: s3Import - register: result - check_mode: yes - - - assert: - that: - - not result.changed - - - name: Add IAM roles (idempotence) - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - - role_arn: '{{ s3_integration_role_3.arn }}' - feature_name: s3Import - register: result - - - assert: - that: - - not result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 3 - - "{{ 's3Export' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - "{{ 'Lambda' in result.associated_roles | map(attribute='feature_name') }}" - - "{{ 's3Import' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - - name: Add IAM roles (idempotence) - purge roles - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - - role_arn: '{{ s3_integration_role_3.arn }}' - feature_name: s3Import - purge_iam_roles: yes - register: result - - - assert: - that: - - not result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 3 - - "{{ 's3Export' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - "{{ 'Lambda' in result.associated_roles | map(attribute='feature_name') }}" - - "{{ 's3Import' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - # ------------------------------------------------------------------------------------------ - - - name: Remove s3Import IAM role from db instance - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - purge_iam_roles: yes - register: result - check_mode: yes - - - assert: - that: - - result.changed - - - name: Remove s3Import IAM role from db instance - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - purge_iam_roles: yes - register: result - - - assert: - that: - - result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 2 - - "{{ 's3Export' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - "{{ 'Lambda' in result.associated_roles | map(attribute='feature_name') }}" - - "{{ 's3Import' not in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - - name: Remove s3Import IAM role from db instance (idempotence) - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - purge_iam_roles: yes - register: result - check_mode: yes - - - assert: - that: - - not result.changed - - - name: Remove s3Import IAM role from db instance (idempotence) - rds_instance: - id: '{{ instance_id }}' - state: present - iam_roles: - - role_arn: '{{ s3_integration_role_1.arn }}' - feature_name: s3Export - - role_arn: '{{ s3_integration_role_2.arn }}' - feature_name: Lambda - purge_iam_roles: yes - register: result - - - assert: - that: - - not result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 2 - - "{{ 's3Export' in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - "{{ 'Lambda' in result.associated_roles | map(attribute='feature_name') }}" - - "{{ 's3Import' not in result.associated_roles | map(attribute='feature_name')\ - \ }}" - - # ------------------------------------------------------------------------------------------ - - - name: Remove IAM roles from db instance - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - purge_iam_roles: yes - register: result - check_mode: yes - - - assert: - that: - - result.changed - - - name: Remove IAM roles from db instance - rds_instance: - id: '{{ instance_id }}' - state: present - purge_iam_roles: yes - register: result - - - assert: - that: - - result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 0 - - - name: Remove IAM roles from db instance (idempotence) - check_mode - rds_instance: - id: '{{ instance_id }}' - state: present - purge_iam_roles: yes - register: result - check_mode: yes - - - assert: - that: - - not result.changed - - - name: Remove IAM roles from db instance (idempotence) - rds_instance: - id: '{{ instance_id }}' - state: present - purge_iam_roles: yes - register: result - - - assert: - that: - - not result.changed - - result.db_instance_identifier == '{{ instance_id }}' - - result.associated_roles | length == 0 - - always: - - name: Delete IAM policy - iam_managed_policy: - policy_name: '{{ instance_id }}-s3-policy' - state: absent - ignore_errors: yes - - - name: Delete IAM roles - iam_role: - name: '{{ item.role_name }}' - assume_role_policy_document: "{{ lookup('file','files/s3_integration_trust_policy.json')\ - \ }}" - state: absent - ignore_errors: yes - with_items: - - '{{ s3_integration_role_1 }}' - - '{{ s3_integration_role_2 }}' - - '{{ s3_integration_role_3 }}' - - - name: Delete the instance - rds_instance: - id: '{{ instance_id }}' - state: absent - skip_final_snapshot: true - wait: false - ignore_errors: yes diff --git a/tests/integration/targets/rds_instance/runme.sh b/tests/integration/targets/rds_instance/runme.sh deleted file mode 100755 index aa324772bbe..00000000000 --- a/tests/integration/targets/rds_instance/runme.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# Beware: most of our tests here are run in parallel. -# To add new tests you'll need to add a new host to the inventory and a matching -# '{{ inventory_hostname }}'.yml file in roles/ec2_instance/tasks/ - - -set -eux - -export ANSIBLE_ROLES_PATH=../ - -ansible-playbook main.yml -i inventory "$@" diff --git a/tests/integration/targets/rds_instance_aurora/aliases b/tests/integration/targets/rds_instance_aurora/aliases new file mode 100644 index 00000000000..d28551c7660 --- /dev/null +++ b/tests/integration/targets/rds_instance_aurora/aliases @@ -0,0 +1,6 @@ +# See: https://github.com/ansible-collections/amazon.aws/pull/1192 +disabled +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_aurora/defaults/main.yml b/tests/integration/targets/rds_instance_aurora/defaults/main.yml new file mode 100644 index 00000000000..2d7b5ee0de0 --- /dev/null +++ b/tests/integration/targets/rds_instance_aurora/defaults/main.yml @@ -0,0 +1,37 @@ +instance_id: ansible-test-{{ tiny_prefix }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_aurora.yml b/tests/integration/targets/rds_instance_aurora/tasks/main.yml similarity index 89% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_aurora.yml rename to tests/integration/targets/rds_instance_aurora/tasks/main.yml index 44d50ee2fcb..ff6f7177ff7 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_aurora.yml +++ b/tests/integration/targets/rds_instance_aurora/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / aurora integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: @@ -16,6 +25,7 @@ rds_cluster: state: present engine: aurora + engine_mode: provisioned cluster_id: '{{ cluster_id }}' username: '{{ username }}' password: '{{ password }}' diff --git a/tests/integration/targets/rds_instance/aliases b/tests/integration/targets/rds_instance_complex/aliases similarity index 57% rename from tests/integration/targets/rds_instance/aliases rename to tests/integration/targets/rds_instance_complex/aliases index d79ad32a38f..de79d418d95 100644 --- a/tests/integration/targets/rds_instance/aliases +++ b/tests/integration/targets/rds_instance_complex/aliases @@ -1,4 +1,4 @@ -slow - cloud/aws rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/defaults/main.yml b/tests/integration/targets/rds_instance_complex/defaults/main.yml similarity index 100% rename from tests/integration/targets/rds_instance/roles/rds_instance/defaults/main.yml rename to tests/integration/targets/rds_instance_complex/defaults/main.yml diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/files/enhanced_monitoring_assume_policy.json b/tests/integration/targets/rds_instance_complex/files/enhanced_monitoring_assume_policy.json similarity index 100% rename from tests/integration/targets/rds_instance/roles/rds_instance/files/enhanced_monitoring_assume_policy.json rename to tests/integration/targets/rds_instance_complex/files/enhanced_monitoring_assume_policy.json diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/files/s3_integration_policy.json b/tests/integration/targets/rds_instance_complex/files/s3_integration_policy.json similarity index 100% rename from tests/integration/targets/rds_instance/roles/rds_instance/files/s3_integration_policy.json rename to tests/integration/targets/rds_instance_complex/files/s3_integration_policy.json diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/files/s3_integration_trust_policy.json b/tests/integration/targets/rds_instance_complex/files/s3_integration_trust_policy.json similarity index 100% rename from tests/integration/targets/rds_instance/roles/rds_instance/files/s3_integration_trust_policy.json rename to tests/integration/targets/rds_instance_complex/files/s3_integration_trust_policy.json diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_complex.yml b/tests/integration/targets/rds_instance_complex/tasks/main.yml similarity index 95% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_complex.yml rename to tests/integration/targets/rds_instance_complex/tasks/main.yml index 8c88be8b449..024e0978a2c 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_complex.yml +++ b/tests/integration/targets/rds_instance_complex/tasks/main.yml @@ -1,5 +1,14 @@ -#TODO: test availability_zone and multi_az -- block: +- name: rds_instance / complex integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: + #TODO: test availability_zone and multi_az - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}' diff --git a/tests/integration/targets/rds_instance_modify/aliases b/tests/integration/targets/rds_instance_modify/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_modify/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_modify/defaults/main.yml b/tests/integration/targets/rds_instance_modify/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_modify/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_modify.yml b/tests/integration/targets/rds_instance_modify/tasks/main.yml similarity index 92% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_modify.yml rename to tests/integration/targets/rds_instance_modify/tasks/main.yml index 8e620333786..2bdfc1ec512 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_modify.yml +++ b/tests/integration/targets/rds_instance_modify/tasks/main.yml @@ -1,5 +1,13 @@ -#TODO: test availability_zone and multi_az -- block: +- name: rds_instance / modify integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}' diff --git a/tests/integration/targets/rds_instance_processor/aliases b/tests/integration/targets/rds_instance_processor/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_processor/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_processor/defaults/main.yml b/tests/integration/targets/rds_instance_processor/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_processor/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_processor.yml b/tests/integration/targets/rds_instance_processor/tasks/main.yml similarity index 92% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_processor.yml rename to tests/integration/targets/rds_instance_processor/tasks/main.yml index 3d4895dc247..260a37951d7 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_processor.yml +++ b/tests/integration/targets/rds_instance_processor/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / processor integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: diff --git a/tests/integration/targets/rds_instance_replica/aliases b/tests/integration/targets/rds_instance_replica/aliases new file mode 100644 index 00000000000..9741c64638a --- /dev/null +++ b/tests/integration/targets/rds_instance_replica/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=25m +rds_instance diff --git a/tests/integration/targets/rds_instance_replica/defaults/main.yml b/tests/integration/targets/rds_instance_replica/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_replica/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_replica.yml b/tests/integration/targets/rds_instance_replica/tasks/main.yml similarity index 95% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_replica.yml rename to tests/integration/targets/rds_instance_replica/tasks/main.yml index 6bb01bcfb00..c282f1f23bc 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_replica.yml +++ b/tests/integration/targets/rds_instance_replica/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / replica integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: set the two regions for the source DB and the replica set_fact: diff --git a/tests/integration/targets/rds_instance_restore/aliases b/tests/integration/targets/rds_instance_restore/aliases new file mode 100644 index 00000000000..068a1ed9a74 --- /dev/null +++ b/tests/integration/targets/rds_instance_restore/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=20m +rds_instance diff --git a/tests/integration/targets/rds_instance_restore/defaults/main.yml b/tests/integration/targets/rds_instance_restore/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_restore/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_restore.yml b/tests/integration/targets/rds_instance_restore/tasks/main.yml similarity index 91% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_restore.yml rename to tests/integration/targets/rds_instance_restore/tasks/main.yml index f734235b551..c872db8804b 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_restore.yml +++ b/tests/integration/targets/rds_instance_restore/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / restore integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: # TODO: snapshot, s3 - name: Ensure the resource doesn't exist diff --git a/tests/integration/targets/rds_instance_sgroups/aliases b/tests/integration/targets/rds_instance_sgroups/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_sgroups/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_sgroups/defaults/main.yml b/tests/integration/targets/rds_instance_sgroups/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_sgroups/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_sgroups.yml b/tests/integration/targets/rds_instance_sgroups/tasks/main.yml similarity index 96% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_sgroups.yml rename to tests/integration/targets/rds_instance_sgroups/tasks/main.yml index 1847d7cf683..45c8f3b4e62 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_sgroups.yml +++ b/tests/integration/targets/rds_instance_sgroups/tasks/main.yml @@ -1,4 +1,12 @@ -- name: rds_instance test_vpc_security_groups tests +- name: rds_instance / sgroups integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' block: - name: create a VPC diff --git a/tests/integration/targets/rds_instance_snapshot_mgmt/aliases b/tests/integration/targets/rds_instance_snapshot_mgmt/aliases new file mode 100644 index 00000000000..c4ee3f5a640 --- /dev/null +++ b/tests/integration/targets/rds_instance_snapshot_mgmt/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=30m +rds_instance diff --git a/tests/integration/targets/rds_instance_snapshot_mgmt/defaults/main.yml b/tests/integration/targets/rds_instance_snapshot_mgmt/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_snapshot_mgmt/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_snapshot.yml b/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml similarity index 94% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_snapshot.yml rename to tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml index bcdaf190b5b..f8ac5d5f965 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_snapshot.yml +++ b/tests/integration/targets/rds_instance_snapshot_mgmt/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / snapshot_mgmt integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}' diff --git a/tests/integration/targets/rds_instance_states/aliases b/tests/integration/targets/rds_instance_states/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_states/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_states/defaults/main.yml b/tests/integration/targets/rds_instance_states/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_states/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_states.yml b/tests/integration/targets/rds_instance_states/tasks/main.yml similarity index 95% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_states.yml rename to tests/integration/targets/rds_instance_states/tasks/main.yml index c9291be5d64..fdcfcbf8a73 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_states.yml +++ b/tests/integration/targets/rds_instance_states/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / states integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}' diff --git a/tests/integration/targets/rds_instance_tagging/aliases b/tests/integration/targets/rds_instance_tagging/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_tagging/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_tagging/defaults/main.yml b/tests/integration/targets/rds_instance_tagging/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_tagging/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_tagging.yml b/tests/integration/targets/rds_instance_tagging/tasks/main.yml similarity index 94% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_tagging.yml rename to tests/integration/targets/rds_instance_tagging/tasks/main.yml index 7b15dc48e38..72ce4a826fc 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_tagging.yml +++ b/tests/integration/targets/rds_instance_tagging/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / tagging integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}' diff --git a/tests/integration/targets/rds_instance_upgrade/aliases b/tests/integration/targets/rds_instance_upgrade/aliases new file mode 100644 index 00000000000..de79d418d95 --- /dev/null +++ b/tests/integration/targets/rds_instance_upgrade/aliases @@ -0,0 +1,4 @@ +cloud/aws +rds_instance_info +time=15m +rds_instance \ No newline at end of file diff --git a/tests/integration/targets/rds_instance_upgrade/defaults/main.yml b/tests/integration/targets/rds_instance_upgrade/defaults/main.yml new file mode 100644 index 00000000000..c84aed0c230 --- /dev/null +++ b/tests/integration/targets/rds_instance_upgrade/defaults/main.yml @@ -0,0 +1,38 @@ +instance_id: ansible-test-{{ inventory_hostname | replace('_','-') }}{{ tiny_prefix + }} +modified_instance_id: '{{ instance_id }}-updated' +username: test +password: test12345678 +db_instance_class: db.t3.micro +storage_encrypted_db_instance_class: db.t3.small +modified_db_instance_class: db.t3.medium +allocated_storage: 20 +modified_allocated_storage: 30 +io1_allocated_storage: 100 +io1_modified_allocated_storage: 110 +monitoring_interval: 60 +preferred_maintenance_window: mon:06:20-mon:06:50 +storage_type: io1 +iops: 1000 + +# For aurora tests +cluster_id: '{{ instance_id }}-cluster' +aurora_db_instance_class: db.t3.medium + +# For oracle tests +# Smallest instance that permits modification of the coreCount +oracle_ee_db_instance_class: db.r5.2xlarge +modified_processor_features: + coreCount: 4 + threadsPerCore: 2 + +# For mariadb tests +mariadb_engine_version: 10.3.31 +mariadb_engine_version_2: 10.4.21 + +# For iam roles tests +postgres_db_instance_class: db.m6g.large # smallest psql instance +postgres_db_engine_version: 14.2 + +# For snapshot tests +snapshot_id: '{{ instance_id }}-ss' diff --git a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_upgrade.yml b/tests/integration/targets/rds_instance_upgrade/tasks/main.yml similarity index 91% rename from tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_upgrade.yml rename to tests/integration/targets/rds_instance_upgrade/tasks/main.yml index ba1397bf46c..5a21125435a 100644 --- a/tests/integration/targets/rds_instance/roles/rds_instance/tasks/test_upgrade.yml +++ b/tests/integration/targets/rds_instance_upgrade/tasks/main.yml @@ -1,4 +1,13 @@ -- block: +- name: rds_instance / upgrade integration tests + collections: + - community.aws + module_defaults: + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + block: - name: Ensure the resource doesn't exist rds_instance: id: '{{ instance_id }}'