Class: AWSCDK::EKSv2::ALBControllerProps

Inherits:
ALBControllerOptions
  • Object
show all
Defined in:
ek_sv2/alb_controller_props.rb

Overview

Properties for AlbController.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version:, additional_helm_chart_values: nil, overwrite_service_account: nil, policy: nil, removal_policy: nil, repository: nil, cluster:) ⇒ ALBControllerProps

Returns a new instance of ALBControllerProps.

Parameters:

  • version (AWSCDK::EKSv2::ALBControllerVersion)

    Version of the controller.

  • additional_helm_chart_values (Hash{String => Object}, nil) (defaults to: nil)

    Additional helm chart values for ALB controller.

  • overwrite_service_account (Boolean, nil) (defaults to: nil)

    Overwrite any existing ALB controller service account.

  • policy (Object, nil) (defaults to: nil)

    The IAM policy to apply to the service account.

  • removal_policy (AWSCDK::RemovalPolicy, nil) (defaults to: nil)

    The removal policy applied to the ALB controller resources.

  • repository (String, nil) (defaults to: nil)

    The repository to pull the controller image from.

  • cluster (AWSCDK::EKSv2::Cluster)

    [disable-awslint:ref-via-interface] Cluster to install the controller onto.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'ek_sv2/alb_controller_props.rb', line 14

def initialize(version:, additional_helm_chart_values: nil, overwrite_service_account: nil, policy: nil, removal_policy: nil, repository: nil, cluster:)
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkFsYkNvbnRyb2xsZXJWZXJzaW9uIn0=")), "version")
  @additional_helm_chart_values = additional_helm_chart_values
  Jsii::Type.check_type(@additional_helm_chart_values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "additionalHelmChartValues") unless @additional_helm_chart_values.nil?
  @overwrite_service_account = 
  Jsii::Type.check_type(@overwrite_service_account, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "overwriteServiceAccount") unless @overwrite_service_account.nil?
  @policy = policy
  Jsii::Type.check_type(@policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "policy") unless @policy.nil?
  @removal_policy = removal_policy
  Jsii::Type.check_type(@removal_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "removalPolicy") unless @removal_policy.nil?
  @repository = repository
  Jsii::Type.check_type(@repository, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "repository") unless @repository.nil?
  @cluster = cluster
  Jsii::Type.check_type(@cluster, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzX3YyLkNsdXN0ZXIifQ==")), "cluster")
end

Instance Attribute Details

#additional_helm_chart_valuesHash{String => Object}? (readonly)

Note:

Default: - no additional helm chart values

Additional helm chart values for ALB controller.

For available options, see: https://github.com/kubernetes-sigs/aws-load-balancer-controller/blob/main/helm/aws-load-balancer-controller/values.yaml

Returns:

  • (Hash{String => Object}, nil)


42
43
44
# File 'ek_sv2/alb_controller_props.rb', line 42

def additional_helm_chart_values
  @additional_helm_chart_values
end

#clusterAWSCDK::EKSv2::Cluster (readonly)

[disable-awslint:ref-via-interface] Cluster to install the controller onto.



86
87
88
# File 'ek_sv2/alb_controller_props.rb', line 86

def cluster
  @cluster
end

#overwrite_service_accountBoolean? (readonly)

Note:

Default: false

Overwrite any existing ALB controller service account.

If this is set, we will use kubectl apply instead of kubectl create when the ALB controller service account is created. Otherwise, if there is already a service account named 'aws-load-balancer-controller' in the kube-system namespace, the operation will fail.

Returns:

  • (Boolean, nil)


51
52
53
# File 'ek_sv2/alb_controller_props.rb', line 51

def 
  @overwrite_service_account
end

#policyObject? (readonly)

Note:

Default: - Corresponds to the predefined version.

The IAM policy to apply to the service account.

If you're using one of the built-in versions, this is not required since CDK ships with the appropriate policies for those versions.

However, if you are using a custom version, this is required (and validated).

Returns:

  • (Object, nil)


61
62
63
# File 'ek_sv2/alb_controller_props.rb', line 61

def policy
  @policy
end

#removal_policyAWSCDK::RemovalPolicy? (readonly)

Note:

Default: RemovalPolicy.DESTROY

The removal policy applied to the ALB controller 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

Returns:



73
74
75
# File 'ek_sv2/alb_controller_props.rb', line 73

def removal_policy
  @removal_policy
end

#repositoryString? (readonly)

Note:

Default: '602401143452.dkr.ecr.us-west-2.amazonaws.com/amazon/aws-load-balancer-controller'

The repository to pull the controller image from.

Note that the default repository works for most regions, but not all. If the repository is not applicable to your region, use a custom repository according to the information here: https://github.com/kubernetes-sigs/aws-load-balancer-controller/releases.

Returns:

  • (String, nil)


82
83
84
# File 'ek_sv2/alb_controller_props.rb', line 82

def repository
  @repository
end

#versionAWSCDK::EKSv2::ALBControllerVersion (readonly)

Version of the controller.



34
35
36
# File 'ek_sv2/alb_controller_props.rb', line 34

def version
  @version
end

Class Method Details

.jsii_propertiesObject



88
89
90
91
92
93
94
95
96
97
98
# File 'ek_sv2/alb_controller_props.rb', line 88

def self.jsii_properties
  {
    :version => "version",
    :additional_helm_chart_values => "additionalHelmChartValues",
    :overwrite_service_account => "overwriteServiceAccount",
    :policy => "policy",
    :removal_policy => "removalPolicy",
    :repository => "repository",
    :cluster => "cluster",
  }
end

Instance Method Details

#to_jsiiObject



100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'ek_sv2/alb_controller_props.rb', line 100

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "version" => @version,
    "additionalHelmChartValues" => @additional_helm_chart_values,
    "overwriteServiceAccount" => @overwrite_service_account,
    "policy" => @policy,
    "removalPolicy" => @removal_policy,
    "repository" => @repository,
    "cluster" => @cluster,
  })
  result.compact
end