A CloudFormation resource which applies/restores a JSON patch into a Kubernetes resource.
import { KubernetesPatch } from 'aws-cdk-lib/aws-eks-v2';Or use the module namespace:
import * as eks_v2 from 'aws-cdk-lib/aws-eks-v2';
// eks_v2.KubernetesPatchConfiguration passed to the constructor as KubernetesPatchProps.
applyPatchRequired{ [key: string]: any }The JSON object to pass to `kubectl patch` when the resource is created/updated.
clusterRequiredIClusterThe cluster to apply the patch to. [disable-awslint:ref-via-interface]
resourceNameRequiredstringThe full name of the resource to patch (e.g. `deployment/coredns`).
restorePatchRequired{ [key: string]: any }The JSON object to pass to `kubectl patch` when the resource is removed.
patchTypeOptionalPatchTypeThe patch type to pass to `kubectl patch`. The default type used by `kubectl patch` is "strategic".
Default: PatchType.STRATEGIC
removalPolicyOptionalRemovalPolicyThe removal policy applied to the custom resource that manages the Kubernetes patch. The removal policy controls what happens to the resource if it stops being managed by CloudFormation. This can happen in one of three situations: - The resource is removed from the template, so CloudFormation stops managing it - A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it - The stack is deleted, so CloudFormation stops managing all resources in it
Default: RemovalPolicy.DESTROY
resourceNamespaceOptionalstringThe kubernetes API namespace.
Default: "default"
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-eks-v2