Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(redshift): relocating a cluster (#31993)
### Issue # (if applicable) None ### Reason for this change AWS Redshift supports for configuring [relocation a cluster](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-recovery.html) and this feature is supported by [cfn](https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-redshift-cluster.html#cfn-redshift-cluster-availabilityzonerelocationstatus). ### Description of changes Add `availabilityZoneRelocation` to `CusterProps`. [Documents](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-recovery.html) says that this feature is not supported for DC2 node type. ``` Relocation isn't supported on DC2 instance families of products. ``` However, this feature is only supported for RA3 node type in actual. Example implementation: ```ts new redshift.Cluster(stack, 'Cluster', { vpc: vpc, masterUser: { masterUsername: 'admin', }, availabilityZoneRelocation: true, nodeType: redshift.NodeType.DC2_LARGE, }); ``` Result: ```sh Failed resources: AzRelocationClusterStack | 6:52:00 PM | CREATE_FAILED | AWS::Redshift::Cluster | Cluster (ClusterEB0386A7) Resource handler returned message: "If the cluster node type isn?t RA3, availability zone relocation isn?t supported. (Service: Redshift, Status Code: 400, Request ID: 6382b593-cce5-4fe5-b4de-de1ad1c3a604)" (RequestToken: 94c999d9-7b72-19c4-9cfe-154fe6abc717, HandlerErrorCode: GeneralServiceException) ``` So I added this validation. ```ts if (props.availabilityZoneRelocation && !nodeType.startsWith('ra3')) { throw new Error(`Availability zone relocation is supported for only RA3 node types, got: ${props.nodeType}`); } ``` ### Description of how you validated changes Add both unit and integ tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information