-
Notifications
You must be signed in to change notification settings - Fork 358
Add Performance Insights and Database Insights to rds_cluster.py #2543
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
base: main
Are you sure you want to change the base?
Changes from 5 commits
e3c4f36
1bb572c
a3fdb70
92322d2
606b7d4
f7c019e
598b012
dbec6b4
d4871b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- Add functionality to enable Performance Insights and Database Insights at cluster level (https://github.com/ansible-collections/amazon.aws/pull/2543). |
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -97,6 +97,11 @@ | |||||||||||
description: | ||||||||||||
- The character set to associate with the DB cluster. | ||||||||||||
type: str | ||||||||||||
database_insights_mode | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's another one:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handled in next commit. |
||||||||||||
description: | ||||||||||||
- Indicates which mode of Database Insights to enable for the target DB cluster. Options are 'advanced' or 'standard' | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are the values that are expected when modifying an rds cluster: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With
Suggested change
(You'll also have to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handled in next commit |
||||||||||||
type: str | ||||||||||||
versions_added: 9.4.0 | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new options have the field
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice catch-thanks! |
||||||||||||
database_name: | ||||||||||||
description: | ||||||||||||
- The name for your database. If a name is not provided Amazon RDS will not create a database. | ||||||||||||
|
@@ -177,6 +182,11 @@ | |||||||||||
- Enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. | ||||||||||||
If this option is omitted when creating the cluster, Amazon RDS sets this to C(false). | ||||||||||||
type: bool | ||||||||||||
enable_performance_insights: | ||||||||||||
randoneering marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
description: | ||||||||||||
- Whether to enable Performance Insights for the DB cluster. | ||||||||||||
type: bool | ||||||||||||
versions_added: 9.4.0 | ||||||||||||
allocated_storage: | ||||||||||||
description: | ||||||||||||
- The amount of storage in gibibytes (GiB) to allocate to each DB instance in the Multi-AZ DB cluster. | ||||||||||||
|
@@ -285,6 +295,16 @@ | |||||||||||
description: | ||||||||||||
- The option group to associate with the DB cluster. | ||||||||||||
type: str | ||||||||||||
performance_insights_kms_key_id: | ||||||||||||
randoneering marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
description: | ||||||||||||
- The AWS KMS key identifier (ARN, name, or alias) for encryption of Performance Insights data. | ||||||||||||
type: str | ||||||||||||
versions_added: 9.4.0 | ||||||||||||
performance_insights_retention_period: | ||||||||||||
description: | ||||||||||||
randoneering marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
- The amount of time, in days, to retain Performance Insights data. Valid values are V(7) or V(731). | ||||||||||||
type: int | ||||||||||||
versions_added: 9.4.0 | ||||||||||||
port: | ||||||||||||
description: | ||||||||||||
- The port number on which the instances in the DB cluster accept connections. If not specified, Amazon RDS | ||||||||||||
|
@@ -822,13 +842,17 @@ def get_create_options(params_dict): | |||||||||||
"DBClusterIdentifier", | ||||||||||||
"DBClusterParameterGroupName", | ||||||||||||
"DBSubnetGroupName", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
"DatabaseName", | ||||||||||||
"EnableCloudwatchLogsExports", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"KmsKeyId", | ||||||||||||
"Engine", | ||||||||||||
"EngineMode", | ||||||||||||
"EngineVersion", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
"PreferredMaintenanceWindow", | ||||||||||||
"MasterUserPassword", | ||||||||||||
"MasterUsername", | ||||||||||||
|
@@ -865,15 +889,19 @@ def get_modify_options(params_dict, force_update_password): | |||||||||||
"BacktrackWindow", | ||||||||||||
"BackupRetentionPeriod", | ||||||||||||
"PreferredBackupWindow", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
"DBClusterIdentifier", | ||||||||||||
"DBClusterParameterGroupName", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"EngineVersion", | ||||||||||||
"PreferredMaintenanceWindow", | ||||||||||||
"MasterUserPassword", | ||||||||||||
"NewDBClusterIdentifier", | ||||||||||||
"OptionGroupName", | ||||||||||||
"Port", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
"VpcSecurityGroupIds", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"CloudwatchLogsExportConfiguration", | ||||||||||||
|
@@ -907,18 +935,22 @@ def get_restore_s3_options(params_dict): | |||||||||||
"BacktrackWindow", | ||||||||||||
"BackupRetentionPeriod", | ||||||||||||
"CharacterSetName", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of these options are supported by https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds/client/restore_db_cluster_from_s3.html#RDS.Client.restore_db_cluster_from_s3. These attributes could be modified after restoring the cluster. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that when I was doing research last night. I haven't changed it yet but currently debugging in difference branch. Thank you for looking into it! If I didn't see it last night, your comment would have! |
||||||||||||
"DBClusterIdentifier", | ||||||||||||
"DBClusterParameterGroupName", | ||||||||||||
"DBSubnetGroupName", | ||||||||||||
"DatabaseName", | ||||||||||||
"EnableCloudwatchLogsExports", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"Engine", | ||||||||||||
"EngineVersion", | ||||||||||||
"KmsKeyId", | ||||||||||||
"MasterUserPassword", | ||||||||||||
"MasterUsername", | ||||||||||||
"OptionGroupName", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
randoneering marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
"Port", | ||||||||||||
"PreferredBackupWindow", | ||||||||||||
"PreferredMaintenanceWindow", | ||||||||||||
|
@@ -935,6 +967,10 @@ def get_restore_s3_options(params_dict): | |||||||||||
"CopyTagsToSnapshot", | ||||||||||||
"Domain", | ||||||||||||
"DomainIAMRoleName", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
] | ||||||||||||
|
||||||||||||
return dict((k, v) for k, v in params_dict.items() if k in options and v is not None) | ||||||||||||
|
@@ -944,15 +980,19 @@ def get_restore_snapshot_options(params_dict): | |||||||||||
options = [ | ||||||||||||
"AvailabilityZones", | ||||||||||||
"BacktrackWindow", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option and PerformanceInsightsEnabled aren't supported by https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds/client/restore_db_cluster_from_snapshot.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment above-will fix in next commit! |
||||||||||||
"DBClusterIdentifier", | ||||||||||||
"DBSubnetGroupName", | ||||||||||||
"DatabaseName", | ||||||||||||
"EnableCloudwatchLogsExports", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"Engine", | ||||||||||||
"EngineVersion", | ||||||||||||
"KmsKeyId", | ||||||||||||
"OptionGroupName", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
"Port", | ||||||||||||
"SnapshotIdentifier", | ||||||||||||
"Tags", | ||||||||||||
|
@@ -969,12 +1009,16 @@ def get_restore_snapshot_options(params_dict): | |||||||||||
def get_restore_cluster_options(params_dict): | ||||||||||||
options = [ | ||||||||||||
"BacktrackWindow", | ||||||||||||
"DatabaseInsightsMode", | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This option and PerformanceInsightsEnabled aren't supported by https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds/client/restore_db_cluster_to_point_in_time.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment, will fix in next commit! |
||||||||||||
"DBClusterIdentifier", | ||||||||||||
"DBSubnetGroupName", | ||||||||||||
"EnableCloudwatchLogsExports", | ||||||||||||
"EnableIAMDatabaseAuthentication", | ||||||||||||
"EnablePerformanceInsights", | ||||||||||||
"KmsKeyId", | ||||||||||||
"OptionGroupName", | ||||||||||||
"PerformanceInsightsKMSKeyId", | ||||||||||||
"PerformanceInsightsRetentionPeriod", | ||||||||||||
"Port", | ||||||||||||
"RestoreToTime", | ||||||||||||
"RestoreType", | ||||||||||||
|
@@ -1092,6 +1136,22 @@ def changing_cluster_options(modify_params, current_cluster): | |||||||||||
g["DBClusterOptionGroupName"] for g in current_cluster["DBClusterOptionGroupMemberships"] | ||||||||||||
]: | ||||||||||||
changing_params["OptionGroupName"] = option_group | ||||||||||||
|
||||||||||||
enable_performance_insights = modify_params.pop("EnablePerformanceInsights", None) | ||||||||||||
if enable_performance_insights != current_cluster["EnablePerformanceInsights"]: | ||||||||||||
changing_params["EnablePerformanceInsights"] = enable_performance_insights | ||||||||||||
|
||||||||||||
performance_insights_kms_key_id = modify_params.pop("PerformanceInsightsKMSKeyId", None) | ||||||||||||
if performance_insights_kms_key_id != current_cluster["PerformanceInsightsKMSKeyId"]: | ||||||||||||
changing_params["PerformanceInsightsKMSKeyId"] = performance_insights_kms_key_id | ||||||||||||
|
||||||||||||
performance_insights_retention_period = modify_params("PerformanceInsightsRetentionPeriod", None) | ||||||||||||
if performance_insights_retention_period != current_cluster["PerformanceInsightsRetentionPeriod"]: | ||||||||||||
changing_params["PerformanceInsightsRetentionPeriod"] = performance_insights_retention_period | ||||||||||||
|
||||||||||||
database_insights_mode = modify_params.pop("DatabaseInsightsMode", None) | ||||||||||||
if database_insights_mode != current_cluster["DatabaseInsightsMode"]: | ||||||||||||
changing_params["DatabaseInsightsMode"] = database_insights_mode | ||||||||||||
|
||||||||||||
vpc_sgs = modify_params.pop("VpcSecurityGroupIds", None) | ||||||||||||
if vpc_sgs: | ||||||||||||
|
@@ -1259,10 +1319,12 @@ def main(): | |||||||||||
backup_retention_period=dict(type="int", default=1), | ||||||||||||
character_set_name=dict(), | ||||||||||||
database_name=dict(aliases=["db_name"]), | ||||||||||||
database_insights_mode=dict(choices=["standard","advanced"]), | ||||||||||||
db_cluster_identifier=dict(required=True, aliases=["cluster_id", "id", "cluster_name"]), | ||||||||||||
db_cluster_parameter_group_name=dict(), | ||||||||||||
db_subnet_group_name=dict(), | ||||||||||||
enable_cloudwatch_logs_exports=dict(type="list", elements="str"), | ||||||||||||
enable_performance_insights=dict(type="bool"), | ||||||||||||
deletion_protection=dict(type="bool"), | ||||||||||||
global_cluster_identifier=dict(), | ||||||||||||
enable_http_endpoint=dict(type="bool"), | ||||||||||||
|
@@ -1286,6 +1348,8 @@ def main(): | |||||||||||
new_db_cluster_identifier=dict(aliases=["new_cluster_id", "new_id", "new_cluster_name"]), | ||||||||||||
option_group_name=dict(), | ||||||||||||
port=dict(type="int"), | ||||||||||||
performance_insights_kms_key_id=dict(), | ||||||||||||
performance_insights_retention_period=dict(type="int"), | ||||||||||||
preferred_backup_window=dict(aliases=["backup_window"]), | ||||||||||||
preferred_maintenance_window=dict(aliases=["maintenance_window"]), | ||||||||||||
remove_from_global_db=dict(type="bool"), | ||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.