Class: AWSCDK::EKSv2::KubectlProviderOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EKSv2::KubectlProviderOptions
- Defined in:
- ek_sv2/kubectl_provider_options.rb
Overview
Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#awscli_layer ⇒ AWSCDK::Lambda::ILayerVersion?
readonly
An AWS Lambda layer that contains the
awsCLI. -
#environment ⇒ Hash{String => String}?
readonly
Custom environment variables when running
kubectlagainst this cluster. -
#kubectl_layer ⇒ AWSCDK::Lambda::ILayerVersion
readonly
An AWS Lambda layer that includes
kubectlandhelm. -
#memory ⇒ AWSCDK::Size?
readonly
The amount of memory allocated to the kubectl provider's lambda function.
-
#private_subnets ⇒ Array<AWSCDK::EC2::ISubnet>?
readonly
Subnets to host the
kubectlcompute resources. -
#removal_policy ⇒ AWSCDK::RemovalPolicy?
readonly
The removal policy applied to the custom resource that provides kubectl.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
An IAM role that can perform kubectl operations against this cluster.
-
#security_group ⇒ AWSCDK::EC2::ISecurityGroup?
readonly
deprecated
Deprecated.
Use
securityGroupsinstead. -
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>?
readonly
Security groups to use for
kubectlexecution.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kubectl_layer:, awscli_layer: nil, environment: nil, memory: nil, private_subnets: nil, removal_policy: nil, role: nil, security_group: nil, security_groups: nil) ⇒ KubectlProviderOptions
constructor
A new instance of KubectlProviderOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(kubectl_layer:, awscli_layer: nil, environment: nil, memory: nil, private_subnets: nil, removal_policy: nil, role: nil, security_group: nil, security_groups: nil) ⇒ KubectlProviderOptions
Returns a new instance of KubectlProviderOptions.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'ek_sv2/kubectl_provider_options.rb', line 16 def initialize(kubectl_layer:, awscli_layer: nil, environment: nil, memory: nil, private_subnets: nil, removal_policy: nil, role: nil, security_group: nil, security_groups: nil) @kubectl_layer = kubectl_layer Jsii::Type.check_type(@kubectl_layer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklMYXllclZlcnNpb24ifQ==")), "kubectlLayer") @awscli_layer = awscli_layer Jsii::Type.check_type(@awscli_layer, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklMYXllclZlcnNpb24ifQ==")), "awscliLayer") unless @awscli_layer.nil? @environment = environment Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil? @memory = memory Jsii::Type.check_type(@memory, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memory") unless @memory.nil? @private_subnets = private_subnets Jsii::Type.check_type(@private_subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVN1Ym5ldCJ9LCJraW5kIjoiYXJyYXkifX0=")), "privateSubnets") unless @private_subnets.nil? @removal_policy = removal_policy Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @security_group = security_group Jsii::Type.check_type(@security_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklTZWN1cml0eUdyb3VwIn0=")), "securityGroup") unless @security_group.nil? @security_groups = security_groups Jsii::Type.check_type(@security_groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVNlY3VyaXR5R3JvdXAifSwia2luZCI6ImFycmF5In19")), "securityGroups") unless @security_groups.nil? end |
Instance Attribute Details
#awscli_layer ⇒ AWSCDK::Lambda::ILayerVersion? (readonly)
Default: - If not defined, a default layer will be used containing the AWS CLI 2.x.
An AWS Lambda layer that contains the aws CLI.
45 46 47 |
# File 'ek_sv2/kubectl_provider_options.rb', line 45 def awscli_layer @awscli_layer end |
#environment ⇒ Hash{String => String}? (readonly)
Default: - No custom environment variables
Custom environment variables when running kubectl against this cluster.
50 51 52 |
# File 'ek_sv2/kubectl_provider_options.rb', line 50 def environment @environment end |
#kubectl_layer ⇒ AWSCDK::Lambda::ILayerVersion (readonly)
An AWS Lambda layer that includes kubectl and helm.
40 41 42 |
# File 'ek_sv2/kubectl_provider_options.rb', line 40 def kubectl_layer @kubectl_layer end |
#memory ⇒ AWSCDK::Size? (readonly)
Default: - 1024
The amount of memory allocated to the kubectl provider's lambda function.
55 56 57 |
# File 'ek_sv2/kubectl_provider_options.rb', line 55 def memory @memory end |
#private_subnets ⇒ Array<AWSCDK::EC2::ISubnet>? (readonly)
Default: - the k8s is accessible publicly
Subnets to host the kubectl compute resources.
If not specified, the k8s endpoint is expected to be accessible publicly.
63 64 65 |
# File 'ek_sv2/kubectl_provider_options.rb', line 63 def private_subnets @private_subnets end |
#removal_policy ⇒ AWSCDK::RemovalPolicy? (readonly)
Default: RemovalPolicy.DESTROY
The removal policy applied to the custom resource that provides kubectl.
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
75 76 77 |
# File 'ek_sv2/kubectl_provider_options.rb', line 75 def removal_policy @removal_policy end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - if not specified, the default role created by a lambda function will be used.
An IAM role that can perform kubectl operations against this cluster.
The role should be mapped to the system:masters Kubernetes RBAC role.
This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.
84 85 86 |
# File 'ek_sv2/kubectl_provider_options.rb', line 84 def role @role end |
#security_group ⇒ AWSCDK::EC2::ISecurityGroup? (readonly)
Use securityGroups instead.
Default: - If not specified, the k8s endpoint is expected to be accessible publicly.
A security group to use for kubectl execution.
90 91 92 |
# File 'ek_sv2/kubectl_provider_options.rb', line 90 def security_group @security_group end |
#security_groups ⇒ Array<AWSCDK::EC2::ISecurityGroup>? (readonly)
Default: - If not specified, the k8s endpoint is expected to be accessible publicly.
Security groups to use for kubectl execution.
95 96 97 |
# File 'ek_sv2/kubectl_provider_options.rb', line 95 def security_groups @security_groups end |
Class Method Details
.jsii_properties ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'ek_sv2/kubectl_provider_options.rb', line 97 def self.jsii_properties { :kubectl_layer => "kubectlLayer", :awscli_layer => "awscliLayer", :environment => "environment", :memory => "memory", :private_subnets => "privateSubnets", :removal_policy => "removalPolicy", :role => "role", :security_group => "securityGroup", :security_groups => "securityGroups", } end |
Instance Method Details
#to_jsii ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'ek_sv2/kubectl_provider_options.rb', line 111 def to_jsii result = {} result.merge!({ "kubectlLayer" => @kubectl_layer, "awscliLayer" => @awscli_layer, "environment" => @environment, "memory" => @memory, "privateSubnets" => @private_subnets, "removalPolicy" => @removal_policy, "role" => @role, "securityGroup" => @security_group, "securityGroups" => @security_groups, }) result.compact end |