add max_allocated_storage parameter to rds_instance (#61008)

* #60921 add max_allocated_storage parameter add apply that parameter also to the integration test

* version_added 2.9

* test value of  max allocated storage
pull/61170/head
Markus Bergholz 5 years ago committed by Will Thames
parent 628aa3a808
commit 2fff40d409

@ -241,6 +241,11 @@ options:
aliases: aliases:
- username - username
type: str type: str
max_allocated_storage:
description:
- The upper limit to which Amazon RDS can automatically scale the storage of the DB instance.
type: int
version_added: "2.9"
monitoring_interval: monitoring_interval:
description: description:
- The interval, in seconds, when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting - The interval, in seconds, when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting
@ -643,6 +648,11 @@ master_username:
returned: always returned: always
type: str type: str
sample: test sample: test
max_allocated_storage:
description: The upper limit to which Amazon RDS can automatically scale the storage of the DB instance.
returned: When max allocated storage is present.
type: int
sample: 100
monitoring_interval: monitoring_interval:
description: description:
- The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. - The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.
@ -904,6 +914,9 @@ def get_changing_options_with_inconsistent_keys(modify_params, instance, purge_c
changing_params = {} changing_params = {}
current_options = get_current_attributes_with_inconsistent_keys(instance) current_options = get_current_attributes_with_inconsistent_keys(instance)
if current_options.get("MaxAllocatedStorage") is None:
current_options["MaxAllocatedStorage"] = None
for option in current_options: for option in current_options:
current_option = current_options[option] current_option = current_options[option]
desired_option = modify_params.pop(option, None) desired_option = modify_params.pop(option, None)
@ -1094,6 +1107,7 @@ def main():
license_model=dict(), license_model=dict(),
master_user_password=dict(aliases=['password'], no_log=True), master_user_password=dict(aliases=['password'], no_log=True),
master_username=dict(aliases=['username']), master_username=dict(aliases=['username']),
max_allocated_storage=dict(type='int'),
monitoring_interval=dict(type='int'), monitoring_interval=dict(type='int'),
monitoring_role_arn=dict(), monitoring_role_arn=dict(),
multi_az=dict(type='bool'), multi_az=dict(type='bool'),

@ -127,6 +127,7 @@
allow_major_version_upgrade: true allow_major_version_upgrade: true
auto_minor_version_upgrade: false auto_minor_version_upgrade: false
port: 1150 port: 1150
max_allocated_storage: 100
apply_immediately: True apply_immediately: True
<<: *aws_connection_info <<: *aws_connection_info
register: result register: result
@ -135,6 +136,7 @@
that: that:
- result.changed - result.changed
- '"allocated_storage" in result.pending_modified_values or result.allocated_storage == 30' - '"allocated_storage" in result.pending_modified_values or result.allocated_storage == 30'
- '"max_allocated_storage" in result.pending_modified_values or result.max_allocated_storage == 100'
- '"port" in result.pending_modified_values or result.endpoint.port == 1150' - '"port" in result.pending_modified_values or result.endpoint.port == 1150'
- '"db_instance_class" in result.pending_modified_values or result.db_instance_class == "db.t2.medium"' - '"db_instance_class" in result.pending_modified_values or result.db_instance_class == "db.t2.medium"'
- '"engine_version" in result.pending_modified_values or result.engine_version == "10.2.21"' - '"engine_version" in result.pending_modified_values or result.engine_version == "10.2.21"'
@ -152,6 +154,7 @@
allow_major_version_upgrade: true allow_major_version_upgrade: true
auto_minor_version_upgrade: false auto_minor_version_upgrade: false
port: 1150 port: 1150
max_allocated_storage: 100
<<: *aws_connection_info <<: *aws_connection_info
register: result register: result
retries: 30 retries: 30
@ -162,6 +165,7 @@
that: that:
- not result.changed - not result.changed
- '"allocated_storage" in result.pending_modified_values or result.allocated_storage == 30' - '"allocated_storage" in result.pending_modified_values or result.allocated_storage == 30'
- '"max_allocated_storage" in result.pending_modified_values or result.max_allocated_storage == 100'
- '"port" in result.pending_modified_values or result.endpoint.port == 1150' - '"port" in result.pending_modified_values or result.endpoint.port == 1150'
- '"db_instance_class" in result.pending_modified_values or result.db_instance_class == "db.t2.medium"' - '"db_instance_class" in result.pending_modified_values or result.db_instance_class == "db.t2.medium"'
- '"engine_version" in result.pending_modified_values or result.engine_version == "10.2.21"' - '"engine_version" in result.pending_modified_values or result.engine_version == "10.2.21"'

Loading…
Cancel
Save