Class: AWSCDK::EKS::KubernetesPatchProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKS::KubernetesPatchProps
- Defined in:
- eks/kubernetes_patch_props.rb
Overview
Properties for KubernetesPatch.
Instance Attribute Summary collapse
-
#apply_patch ⇒ Hash{String => Object}
readonly
The JSON object to pass to
kubectl patchwhen the resource is created/updated. -
#cluster ⇒ AWSCDK::EKS::ICluster
readonly
The cluster to apply the patch to.
-
#patch_type ⇒ AWSCDK::EKS::PatchType?
readonly
The patch type to pass to
kubectl patch. -
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the custom resource that manages the Kubernetes patch.
-
#resource_name ⇒ String
readonly
The full name of the resource to patch (e.g.
deployment/coredns). -
#resource_namespace ⇒ String?
readonly
The kubernetes API namespace.
-
#restore_patch ⇒ Hash{String => Object}
readonly
The JSON object to pass to
kubectl patchwhen the resource is removed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(apply_patch:, cluster:, resource_name:, restore_patch:, patch_type: nil, removal_policy: nil, resource_namespace: nil) ⇒ KubernetesPatchProps
constructor
A new instance of KubernetesPatchProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(apply_patch:, cluster:, resource_name:, restore_patch:, patch_type: nil, removal_policy: nil, resource_namespace: nil) ⇒ KubernetesPatchProps
Returns a new instance of KubernetesPatchProps.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'eks/kubernetes_patch_props.rb', line 14 def initialize(apply_patch:, cluster:, resource_name:, restore_patch:, patch_type: nil, removal_policy: nil, resource_namespace: nil) @apply_patch = apply_patch Jsii::Type.check_type(@apply_patch, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "applyPatch") @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklDbHVzdGVyIn0=")), "cluster") @resource_name = resource_name Jsii::Type.check_type(@resource_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceName") @restore_patch = restore_patch Jsii::Type.check_type(@restore_patch, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "restorePatch") @patch_type = patch_type Jsii::Type.check_type(@patch_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLlBhdGNoVHlwZSJ9")), "patchType") unless @patch_type.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @resource_namespace = resource_namespace Jsii::Type.check_type(@resource_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceNamespace") unless @resource_namespace.nil? end |
Instance Attribute Details
#apply_patch ⇒ Hash{String => Object} (readonly)
The JSON object to pass to kubectl patch when the resource is created/updated.
34 35 36 |
# File 'eks/kubernetes_patch_props.rb', line 34 def apply_patch @apply_patch end |
#cluster ⇒ AWSCDK::EKS::ICluster (readonly)
The cluster to apply the patch to.
[disable-awslint:ref-via-interface]
40 41 42 |
# File 'eks/kubernetes_patch_props.rb', line 40 def cluster @cluster end |
#patch_type ⇒ AWSCDK::EKS::PatchType? (readonly)
Default: PatchType.STRATEGIC
The patch type to pass to kubectl patch.
The default type used by kubectl patch is "strategic".
55 56 57 |
# File 'eks/kubernetes_patch_props.rb', line 55 def patch_type @patch_type end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
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
67 68 69 |
# File 'eks/kubernetes_patch_props.rb', line 67 def removal_policy @removal_policy end |
#resource_name ⇒ String (readonly)
The full name of the resource to patch (e.g. deployment/coredns).
44 45 46 |
# File 'eks/kubernetes_patch_props.rb', line 44 def resource_name @resource_name end |
#resource_namespace ⇒ String? (readonly)
Default: "default"
The kubernetes API namespace.
72 73 74 |
# File 'eks/kubernetes_patch_props.rb', line 72 def resource_namespace @resource_namespace end |
#restore_patch ⇒ Hash{String => Object} (readonly)
The JSON object to pass to kubectl patch when the resource is removed.
48 49 50 |
# File 'eks/kubernetes_patch_props.rb', line 48 def restore_patch @restore_patch end |
Class Method Details
.jsii_properties ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 |
# File 'eks/kubernetes_patch_props.rb', line 74 def self.jsii_properties { :apply_patch => "applyPatch", :cluster => "cluster", :resource_name => "resourceName", :restore_patch => "restorePatch", :patch_type => "patchType", :removal_policy => "removalPolicy", :resource_namespace => "resourceNamespace", } end |
Instance Method Details
#to_jsii ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'eks/kubernetes_patch_props.rb', line 86 def to_jsii result = {} result.merge!({ "applyPatch" => @apply_patch, "cluster" => @cluster, "resourceName" => @resource_name, "restorePatch" => @restore_patch, "patchType" => @patch_type, "removalPolicy" => @removal_policy, "resourceNamespace" => @resource_namespace, }) result.compact end |