Skip to content

Commit

Permalink
Tests - Replace use of db.t2 instance class (#2141) (#2147)
Browse files Browse the repository at this point in the history
This is a backport of PR #2141 as merged into main (52d3965).
SUMMARY
Amazon's dropping support for M4/R4/T2 RDS DB instances, replace their use in tests before something suddenly fails.
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
rds
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] committed Jun 25, 2024
1 parent 58554fe commit 6ef75f2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/2141-rds-t3-m4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trivial:
- rds_instance - remove references to deprecated ``m4`` and ``t2`` RDS instance types (https://github.com/ansible-collections/amazon.aws/pull/2141).
8 changes: 4 additions & 4 deletions plugins/modules/rds_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
type: str
db_instance_class:
description:
- The compute and memory capacity of the DB instance, for example db.t2.micro.
- The compute and memory capacity of the DB instance, for example V(db.t3.micro).
aliases:
- class
- instance_type
Expand Down Expand Up @@ -461,7 +461,7 @@
amazon.aws.rds_instance:
engine: aurora
db_instance_identifier: ansible-test-aurora-db-instance
instance_type: db.t2.small
instance_type: db.t3.small
password: "{{ password }}"
username: "{{ username }}"
cluster_id: ansible-test-cluster # This cluster must exist - see rds_cluster to manage it
Expand All @@ -472,7 +472,7 @@
state: present
engine: mariadb
storage_encrypted: true
db_instance_class: db.t2.medium
db_instance_class: db.t3.medium
username: "{{ username }}"
password: "{{ password }}"
allocated_storage: "{{ allocated_storage }}"
Expand Down Expand Up @@ -600,7 +600,7 @@
description: The name of the compute and memory capacity class of the DB instance.
returned: always
type: str
sample: db.m4.large
sample: db.m5.large
db_instance_identifier:
description: The identifier of the DB instance
returned: always
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/rds_instance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
description: Instance class of the database instance
returned: always
type: str
sample: db.t2.small
sample: db.t3.small
db_instance_identifier:
description: Database instance identifier
returned: always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
amazon.aws.rds_instance:
state: present
engine: "{{ instance_engine }}"
db_instance_class: db.t2.micro
db_instance_class: db.t3.micro
allocated_storage: 20
instance_id: "{{ instance_id }}"
master_username: ansibletestuser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: assert the hostvars are defined with prefix and/or suffix
ansible.builtin.assert:
that:
- hostvars[instance_id][vars_prefix+"db_instance_class"+vars_suffix] == 'db.t2.micro'
- hostvars[instance_id][vars_prefix+"db_instance_class"+vars_suffix] == 'db.t3.micro'
- hostvars[instance_id][vars_prefix+"engine"+vars_suffix] == instance_engine
- hostvars[instance_id][vars_prefix+"db_instance_status"+vars_suffix] in ('available', 'creating')
- "'db_instance_class' not in hostvars[instance_id]"
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/targets/rds_option_group/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ option_group_description: "{{ resource_prefix }}rds-option-group test"
instance_id: "{{ resource_prefix }}"
username: test
password: test12345678
db_instance_class: db.t2.small
storage_encrypted_db_instance_class: db.t2.small
db_instance_class: db.t3.small
storage_encrypted_db_instance_class: db.t3.small
allocated_storage: 20
vpc_name: "{{ resource_prefix }}-vpc"
vpc_seed: "{{ resource_prefix }}"
Expand Down

0 comments on commit 6ef75f2

Please sign in to comment.