diff --git a/roles/aws/aws_rds/tasks/main.yml b/roles/aws/aws_rds/tasks/main.yml index 8acfa201e..3d708438e 100644 --- a/roles/aws/aws_rds/tasks/main.yml +++ b/roles/aws/aws_rds/tasks/main.yml @@ -28,6 +28,28 @@ tags: "{{ aws_rds.tags | combine({ 'Name': aws_rds.name }) }}" when: aws_rds.db_parameters is defined +- name: Create Aurora RDS instance. + community.aws.rds_instance: + db_instance_identifier: "{{ aws_rds.name }}" + db_instance_class: "{{ aws_rds.db_instance_class }}" + db_cluster_identifier: "{{ aws_rds.db_cluster_identifier }}" + state: "{{ aws_rds.state }}" + engine: "{{ aws_rds.engine }}" + copy_tags_to_snapshot: true + publicly_accessible: "{{ aws_rds.publicly_accessible }}" + allocated_storage: "{{ aws_rds.allocated_storage }}" + max_allocated_storage: "{{ aws_rds.max_allocated_storage }}" + profile: "{{ aws_rds.aws_profile }}" + tags: "{{ aws_rds.tags | combine({ 'Name': aws_rds.name }) }}" + allow_major_version_upgrade: false + storage_encrypted: "{{ aws_rds.storage_encrypted }}" + apply_immediately: true + wait: true + region: "{{ aws_rds.region }}" + engine_version: "{{ aws_rds.engine_version | default(omit) }}" + register: _rds_instance_info + when: "'aurora' in aws_rds.engine" + - name: Create RDS instance community.aws.rds_instance: db_instance_identifier: "{{ aws_rds.name }}" @@ -61,6 +83,7 @@ engine_version: "{{ aws_rds.engine_version | default(omit) }}" #preferred_maintenance_window: undefined # not required. The weekly time range (in UTC) of at least 30 minutes, during which system maintenance can occur. The option must be in the format "ddd:hh24:mi-ddd:hh24:mi" where ddd is one of Mon, Tue, Wed, Thu, Fri, Sat, Sun. register: _rds_instance_info + when: "'aurora' not in aws_rds.engine" - name: Create RDS read replica instance. community.aws.rds_instance: