Class: AWSCDK::EKSv2::ALBControllerOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ek_sv2/alb_controller_options.rb

Overview

Options for AlbController.

Direct Known Subclasses

ALBControllerProps

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) ⇒ ALBControllerOptions

Returns a new instance of ALBControllerOptions.

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.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ek_sv2/alb_controller_options.rb', line 13

def initialize(version:, additional_helm_chart_values: nil, overwrite_service_account: nil, policy: nil, removal_policy: nil, repository: nil)
  @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?
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)


39
40
41
# File 'ek_sv2/alb_controller_options.rb', line 39

def additional_helm_chart_values
  @additional_helm_chart_values
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)


48
49
50
# File 'ek_sv2/alb_controller_options.rb', line 48

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)


58
59
60
# File 'ek_sv2/alb_controller_options.rb', line 58

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:



70
71
72
# File 'ek_sv2/alb_controller_options.rb', line 70

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)


79
80
81
# File 'ek_sv2/alb_controller_options.rb', line 79

def repository
  @repository
end

#versionAWSCDK::EKSv2::ALBControllerVersion (readonly)

Version of the controller.



31
32
33
# File 'ek_sv2/alb_controller_options.rb', line 31

def version
  @version
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
# File 'ek_sv2/alb_controller_options.rb', line 81

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

Instance Method Details

#to_jsiiObject



92
93
94
95
96
97
98
99
100
101
102
103
# File 'ek_sv2/alb_controller_options.rb', line 92

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