feat(redshift): execute resource action#31995
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.
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.
| 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.
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.
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.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@badmintoncryer There's some conflicts. Would you mind fixing the conflicts. I think this PR is good to merge! |
|
@GavinZZ Thanks for your review! I've resolved conflicts. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #31995 +/- ##
==========================================
- Coverage 78.46% 78.42% -0.05%
==========================================
Files 106 106
Lines 7208 7208
Branches 1323 1323
==========================================
- Hits 5656 5653 -3
- Misses 1364 1368 +4
+ Partials 188 187 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
None
Reason for this change
We can perform various Redshift operation by specifying
ResourceActionprop 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
ResourceActionenumresourceActionprop toClusterPropsDescription 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