ClusterAttributes Struct
Attributes for EKS clusters.
| Source | aws-eks-v2/lib/cluster.ts |
|---|---|
| Type last changed |
Example
const handlerRole = iam.Role.fromRoleArn(this, 'HandlerRole', 'arn:aws:iam::123456789012:role/lambda-role');
// get the serviceToken from the custom resource provider
const functionArn = lambda.Function.fromFunctionName(this, 'ProviderOnEventFunc', 'ProviderframeworkonEvent-XXX').functionArn;
const kubectlProvider = eks.KubectlProvider.fromKubectlProviderAttributes(this, 'KubectlProvider', {
serviceToken: functionArn,
role: handlerRole,
});
const cluster = eks.Cluster.fromClusterAttributes(this, 'Cluster', {
clusterName: 'cluster',
kubectlProvider,
});
handler_role = iam.Role.from_role_arn(self, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role")
# get the serviceToken from the custom resource provider
function_arn = lambda_.Function.from_function_name(self, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").function_arn
kubectl_provider = eks.KubectlProvider.from_kubectl_provider_attributes(self, "KubectlProvider",
service_token=function_arn,
role=handler_role
)
cluster = eks.Cluster.from_cluster_attributes(self, "Cluster",
cluster_name="cluster",
kubectl_provider=kubectl_provider
)
IRole handlerRole = Role.fromRoleArn(this, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role");
// get the serviceToken from the custom resource provider
String functionArn = Function.fromFunctionName(this, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").getFunctionArn();
IKubectlProvider kubectlProvider = KubectlProvider.fromKubectlProviderAttributes(this, "KubectlProvider", KubectlProviderAttributes.builder()
.serviceToken(functionArn)
.role(handlerRole)
.build());
ICluster cluster = Cluster.fromClusterAttributes(this, "Cluster", ClusterAttributes.builder()
.clusterName("cluster")
.kubectlProvider(kubectlProvider)
.build());
// Install: dotnet add package Amazon.CDK.Lib
var handlerRole = Role.FromRoleArn(this, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role");
// get the serviceToken from the custom resource provider
var functionArn = Function.FromFunctionName(this, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").FunctionArn;
var kubectlProvider = KubectlProvider.FromKubectlProviderAttributes(this, "KubectlProvider", new KubectlProviderAttributes {
ServiceToken = functionArn,
Role = handlerRole
});
var cluster = Cluster.FromClusterAttributes(this, "Cluster", new ClusterAttributes {
ClusterName = "cluster",
KubectlProvider = kubectlProvider
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
handlerRole := iam.Role_FromRoleArn(this, jsii.String("HandlerRole"), jsii.String("arn:aws:iam::123456789012:role/lambda-role"))
// get the serviceToken from the custom resource provider
functionArn := lambda.Function_FromFunctionName(this, jsii.String("ProviderOnEventFunc"), jsii.String("ProviderframeworkonEvent-XXX")).FunctionArn
kubectlProvider := eks.KubectlProvider_FromKubectlProviderAttributes(this, jsii.String("KubectlProvider"), &KubectlProviderAttributes{
ServiceToken: functionArn,
Role: handlerRole,
})
cluster := eks.Cluster_FromClusterAttributes(this, jsii.String("Cluster"), &ClusterAttributes{
ClusterName: jsii.String("cluster"),
KubectlProvider: KubectlProvider,
})
Properties
clusterCertificateAuthorityDataoptionalstringcluster_certificate_authority_dataoptionalstrclusterCertificateAuthorityDataoptionalStringClusterCertificateAuthorityDataoptionalstringClusterCertificateAuthorityDataoptional*string #Default: if not specified cluster.clusterCertificateAuthorityData will throw an error
clusterEncryptionConfigKeyArnoptionalstringcluster_encryption_config_key_arnoptionalstrclusterEncryptionConfigKeyArnoptionalStringClusterEncryptionConfigKeyArnoptionalstringClusterEncryptionConfigKeyArnoptional*string #Default: if not specified cluster.clusterEncryptionConfigKeyArn will throw an error
clusterEndpointoptionalstringcluster_endpointoptionalstrclusterEndpointoptionalStringClusterEndpointoptionalstringClusterEndpointoptional*string #Default: if not specified cluster.clusterEndpoint will throw an error.
clusterSecurityGroupIdoptionalstringcluster_security_group_idoptionalstrclusterSecurityGroupIdoptionalStringClusterSecurityGroupIdoptionalstringClusterSecurityGroupIdoptional*string #Default: if not specified cluster.clusterSecurityGroupId will throw an error
ipFamilyoptionalIpFamilyip_familyoptionalIpFamilyipFamilyoptionalIpFamilyIpFamilyoptionalIpFamilyIpFamilyoptionalIpFamily = IpFamily.IP_V4 #kubectlProvideroptionalIKubectlProviderkubectl_provideroptionalIKubectlProviderkubectlProvideroptionalIKubectlProviderKubectlProvideroptionalIKubectlProviderKubectlProvideroptionalIKubectlProvider #Default: Default CDK provider
kubectlProviderOptionsoptionalKubectlProviderOptionskubectl_provider_optionsoptionalKubectlProviderOptionskubectlProviderOptionsoptionalKubectlProviderOptionsKubectlProviderOptionsoptionalKubectlProviderOptionsKubectlProviderOptionsoptionalKubectlProviderOptions #Default: kubectl provider will not be created by default.
If defined, kubectlLayer is a required property.
openIdConnectProvideroptionalIOpenIdConnectProvideropen_id_connect_provideroptionalIOpenIdConnectProvideropenIdConnectProvideroptionalIOpenIdConnectProviderOpenIdConnectProvideroptionalIOpenIdConnectProviderOpenIdConnectProvideroptionalIOpenIdConnectProvider #Default: if not specified cluster.openIdConnectProvider and cluster.addServiceAccount will throw an error.
You can either import an existing provider using iam.OpenIdConnectProvider.fromProviderArn, or create a new provider using new eks.OpenIdConnectProvider
pruneoptionalbooleanpruneoptionalboolpruneoptionalBooleanPruneoptionalboolPruneoptional*bool = true #When this is enabled (default), prune labels will be allocated and injected to each resource. These labels will then be used when issuing the kubectl apply operation with the --prune switch.
securityGroupIdsoptionalstring[]security_group_idsoptionaltyping.List[str]securityGroupIdsoptionalList<String>SecurityGroupIdsoptionalstring[]SecurityGroupIdsoptional*[]*string #Default: if not specified, no additional security groups will be considered in cluster.connections.