Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate task for creating Aurora RDS instances #559

Merged
merged 18 commits into from
Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions roles/aws/aws_rds/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -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:
Expand Down