-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(redshift): execute resource action #31995
base: main
Are you sure you want to change the base?
Conversation
if (props.resourceAction === ResourceAction.FAILOVER_PRIMARY_COMPUTE && !props.multiAz) { | ||
throw new Error('ResourceAction.FAILOVER_PRIMARY_COMPUTE can only be used with multi-AZ clusters.'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to execute failover for the single AZ cluster but I got a deployment error.
const singleAzCluster = new redshiftAlpha.Cluster(this, 'SingleAzCluster', {
vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.PUBLIC,
},
masterUser: {
masterUsername: 'admin',
},
nodeType: redshiftAlpha.NodeType.RA3_XLPLUS,
publiclyAccessible: true,
});
const cfnSingleAzCluster = singleAzCluster.node.defaultChild as redshift.CfnCluster;
cfnSingleAzCluster.addPropertyOverride('ResourceAction', 'failover-primary-compute');
Results:
8:50:18 | UPDATE_FAILED | AWS::Redshift::Cluster | SingleAzCluster885C9BDD
Resource handler returned message: "Cannot invoke "java.lang.Boolean.booleanValue()" because the return value of "software.amazon.redshift
.cluster.ResourceModel.getMultiAZ()" is null" (RequestToken: d865c8ea-217c-ff00-0c71-1b659fdf6233, HandlerErrorCode: InternalFailure)
I also confirmed we can execute failover operation for a multi-AZ cluster.
if (props.resourceAction === ResourceAction.FAILOVER_PRIMARY_COMPUTE && !props.multiAz) { | ||
throw new Error('ResourceAction.FAILOVER_PRIMARY_COMPUTE can only be used with multi-AZ clusters.'); | ||
} | ||
|
||
this.cluster = new CfnCluster(this, 'Resource', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.
Ensure that user activity logging is enabled for the Redshift cluster. This feature logs each query before it is executed on the cluster's database. To activate this, associate a Redshift Cluster Parameter Group with the enable_user_activity_logging
parameter set to true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this feedback is inappropriate. This implementation is for existing L2 code, and to avoid breaking changes, we should not forcefully enable enable_user_activity_logging.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
None
Reason for this change
We can perform various Redshift operation by specifying
ResourceAction
prop but AWS CDK cannot do this.https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-cluster.html#cfn-redshift-cluster-resourceaction
Description of changes
ResourceAction
enumresourceAction
prop toClusterProps
Description of how you validated changes
Add both unit and integ tests.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license