forked from ansible-collections/amazon.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rds_cluster: add support for ServerlessV2ScalingConfiguration (ansibl…
…e-collections#1839) rds_cluster: add support for ServerlessV2ScalingConfiguration SUMMARY Fixes ansible-collections#1476 Add support for ServerlessV2ScalingConfiguration in create_db_cluster and modify_db_cluster https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ServerlessV2ScalingConfiguration.html https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.html ISSUE TYPE Feature Pull Request COMPONENT NAME rds_cluster ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis Reviewed-by: Helen Bailey <[email protected]> Reviewed-by: GomathiselviS
- Loading branch information
Showing
5 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...gelogs/fragments/1839-rds_cluster-add-support-for-serverless_v2_scaling_configuration.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- rds_cluster - Add support for ServerlessV2ScalingConfiguration to create and modify cluster operations (https://github.com/ansible-collections/amazon.aws/pull/1839). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
...s/rds_cluster_modify/tasks/create_update_cluster_serverless_v2_scaling_configuration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
--- | ||
- name: Run tests for testing serverless v2 scaling configuration | ||
block: | ||
- name: Create a cluster (check_mode) | ||
amazon.aws.rds_cluster: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
engine: "{{ test_engine }}" | ||
engine_version: "{{ test_engine_version }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
serverless_v2_scaling_configuration: | ||
min_capacity: "{{ min_capacity }}" | ||
max_capacity: "{{ max_capacity }}" | ||
check_mode: true | ||
register: create_result_check_mode | ||
|
||
- name: Get RDS cluster info | ||
amazon.aws.rds_cluster_info: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- create_result_check_mode is changed | ||
- create_result_check_mode is not failed | ||
- result.clusters | length == 0 | ||
|
||
- name: Create a cluster | ||
amazon.aws.rds_cluster: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
engine: "{{ test_engine }}" | ||
engine_version: "{{ test_engine_version }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
serverless_v2_scaling_configuration: | ||
min_capacity: "{{ min_capacity }}" | ||
max_capacity: "{{ max_capacity }}" | ||
register: create_result | ||
|
||
- name: Get RDS cluster info | ||
amazon.aws.rds_cluster_info: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- create_result is changed | ||
- create_result is not failed | ||
- result.clusters[0].serverless_v2_scaling_configuration is defined | ||
- result.clusters[0].serverless_v2_scaling_configuration.min_capacity == 2.5 | ||
- result.clusters[0].serverless_v2_scaling_configuration.max_capacity == 4.5 | ||
|
||
- name: Modify cluster - update serverless v2 scaling configuration (check_mode) | ||
amazon.aws.rds_cluster: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
engine: "{{ test_engine }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
serverless_v2_scaling_configuration: | ||
min_capacity: 2 | ||
max_capacity: 5 | ||
check_mode: true | ||
register: modify_result_check_mode | ||
|
||
- name: Get RDS cluster info | ||
amazon.aws.rds_cluster_info: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- modify_result_check_mode is changed | ||
- modify_result_check_mode is not failed | ||
- result.clusters[0].serverless_v2_scaling_configuration is defined | ||
- result.clusters[0].serverless_v2_scaling_configuration.min_capacity != 2 | ||
- result.clusters[0].serverless_v2_scaling_configuration.max_capacity != 5 | ||
|
||
- name: Modify cluster - update serverless v2 scaling configuration | ||
amazon.aws.rds_cluster: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
engine: "{{ test_engine }}" | ||
username: "{{ username }}" | ||
password: "{{ password }}" | ||
serverless_v2_scaling_configuration: | ||
min_capacity: 2 | ||
max_capacity: 5 | ||
register: modify_result | ||
|
||
- name: Get RDS cluster info | ||
amazon.aws.rds_cluster_info: | ||
db_cluster_identifier: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- modify_result is changed | ||
- modify_result is not failed | ||
- result.clusters[0].serverless_v2_scaling_configuration is defined | ||
- result.clusters[0].serverless_v2_scaling_configuration.min_capacity == 2 | ||
- result.clusters[0].serverless_v2_scaling_configuration.max_capacity == 5 | ||
|
||
always: | ||
|
||
- name: Delete DB cluster created in this test | ||
amazon.aws.rds_cluster: | ||
cluster_id: "{{ cluster_id }}" | ||
region: "{{ aws_region }}" | ||
skip_final_snapshot: true | ||
state: absent | ||
ignore_errors: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters