Fix rds_instance module… (#56220)

* Fix rds_instance module to run against an (older) existing RDS instance successfully

* Only pop Iops param if no storage_type is given. If given and set to wrong type we get to the AWS client error that informs the user

* Docs syntax fix

* Fix typo in docs

Co-Authored-By: stefanhorning <stefan@hornings.de>
pull/57562/head
Stefan Horning 6 years ago committed by Sloane Hertel
parent 79685a4a2d
commit 8c631cbc0a

@ -212,7 +212,7 @@ options:
type: bool
iops:
description:
- The Provisioned IOPS (I/O operations per second) value.
- The Provisioned IOPS (I/O operations per second) value. Is only set when using I(storage_type) is set to io1.
type: int
kms_key_id:
description:
@ -846,6 +846,8 @@ def get_options_with_changing_values(client, module, parameters):
parameters.pop('MasterUserPassword', None)
if cloudwatch_logs_enabled:
parameters['CloudwatchLogsExportConfiguration'] = cloudwatch_logs_enabled
if not module.params['storage_type']:
parameters.pop('Iops')
instance = get_instance(client, module, instance_id)
updated_parameters = get_changing_options_with_inconsistent_keys(parameters, instance, purge_cloudwatch_logs)
@ -890,7 +892,8 @@ def get_current_attributes_with_inconsistent_keys(instance):
options['DBParameterGroupName'] = [parameter_group['DBParameterGroupName'] for parameter_group in instance['DBParameterGroups']]
options['AllowMajorVersionUpgrade'] = None
options['EnableIAMDatabaseAuthentication'] = instance['IAMDatabaseAuthenticationEnabled']
options['EnablePerformanceInsights'] = instance['PerformanceInsightsEnabled']
# PerformanceInsightsEnabled is not returned on older RDS instances it seems
options['EnablePerformanceInsights'] = instance.get('PerformanceInsightsEnabled', False)
options['MasterUserPassword'] = None
options['NewDBInstanceIdentifier'] = instance['DBInstanceIdentifier']

Loading…
Cancel
Save