Class: AWSCDK::EKS::FargateCluster

Inherits:
Cluster
  • Object
show all
Defined in:
eks/fargate_cluster.rb

Overview

Defines an EKS cluster that runs entirely on AWS Fargate.

The cluster is created with a default Fargate Profile that matches the "default" and "kube-system" namespaces. You can add additional profiles using add_fargate_profile.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props) ⇒ FargateCluster

Returns a new instance of FargateCluster.

Parameters:



15
16
17
18
19
20
21
# File 'eks/fargate_cluster.rb', line 15

def initialize(scope, id, props)
  props = props.is_a?(Hash) ? ::AWSCDK::EKS::FargateClusterProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkZhcmdhdGVDbHVzdGVyUHJvcHMifQ==")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props)
end

Class Method Details

.jsii_overridable_methodsObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'eks/fargate_cluster.rb', line 23

def self.jsii_overridable_methods
  {
    :node => { kind: :property, name: "node", is_optional: false },
    :env => { kind: :property, name: "env", is_optional: false },
    :physical_name => { kind: :property, name: "physicalName", is_optional: false },
    :stack => { kind: :property, name: "stack", is_optional: false },
    :admin_role => { kind: :property, name: "adminRole", is_optional: false },
    :aws_auth => { kind: :property, name: "awsAuth", is_optional: false },
    :cluster_arn => { kind: :property, name: "clusterArn", is_optional: false },
    :cluster_certificate_authority_data => { kind: :property, name: "clusterCertificateAuthorityData", is_optional: false },
    :cluster_encryption_config_key_arn => { kind: :property, name: "clusterEncryptionConfigKeyArn", is_optional: false },
    :cluster_endpoint => { kind: :property, name: "clusterEndpoint", is_optional: false },
    :cluster_name => { kind: :property, name: "clusterName", is_optional: false },
    :cluster_open_id_connect_issuer => { kind: :property, name: "clusterOpenIdConnectIssuer", is_optional: false },
    :cluster_open_id_connect_issuer_url => { kind: :property, name: "clusterOpenIdConnectIssuerUrl", is_optional: false },
    :cluster_ref => { kind: :property, name: "clusterRef", is_optional: false },
    :cluster_security_group => { kind: :property, name: "clusterSecurityGroup", is_optional: false },
    :cluster_security_group_id => { kind: :property, name: "clusterSecurityGroupId", is_optional: false },
    :connections => { kind: :property, name: "connections", is_optional: false },
    :open_id_connect_provider => { kind: :property, name: "openIdConnectProvider", is_optional: false },
    :prune => { kind: :property, name: "prune", is_optional: false },
    :role => { kind: :property, name: "role", is_optional: false },
    :vpc => { kind: :property, name: "vpc", is_optional: false },
    :alb_controller => { kind: :property, name: "albController", is_optional: true },
    :authentication_mode => { kind: :property, name: "authenticationMode", is_optional: true },
    :awscli_layer => { kind: :property, name: "awscliLayer", is_optional: true },
    :cluster_handler_security_group => { kind: :property, name: "clusterHandlerSecurityGroup", is_optional: true },
    :default_capacity => { kind: :property, name: "defaultCapacity", is_optional: true },
    :default_nodegroup => { kind: :property, name: "defaultNodegroup", is_optional: true },
    :eks_pod_identity_agent => { kind: :property, name: "eksPodIdentityAgent", is_optional: true },
    :ip_family => { kind: :property, name: "ipFamily", is_optional: true },
    :kubectl_environment => { kind: :property, name: "kubectlEnvironment", is_optional: true },
    :kubectl_lambda_role => { kind: :property, name: "kubectlLambdaRole", is_optional: true },
    :kubectl_layer => { kind: :property, name: "kubectlLayer", is_optional: true },
    :kubectl_memory => { kind: :property, name: "kubectlMemory", is_optional: true },
    :kubectl_private_subnets => { kind: :property, name: "kubectlPrivateSubnets", is_optional: true },
    :kubectl_role => { kind: :property, name: "kubectlRole", is_optional: true },
    :kubectl_security_group => { kind: :property, name: "kubectlSecurityGroup", is_optional: true },
    :on_event_layer => { kind: :property, name: "onEventLayer", is_optional: true },
    :default_profile => { kind: :property, name: "defaultProfile", is_optional: false },
    :to_string => { kind: :method, name: "toString", is_optional: false },
    :with => { kind: :method, name: "with", is_optional: false },
    :apply_cross_stack_reference_strength => { kind: :method, name: "applyCrossStackReferenceStrength", is_optional: false },
    :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false },
    :generate_physical_name => { kind: :method, name: "generatePhysicalName", is_optional: false },
    :get_resource_arn_attribute => { kind: :method, name: "getResourceArnAttribute", is_optional: false },
    :get_resource_name_attribute => { kind: :method, name: "getResourceNameAttribute", is_optional: false },
    :add_auto_scaling_group_capacity => { kind: :method, name: "addAutoScalingGroupCapacity", is_optional: false },
    :add_cdk8s_chart => { kind: :method, name: "addCdk8sChart", is_optional: false },
    :add_fargate_profile => { kind: :method, name: "addFargateProfile", is_optional: false },
    :add_helm_chart => { kind: :method, name: "addHelmChart", is_optional: false },
    :add_manifest => { kind: :method, name: "addManifest", is_optional: false },
    :add_nodegroup_capacity => { kind: :method, name: "addNodegroupCapacity", is_optional: false },
    :add_service_account => { kind: :method, name: "addServiceAccount", is_optional: false },
    :connect_auto_scaling_group_capacity => { kind: :method, name: "connectAutoScalingGroupCapacity", is_optional: false },
    :get_ingress_load_balancer_address => { kind: :method, name: "getIngressLoadBalancerAddress", is_optional: false },
    :get_service_load_balancer_address => { kind: :method, name: "getServiceLoadBalancerAddress", is_optional: false },
    :grant_access => { kind: :method, name: "grantAccess", is_optional: false },
  }
end

.PROPERTY_INJECTION_IDString

Uniquely identifies this class.

Returns:

  • (String)


130
131
132
# File 'eks/fargate_cluster.rb', line 130

def self.PROPERTY_INJECTION_ID()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_eks.FargateCluster", "PROPERTY_INJECTION_ID")
end

Instance Method Details

#add_auto_scaling_group_capacity(id, options) ⇒ AWSCDK::Autoscaling::AutoScalingGroup

Add nodes to this EKS cluster.

The nodes will automatically be configured with the right VPC and AMI for the instance type and Kubernetes version.

Note that if you specify updateType: RollingUpdate or updateType: ReplacingUpdate, your nodes might be replaced at deploy time without notice in case the recommended AMI for your machine image type has been updated by AWS. The default behavior for update_type is None, which means only new instances will be launched using the new AMI.

Spot instances will be labeled lifecycle=Ec2Spot and tainted with PreferNoSchedule. In addition, the spot interrupt handler daemon will be installed on all spot instances to handle EC2 Spot Instance Termination Notices.



532
533
534
535
536
537
# File 'eks/fargate_cluster.rb', line 532

def add_auto_scaling_group_capacity(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::AutoScalingGroupCapacityOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkF1dG9TY2FsaW5nR3JvdXBDYXBhY2l0eU9wdGlvbnMifQ==")), "options")
  jsii_call_method("addAutoScalingGroupCapacity", [id, options])
end

#add_cdk8s_chart(id, chart, options = nil) ⇒ AWSCDK::EKS::KubernetesManifest

Defines a CDK8s chart in this cluster.

Parameters:

Returns:



545
546
547
548
549
550
551
# File 'eks/fargate_cluster.rb', line 545

def add_cdk8s_chart(id, chart, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(chart, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "chart")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::KubernetesManifestOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkt1YmVybmV0ZXNNYW5pZmVzdE9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addCdk8sChart", [id, chart, options])
end

#add_fargate_profile(id, options) ⇒ AWSCDK::EKS::FargateProfile

Adds a Fargate profile to this cluster.

Parameters:

Returns:

See Also:



559
560
561
562
563
564
# File 'eks/fargate_cluster.rb', line 559

def add_fargate_profile(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::FargateProfileOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkZhcmdhdGVQcm9maWxlT3B0aW9ucyJ9")), "options")
  jsii_call_method("addFargateProfile", [id, options])
end

#add_helm_chart(id, options) ⇒ AWSCDK::EKS::HelmChart

Defines a Helm chart in this cluster.

Parameters:

Returns:



571
572
573
574
575
576
# File 'eks/fargate_cluster.rb', line 571

def add_helm_chart(id, options)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::HelmChartOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkhlbG1DaGFydE9wdGlvbnMifQ==")), "options")
  jsii_call_method("addHelmChart", [id, options])
end

#add_manifest(id, *manifest) ⇒ AWSCDK::EKS::KubernetesManifest

Defines a Kubernetes resource in this cluster.

The manifest will be applied/deleted using kubectl as needed.

Parameters:

  • id (String)

    logical id of this manifest.

  • manifest (Array<Hash{String => Object}>)

    a list of Kubernetes resource specifications.

Returns:



585
586
587
588
589
590
591
# File 'eks/fargate_cluster.rb', line 585

def add_manifest(id, *manifest)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  manifest.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "manifest[#{index}]")
  end
  jsii_call_method("addManifest", [id, *manifest])
end

#add_nodegroup_capacity(id, options = nil) ⇒ AWSCDK::EKS::Nodegroup

Add managed nodegroup to this Amazon EKS cluster.

This method will create a new managed nodegroup and add into the capacity.

Parameters:

  • id (String)

    The ID of the nodegroup.

  • options (AWSCDK::EKS::NodegroupOptions, nil) (defaults to: nil)

    options for creating a new nodegroup.

Returns:

See Also:



601
602
603
604
605
606
# File 'eks/fargate_cluster.rb', line 601

def add_nodegroup_capacity(id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::NodegroupOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLk5vZGVncm91cE9wdGlvbnMifQ==")), "options") unless options.nil?
  jsii_call_method("addNodegroupCapacity", [id, options])
end

#add_service_account(id, options = nil) ⇒ AWSCDK::EKS::ServiceAccount

Creates a new service account with corresponding IAM Role (IRSA).

Parameters:

Returns:



613
614
615
616
617
618
# File 'eks/fargate_cluster.rb', line 613

def (id, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::ServiceAccountOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLlNlcnZpY2VBY2NvdW50T3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("addServiceAccount", [id, options])
end

#admin_roleAWSCDK::IAM::Role

An IAM role with administrative permissions to create or update the cluster.

This role also has systems:master permissions.

Returns:



139
140
141
# File 'eks/fargate_cluster.rb', line 139

def admin_role()
  jsii_get_property("adminRole")
end

#alb_controllerAWSCDK::EKS::ALBController?

The ALB Controller construct defined for this cluster.

Will be undefined if alb_controller wasn't configured.

Returns:



274
275
276
# File 'eks/fargate_cluster.rb', line 274

def alb_controller()
  jsii_get_property("albController")
end

#apply_cross_stack_reference_strength(strength) ⇒ void

This method returns an undefined value.

Override the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified mechanism instead of the global default determined by the @aws-cdk/core:defaultCrossStackReferences context key. This is useful for selectively weakening specific references to avoid the "deadly embrace" problem without changing the app-wide default.

Parameters:



458
459
460
461
# File 'eks/fargate_cluster.rb', line 458

def apply_cross_stack_reference_strength(strength)
  Jsii::Type.check_type(strength, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZWZlcmVuY2VTdHJlbmd0aCJ9")), "strength")
  jsii_call_method("applyCrossStackReferenceStrength", [strength])
end

#apply_removal_policy(policy) ⇒ void

This method returns an undefined value.

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:



475
476
477
478
# File 'eks/fargate_cluster.rb', line 475

def apply_removal_policy(policy)
  Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy")
  jsii_call_method("applyRemovalPolicy", [policy])
end

#authentication_modeAWSCDK::EKS::AuthenticationMode?

Note:

Default: CONFIG_MAP.

The authentication mode for the Amazon EKS cluster.

The authentication mode determines how users and applications authenticate to the Kubernetes API server.



284
285
286
# File 'eks/fargate_cluster.rb', line 284

def authentication_mode()
  jsii_get_property("authenticationMode")
end

#aws_authAWSCDK::EKS::AWSAuth

Lazily creates the AwsAuth resource, which manages AWS authentication mapping.



146
147
148
# File 'eks/fargate_cluster.rb', line 146

def aws_auth()
  jsii_get_property("awsAuth")
end

#awscli_layerAWSCDK::Lambda::ILayerVersion?

An AWS Lambda layer that contains the aws CLI.

If not defined, a default layer will be used containing the AWS CLI 1.x.



293
294
295
# File 'eks/fargate_cluster.rb', line 293

def awscli_layer()
  jsii_get_property("awscliLayer")
end

#cluster_arnString

The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.

Returns:

  • (String)


153
154
155
# File 'eks/fargate_cluster.rb', line 153

def cluster_arn()
  jsii_get_property("clusterArn")
end

#cluster_certificate_authority_dataString

The certificate-authority-data for your cluster.

Returns:

  • (String)


160
161
162
# File 'eks/fargate_cluster.rb', line 160

def cluster_certificate_authority_data()
  jsii_get_property("clusterCertificateAuthorityData")
end

#cluster_encryption_config_key_arnString

Amazon Resource Name (ARN) or alias of the customer master key (CMK).

Returns:

  • (String)


167
168
169
# File 'eks/fargate_cluster.rb', line 167

def cluster_encryption_config_key_arn()
  jsii_get_property("clusterEncryptionConfigKeyArn")
end

#cluster_endpointString

The endpoint URL for the Cluster.

This is the URL inside the kubeconfig file to use with kubectl

For example, https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com

Returns:

  • (String)


178
179
180
# File 'eks/fargate_cluster.rb', line 178

def cluster_endpoint()
  jsii_get_property("clusterEndpoint")
end

#cluster_handler_security_groupAWSCDK::EC2::ISecurityGroup?

Note:

Default: - No security group.

A security group to associate with the Cluster Handler's Lambdas.

The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.

Requires place_cluster_handler_in_vpc to be set to true.

Returns:



305
306
307
# File 'eks/fargate_cluster.rb', line 305

def cluster_handler_security_group()
  jsii_get_property("clusterHandlerSecurityGroup")
end

#cluster_nameString

The physical name of the Cluster.

Returns:

  • (String)


185
186
187
# File 'eks/fargate_cluster.rb', line 185

def cluster_name()
  jsii_get_property("clusterName")
end

#cluster_open_id_connect_issuerString

If this cluster is kubectl-enabled, returns the OpenID Connect issuer.

This is because the values is only be retrieved by the API and not exposed by CloudFormation. If this cluster is not kubectl-enabled (i.e. uses the stock CfnCluster), this is undefined.

Returns:

  • (String)


196
197
198
# File 'eks/fargate_cluster.rb', line 196

def cluster_open_id_connect_issuer()
  jsii_get_property("clusterOpenIdConnectIssuer")
end

#cluster_open_id_connect_issuer_urlString

If this cluster is kubectl-enabled, returns the OpenID Connect issuer url.

This is because the values is only be retrieved by the API and not exposed by CloudFormation. If this cluster is not kubectl-enabled (i.e. uses the stock CfnCluster), this is undefined.

Returns:

  • (String)


207
208
209
# File 'eks/fargate_cluster.rb', line 207

def cluster_open_id_connect_issuer_url()
  jsii_get_property("clusterOpenIdConnectIssuerUrl")
end

#cluster_refAWSCDK::Interfaces::AWSEKS::ClusterReference

A reference to a Cluster resource.



214
215
216
# File 'eks/fargate_cluster.rb', line 214

def cluster_ref()
  jsii_get_property("clusterRef")
end

#cluster_security_groupAWSCDK::EC2::ISecurityGroup

The cluster security group that was created by Amazon EKS for the cluster.



221
222
223
# File 'eks/fargate_cluster.rb', line 221

def cluster_security_group()
  jsii_get_property("clusterSecurityGroup")
end

#cluster_security_group_idString

The id of the cluster security group that was created by Amazon EKS for the cluster.

Returns:

  • (String)


228
229
230
# File 'eks/fargate_cluster.rb', line 228

def cluster_security_group_id()
  jsii_get_property("clusterSecurityGroupId")
end

#connect_auto_scaling_group_capacity(auto_scaling_group, options) ⇒ void

This method returns an undefined value.

Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster.

The AutoScalingGroup must be running an EKS-optimized AMI containing the /etc/eks/bootstrap.sh script. This method will configure Security Groups, add the right policies to the instance role, apply the right tags, and add the required user data to the instance's launch configuration.

Spot instances will be labeled lifecycle=Ec2Spot and tainted with PreferNoSchedule. If kubectl is enabled, the spot interrupt handler daemon will be installed on all spot instances to handle EC2 Spot Instance Termination Notices.

Prefer to use add_auto_scaling_group_capacity if possible.

Parameters:

See Also:



639
640
641
642
643
644
# File 'eks/fargate_cluster.rb', line 639

def connect_auto_scaling_group_capacity(auto_scaling_group, options)
  Jsii::Type.check_type(auto_scaling_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQXV0b1NjYWxpbmdHcm91cCJ9")), "autoScalingGroup")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::AutoScalingGroupOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkF1dG9TY2FsaW5nR3JvdXBPcHRpb25zIn0=")), "options")
  jsii_call_method("connectAutoScalingGroupCapacity", [auto_scaling_group, options])
end

#connectionsAWSCDK::EC2::Connections

Manages connection rules (Security Group Rules) for the cluster.



235
236
237
# File 'eks/fargate_cluster.rb', line 235

def connections()
  jsii_get_property("connections")
end

#default_capacityAWSCDK::Autoscaling::AutoScalingGroup?

The auto scaling group that hosts the default capacity for this cluster.

This will be undefined if the default_capacity_type is not EC2 or default_capacity_type is EC2 but default capacity is set to 0.



315
316
317
# File 'eks/fargate_cluster.rb', line 315

def default_capacity()
  jsii_get_property("defaultCapacity")
end

#default_nodegroupAWSCDK::EKS::Nodegroup?

The node group that hosts the default capacity for this cluster.

This will be undefined if the default_capacity_type is EC2 or default_capacity_type is NODEGROUP but default capacity is set to 0.

Returns:



325
326
327
# File 'eks/fargate_cluster.rb', line 325

def default_nodegroup()
  jsii_get_property("defaultNodegroup")
end

#default_profileAWSCDK::EKS::FargateProfile

Fargate Profile that was created with the cluster.



421
422
423
# File 'eks/fargate_cluster.rb', line 421

def default_profile()
  jsii_get_property("defaultProfile")
end

#eks_pod_identity_agentAWSCDK::EKS::IAddon?

Retrieves the EKS Pod Identity Agent addon for the EKS cluster.

The EKS Pod Identity Agent is responsible for managing the temporary credentials used by pods in the cluster to access AWS resources. It runs as a DaemonSet on each node and provides the necessary credentials to the pods based on their associated service account.

Returns:



337
338
339
# File 'eks/fargate_cluster.rb', line 337

def eks_pod_identity_agent()
  jsii_get_property("eksPodIdentityAgent")
end

#envAWSCDK::Interfaces::ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.



102
103
104
# File 'eks/fargate_cluster.rb', line 102

def env()
  jsii_get_property("env")
end

#generate_physical_nameString

Returns:

  • (String)


481
482
483
# File 'eks/fargate_cluster.rb', line 481

def generate_physical_name()
  jsii_call_method("generatePhysicalName", [])
end

#get_ingress_load_balancer_address(ingress_name, options = nil) ⇒ String

Fetch the load balancer address of an ingress backed by a load balancer.

Parameters:

Returns:

  • (String)


651
652
653
654
655
656
# File 'eks/fargate_cluster.rb', line 651

def get_ingress_load_balancer_address(ingress_name, options = nil)
  Jsii::Type.check_type(ingress_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ingressName")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::IngressLoadBalancerAddressOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkluZ3Jlc3NMb2FkQmFsYW5jZXJBZGRyZXNzT3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("getIngressLoadBalancerAddress", [ingress_name, options])
end

#get_resource_arn_attribute(arn_attr, arn_components) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. bucket.bucketArn).

Normally, this token will resolve to arn_attr, but if the resource is referenced across environments, arn_components will be used to synthesize a concrete ARN with the resource's physical name. Make sure to reference this.physicalName in arn_components.

Parameters:

  • arn_attr (String)

    The CFN attribute which resolves to the ARN of the resource.

  • arn_components (AWSCDK::ARNComponents)

    The format of the ARN of this resource.

Returns:

  • (String)


495
496
497
498
499
500
# File 'eks/fargate_cluster.rb', line 495

def get_resource_arn_attribute(arn_attr, arn_components)
  Jsii::Type.check_type(arn_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arnAttr")
  arn_components = arn_components.is_a?(Hash) ? ::AWSCDK::ARNComponents.new(**arn_components.transform_keys(&:to_sym)) : arn_components
  Jsii::Type.check_type(arn_components, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5Bcm5Db21wb25lbnRzIn0=")), "arnComponents")
  jsii_call_method("getResourceArnAttribute", [arn_attr, arn_components])
end

#get_resource_name_attribute(name_attr) ⇒ String

Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. bucket.bucketName).

Normally, this token will resolve to name_attr, but if the resource is referenced across environments, it will be resolved to this.physicalName, which will be a concrete name.

Parameters:

  • name_attr (String)

    The CFN attribute which resolves to the resource's name.

Returns:

  • (String)


510
511
512
513
# File 'eks/fargate_cluster.rb', line 510

def get_resource_name_attribute(name_attr)
  Jsii::Type.check_type(name_attr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nameAttr")
  jsii_call_method("getResourceNameAttribute", [name_attr])
end

#get_service_load_balancer_address(service_name, options = nil) ⇒ String

Fetch the load balancer address of a service of type 'LoadBalancer'.

Parameters:

Returns:

  • (String)


663
664
665
666
667
668
# File 'eks/fargate_cluster.rb', line 663

def get_service_load_balancer_address(service_name, options = nil)
  Jsii::Type.check_type(service_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "serviceName")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::ServiceLoadBalancerAddressOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLlNlcnZpY2VMb2FkQmFsYW5jZXJBZGRyZXNzT3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("getServiceLoadBalancerAddress", [service_name, options])
end

#grant_access(id, principal, access_policies, options = nil) ⇒ void

This method returns an undefined value.

Grants the specified IAM principal access to the EKS cluster based on the provided access policies.

This method creates an AccessEntry construct that grants the specified IAM principal the access permissions defined by the provided IAccessPolicy array. This allows the IAM principal to perform the actions permitted by the access policies within the EKS cluster.

Parameters:

  • id (String)
    • The ID of the AccessEntry construct to be created.
  • principal (String)
    • The IAM principal (role or user) to be granted access to the EKS cluster.
  • access_policies (Array<AWSCDK::EKS::IAccessPolicy>)
    • An array of IAccessPolicy objects that define the access permissions to be granted to the IAM principal.
  • options (AWSCDK::EKS::GrantAccessOptions, nil) (defaults to: nil)
    • Additional options for granting access.


681
682
683
684
685
686
687
688
# File 'eks/fargate_cluster.rb', line 681

def grant_access(id, principal, access_policies, options = nil)
  Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id")
  Jsii::Type.check_type(principal, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "principal")
  Jsii::Type.check_type(access_policies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19la3MuSUFjY2Vzc1BvbGljeSJ9LCJraW5kIjoiYXJyYXkifX0=")), "accessPolicies")
  options = options.is_a?(Hash) ? ::AWSCDK::EKS::GrantAccessOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWtzLkdyYW50QWNjZXNzT3B0aW9ucyJ9")), "options") unless options.nil?
  jsii_call_method("grantAccess", [id, principal, access_policies, options])
end

#ip_familyAWSCDK::EKS::IPFamily?

Note:

Default: - IpFamily.IP_V4

Specify which IP family is used to assign Kubernetes pod and service IP addresses.



346
347
348
# File 'eks/fargate_cluster.rb', line 346

def ip_family()
  jsii_get_property("ipFamily")
end

#kubectl_environmentHash{String => String}?

Custom environment variables when running kubectl against this cluster.

Returns:

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


353
354
355
# File 'eks/fargate_cluster.rb', line 353

def kubectl_environment()
  jsii_get_property("kubectlEnvironment")
end

#kubectl_lambda_roleAWSCDK::IAM::IRole?

Note:

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.

Returns:



365
366
367
# File 'eks/fargate_cluster.rb', line 365

def kubectl_lambda_role()
  jsii_get_property("kubectlLambdaRole")
end

#kubectl_layerAWSCDK::Lambda::ILayerVersion?

An AWS Lambda layer that includes kubectl and helm.



372
373
374
# File 'eks/fargate_cluster.rb', line 372

def kubectl_layer()
  jsii_get_property("kubectlLayer")
end

#kubectl_memoryAWSCDK::Size?

The amount of memory allocated to the kubectl provider's lambda function.

Returns:



379
380
381
# File 'eks/fargate_cluster.rb', line 379

def kubectl_memory()
  jsii_get_property("kubectlMemory")
end

#kubectl_private_subnetsArray<AWSCDK::EC2::ISubnet>?

Note:

Default: - If not specified, the k8s endpoint is expected to be accessible publicly.

Subnets to host the kubectl compute resources.

Returns:



387
388
389
# File 'eks/fargate_cluster.rb', line 387

def kubectl_private_subnets()
  jsii_get_property("kubectlPrivateSubnets")
end

#kubectl_roleAWSCDK::IAM::IRole?

An IAM role that can perform kubectl operations against this cluster.

The role should be mapped to the system:masters Kubernetes RBAC role.

Returns:



396
397
398
# File 'eks/fargate_cluster.rb', line 396

def kubectl_role()
  jsii_get_property("kubectlRole")
end

#kubectl_security_groupAWSCDK::EC2::ISecurityGroup?

Note:

Default: - If not specified, the k8s endpoint is expected to be accessible publicly.

A security group to use for kubectl execution.

Returns:



404
405
406
# File 'eks/fargate_cluster.rb', line 404

def kubectl_security_group()
  jsii_get_property("kubectlSecurityGroup")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


87
88
89
# File 'eks/fargate_cluster.rb', line 87

def node()
  jsii_get_property("node")
end

#on_event_layerAWSCDK::Lambda::ILayerVersion?

The AWS Lambda layer that contains the NPM dependency proxy-agent.

If undefined, a SAR app that contains this layer will be used.



414
415
416
# File 'eks/fargate_cluster.rb', line 414

def on_event_layer()
  jsii_get_property("onEventLayer")
end

#open_id_connect_providerAWSCDK::IAM::IOpenIdConnectProvider

An OpenIdConnectProvider resource associated with this cluster, and which can be used to link this cluster to AWS IAM.

A provider will only be defined if this property is accessed (lazy initialization).



244
245
246
# File 'eks/fargate_cluster.rb', line 244

def open_id_connect_provider()
  jsii_get_property("openIdConnectProvider")
end

#physical_nameString

Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.

This value will resolve to one of the following:

  • a concrete value (e.g. "my-awesome-bucket")
  • undefined, when a name should be generated by CloudFormation
  • a concrete name generated automatically during synthesis, in cross-environment scenarios.

Returns:

  • (String)


116
117
118
# File 'eks/fargate_cluster.rb', line 116

def physical_name()
  jsii_get_property("physicalName")
end

#pruneBoolean

Determines if Kubernetes resources can be pruned automatically.

Returns:

  • (Boolean)


251
252
253
# File 'eks/fargate_cluster.rb', line 251

def prune()
  jsii_get_property("prune")
end

#roleAWSCDK::IAM::IRole

IAM role assumed by the EKS Control Plane.

Returns:



258
259
260
# File 'eks/fargate_cluster.rb', line 258

def role()
  jsii_get_property("role")
end

#stackAWSCDK::Stack

The stack in which this resource is defined.

Returns:



123
124
125
# File 'eks/fargate_cluster.rb', line 123

def stack()
  jsii_get_property("stack")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


428
429
430
# File 'eks/fargate_cluster.rb', line 428

def to_string()
  jsii_call_method("toString", [])
end

#vpcAWSCDK::EC2::IVPC

The VPC in which this Cluster was created.

Returns:



265
266
267
# File 'eks/fargate_cluster.rb', line 265

def vpc()
  jsii_get_property("vpc")
end

#with(*mixins) ⇒ Constructs::IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

Parameters:

  • mixins (Array<Constructs::IMixin>)

Returns:

  • (Constructs::IConstruct)


441
442
443
444
445
446
# File 'eks/fargate_cluster.rb', line 441

def with(*mixins)
  mixins.each_with_index do |item, index|
    Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]")
  end
  jsii_call_method("with", [*mixins])
end