-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[aws-eks] Cannot call applyRemovalPolicy on KubernetesManifest objects #9921
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServiceRelated to Amazon Elastic Kubernetes ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
In an attempt to prevent a Kubernetes resource from being deleted during stack destruction, I tried to use the current tribal-knowledge method:
const meshResource = cluster.addManifest(`Mesh${clusterName}`, {
apiVersion: "appmesh.k8s.aws/v1beta2",
kind: "Mesh",
metadata: {
name: "mesh",
},
spec: {
awsName: mesh.meshName,
namespaceSelector: {
matchLabels: {
mesh: mesh.meshName,
},
},
},
});
meshResource.node.addDependency(mesh, appMeshController);
(meshResource.node.defaultChild as cdk.CfnResource).applyRemovalPolicy(cdk.RemovalPolicy.RETAIN);This did not work:
$ npm run cdk synth
...
meshResource.node.defaultChild.applyRemovalPolicy is not a function
Subprocess exited with error 1
Environment
- CLI Version : 1.60.0
- Framework Version: 1.60.0
- Node.js Version: 12.18.2
- OS : MacOS Catalina
- Language (Version): TypeScript
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-eksRelated to Amazon Elastic Kubernetes ServiceRelated to Amazon Elastic Kubernetes ServicebugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1