Interface KubernetesPatchProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
KubernetesPatchProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-09T14:39:10.765Z") @Stability(Stable) public interface KubernetesPatchProps extends software.amazon.jsii.JsiiSerializable
Properties for KubernetesPatch.

Example:

 Cluster cluster;
 KubernetesPatch.Builder.create(this, "hello-kub-deployment-label")
         .cluster(cluster)
         .resourceName("deployment/hello-kubernetes")
         .applyPatch(Map.of("spec", Map.of("replicas", 5)))
         .restorePatch(Map.of("spec", Map.of("replicas", 3)))
         .build();
 
  • Method Details

    • getApplyPatch

      @Stability(Stable) @NotNull Map<String,Object> getApplyPatch()
      The JSON object to pass to kubectl patch when the resource is created/updated.
    • getCluster

      @Stability(Stable) @NotNull ICluster getCluster()
      The cluster to apply the patch to.

      [disable-awslint:ref-via-interface]

    • getResourceName

      @Stability(Stable) @NotNull String getResourceName()
      The full name of the resource to patch (e.g. deployment/coredns).
    • getRestorePatch

      @Stability(Stable) @NotNull Map<String,Object> getRestorePatch()
      The JSON object to pass to kubectl patch when the resource is removed.
    • getPatchType

      @Stability(Stable) @Nullable default PatchType getPatchType()
      The patch type to pass to kubectl patch.

      The default type used by kubectl patch is "strategic".

      Default: PatchType.STRATEGIC

    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      The 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

    • getResourceNamespace

      @Stability(Stable) @Nullable default String getResourceNamespace()
      The kubernetes API namespace.

      Default: "default"

    • builder

      @Stability(Stable) static KubernetesPatchProps.Builder builder()
      Returns:
      a KubernetesPatchProps.Builder of KubernetesPatchProps