Class: AWSCDK::EKS::ServiceAccountProps
- Inherits:
-
ServiceAccountOptions
- Object
- ServiceAccountOptions
- AWSCDK::EKS::ServiceAccountProps
- Defined in:
- eks/service_account_props.rb
Overview
Properties for defining service accounts.
Instance Attribute Summary collapse
-
#annotations ⇒ Hash{String => String}?
readonly
Additional annotations of the service account.
-
#cluster ⇒ AWSCDK::EKS::ICluster
readonly
The cluster to apply the patch to.
-
#identity_type ⇒ AWSCDK::EKS::IdentityType?
readonly
The identity type to use for the service account.
-
#labels ⇒ Hash{String => String}?
readonly
Additional labels of the service account.
-
#name ⇒ String?
readonly
The name of the service account.
-
#namespace ⇒ String?
readonly
The namespace of the service account.
-
#overwrite_service_account ⇒ Boolean?
readonly
Overwrite existing service account.
-
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the service account resources.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil, cluster:) ⇒ ServiceAccountProps
constructor
A new instance of ServiceAccountProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil, cluster:) ⇒ ServiceAccountProps
Returns a new instance of ServiceAccountProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'eks/service_account_props.rb', line 15 def initialize(annotations: nil, identity_type: nil, labels: nil, name: nil, namespace: nil, overwrite_service_account: nil, removal_policy: nil, cluster:) @annotations = annotations Jsii::Type.check_type(@annotations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "annotations") unless @annotations.nil? @identity_type = identity_type Jsii::Type.check_type(@identity_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklkZW50aXR5VHlwZSJ9")), "identityType") unless @identity_type.nil? @labels = labels Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "labels") unless @labels.nil? @name = name Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil? @namespace = namespace Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil? @overwrite_service_account = overwrite_service_account Jsii::Type.check_type(@overwrite_service_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "overwriteServiceAccount") unless @overwrite_service_account.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @cluster = cluster Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLklDbHVzdGVyIn0=")), "cluster") end |
Instance Attribute Details
#annotations ⇒ Hash{String => String}? (readonly)
Default: - no additional annotations
Additional annotations of the service account.
38 39 40 |
# File 'eks/service_account_props.rb', line 38 def annotations @annotations end |
#cluster ⇒ AWSCDK::EKS::ICluster (readonly)
The cluster to apply the patch to.
89 90 91 |
# File 'eks/service_account_props.rb', line 89 def cluster @cluster end |
#identity_type ⇒ AWSCDK::EKS::IdentityType? (readonly)
Default: IdentityType.IRSA
The identity type to use for the service account.
43 44 45 |
# File 'eks/service_account_props.rb', line 43 def identity_type @identity_type end |
#labels ⇒ Hash{String => String}? (readonly)
Default: - no additional labels
Additional labels of the service account.
48 49 50 |
# File 'eks/service_account_props.rb', line 48 def labels @labels end |
#name ⇒ String? (readonly)
Default: - If no name is given, it will use the id of the resource.
The name of the service account.
The name of a ServiceAccount object must be a valid DNS subdomain name. https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
56 57 58 |
# File 'eks/service_account_props.rb', line 56 def name @name end |
#namespace ⇒ String? (readonly)
Default: "default"
The namespace of the service account.
All namespace names must be valid RFC 1123 DNS labels. https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns
64 65 66 |
# File 'eks/service_account_props.rb', line 64 def namespace @namespace end |
#overwrite_service_account ⇒ Boolean? (readonly)
Default: false
Overwrite existing service account.
If this is set, we will use kubectl apply instead of kubectl create
when the service account is created. Otherwise, if there is already a service account
in the cluster with the same name, the operation will fail.
73 74 75 |
# File 'eks/service_account_props.rb', line 73 def overwrite_service_account @overwrite_service_account end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the service account resources.
The removal policy controls what happens to the resources if they stop 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
85 86 87 |
# File 'eks/service_account_props.rb', line 85 def removal_policy @removal_policy end |
Class Method Details
.jsii_properties ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'eks/service_account_props.rb', line 91 def self.jsii_properties { :annotations => "annotations", :identity_type => "identityType", :labels => "labels", :name => "name", :namespace => "namespace", :overwrite_service_account => "overwriteServiceAccount", :removal_policy => "removalPolicy", :cluster => "cluster", } end |
Instance Method Details
#to_jsii ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'eks/service_account_props.rb', line 104 def to_jsii result = {} result.merge!(super) result.merge!({ "annotations" => @annotations, "identityType" => @identity_type, "labels" => @labels, "name" => @name, "namespace" => @namespace, "overwriteServiceAccount" => @overwrite_service_account, "removalPolicy" => @removal_policy, "cluster" => @cluster, }) result.compact end |