Skip to content
v2.274.0

CfnCluster L1 construct ​

Creates an Amazon EKS control plane.

The Amazon EKS control plane consists of control plane instances that run the Kubernetes software, such as etcd and the API server. The control plane runs in an account managed by AWS , and the Kubernetes API is exposed by the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is single tenant and unique. It runs on its own set of Amazon EC2 instances.

The cluster control plane is provisioned across multiple Availability Zones and fronted by an ELB Network Load Balancer. Amazon EKS also provisions elastic network interfaces in your VPC subnets to provide connectivity from the control plane instances to the nodes (for example, to support kubectl exec , logs , and proxy data flows).

Amazon EKS nodes run in your AWS account and connect to your cluster's control plane over the Kubernetes API server endpoint and a certificate file that is created for your cluster.

You can use the endpointPublicAccess and endpointPrivateAccess parameters to enable or disable public and private access to your cluster's Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. The endpoint domain name and IP address family depends on the value of the ipFamily for the cluster. For more information, see Amazon EKS Cluster Endpoint Access Control in the Amazon EKS User Guide .

You can use the logging parameter to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster Control Plane Logs in the Amazon EKS User Guide .

CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see CloudWatch Pricing .

In most cases, it takes several minutes to create a cluster. After you create an Amazon EKS cluster, you must configure your Kubernetes tooling to communicate with the API server and launch nodes into your cluster. For more information, see Allowing users to access your cluster and Launching Amazon EKS nodes in the Amazon EKS User Guide .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_eks as eks } from 'aws-cdk-lib';
const cfnCluster = new eks.CfnCluster(this, 'MyCfnCluster', {
  resourcesVpcConfig: {
    subnetIds: ['subnetIds'],

    // the properties below are optional
    controlPlaneEgressMode: 'controlPlaneEgressMode',
    endpointPrivateAccess: false,
    endpointPublicAccess: false,
    publicAccessCidrs: ['publicAccessCidrs'],
    securityGroupIds: ['securityGroupIds'],
  },
  roleArn: 'roleArn',

  // the properties below are optional
  accessConfig: {
    authenticationMode: 'authenticationMode',
    bootstrapClusterCreatorAdminPermissions: false,
  },
  activeCertificateAuthorityId: 'activeCertificateAuthorityId',
  bootstrapSelfManagedAddons: false,
  certificateAuthority: {
    active: {
      activatedBy: 'activatedBy',
      id: 'id',
    },
    data: 'data',
  },
  computeConfig: {
    enabled: false,
    nodePools: ['nodePools'],
    nodeRoleArn: 'nodeRoleArn',
  },
  controlPlaneScalingConfig: {
    tier: 'tier',
  },
  deletionProtection: false,
  encryptionConfig: [{
    provider: {
      keyArn: 'keyArn',
    },
    resources: ['resources'],
  }],
  force: false,
  kubeApiServerConfig: {
    eventTtl: 'eventTtl',
    serviceNodePortRange: {
      maxPort: 123,
      minPort: 123,
    },
  },
  kubeControllerManagerConfig: {
    horizontalPodAutoscalerControllerConfig: {
      horizontalPodAutoscalerSyncPeriod: 'horizontalPodAutoscalerSyncPeriod',
    },
    podGcControllerConfig: {
      terminatedPodGcThreshold: 123,
    },
  },
  kubernetesNetworkConfig: {
    elasticLoadBalancing: {
      enabled: false,
    },
    ipFamily: 'ipFamily',
    serviceIpv4Cidr: 'serviceIpv4Cidr',
    serviceIpv6Cidr: 'serviceIpv6Cidr',
  },
  kubeSchedulerConfig: {
    nodeResourcesFit: {
      scoringStrategy: {
        resources: [{
          name: 'name',
          weight: 123,
        }],
        type: 'type',
      },
    },
  },
  logging: {
    clusterLogging: {
      enabledTypes: [{
        type: 'type',
      }],
    },
  },
  name: 'name',
  outpostConfig: {
    controlPlaneInstanceType: 'controlPlaneInstanceType',
    outpostArns: ['outpostArns'],

    // the properties below are optional
    controlPlanePlacement: {
      groupName: 'groupName',
      spreadLevel: 'spreadLevel',
    },
    etcdInstanceType: 'etcdInstanceType',
    etcdPlacement: {
      spreadLevel: 'spreadLevel',
    },
  },
  remoteNetworkConfig: {
    remoteNodeNetworks: [{
      cidrs: ['cidrs'],
    }],
    remotePodNetworks: [{
      cidrs: ['cidrs'],
    }],
  },
  rollbackConfig: {
    timeoutMinutes: 123,
  },
  storageConfig: {
    blockStorage: {
      enabled: false,
    },
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
  upgradePolicy: {
    supportType: 'supportType',
  },
  version: 'version',
  zonalShiftConfig: {
    enabled: false,
  },
});
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_eks as eks

cfn_cluster = eks.CfnCluster(self, "MyCfnCluster",
    resources_vpc_config=eks.CfnCluster.ResourcesVpcConfigProperty(
        subnet_ids=["subnetIds"],

        # the properties below are optional
        control_plane_egress_mode="controlPlaneEgressMode",
        endpoint_private_access=False,
        endpoint_public_access=False,
        public_access_cidrs=["publicAccessCidrs"],
        security_group_ids=["securityGroupIds"]
    ),
    role_arn="roleArn",

    # the properties below are optional
    access_config=eks.CfnCluster.AccessConfigProperty(
        authentication_mode="authenticationMode",
        bootstrap_cluster_creator_admin_permissions=False
    ),
    active_certificate_authority_id="activeCertificateAuthorityId",
    bootstrap_self_managed_addons=False,
    certificate_authority=eks.CfnCluster.CertificateAuthorityProperty(
        active=eks.CfnCluster.ActiveCertificateAuthorityProperty(
            activated_by="activatedBy",
            id="id"
        ),
        data="data"
    ),
    compute_config=eks.CfnCluster.ComputeConfigProperty(
        enabled=False,
        node_pools=["nodePools"],
        node_role_arn="nodeRoleArn"
    ),
    control_plane_scaling_config=eks.CfnCluster.ControlPlaneScalingConfigProperty(
        tier="tier"
    ),
    deletion_protection=False,
    encryption_config=[eks.CfnCluster.EncryptionConfigProperty(
        provider=eks.CfnCluster.ProviderProperty(
            key_arn="keyArn"
        ),
        resources=["resources"]
    )],
    force=False,
    kube_api_server_config=eks.CfnCluster.KubeApiServerConfigProperty(
        event_ttl="eventTtl",
        service_node_port_range=eks.CfnCluster.ServiceNodePortRangeProperty(
            max_port=123,
            min_port=123
        )
    ),
    kube_controller_manager_config=eks.CfnCluster.KubeControllerManagerConfigProperty(
        horizontal_pod_autoscaler_controller_config=eks.CfnCluster.HorizontalPodAutoscalerControllerConfigProperty(
            horizontal_pod_autoscaler_sync_period="horizontalPodAutoscalerSyncPeriod"
        ),
        pod_gc_controller_config=eks.CfnCluster.PodGcControllerConfigProperty(
            terminated_pod_gc_threshold=123
        )
    ),
    kubernetes_network_config=eks.CfnCluster.KubernetesNetworkConfigProperty(
        elastic_load_balancing=eks.CfnCluster.ElasticLoadBalancingProperty(
            enabled=False
        ),
        ip_family="ipFamily",
        service_ipv4_cidr="serviceIpv4Cidr",
        service_ipv6_cidr="serviceIpv6Cidr"
    ),
    kube_scheduler_config=eks.CfnCluster.KubeSchedulerConfigProperty(
        node_resources_fit=eks.CfnCluster.NodeResourcesFitConfigProperty(
            scoring_strategy=eks.CfnCluster.ScoringStrategyProperty(
                resources=[eks.CfnCluster.ResourceWeightProperty(
                    name="name",
                    weight=123
                )],
                type="type"
            )
        )
    ),
    logging=eks.CfnCluster.LoggingProperty(
        cluster_logging=eks.CfnCluster.ClusterLoggingProperty(
            enabled_types=[eks.CfnCluster.LoggingTypeConfigProperty(
                type="type"
            )]
        )
    ),
    name="name",
    outpost_config=eks.CfnCluster.OutpostConfigProperty(
        control_plane_instance_type="controlPlaneInstanceType",
        outpost_arns=["outpostArns"],

        # the properties below are optional
        control_plane_placement=eks.CfnCluster.ControlPlanePlacementProperty(
            group_name="groupName",
            spread_level="spreadLevel"
        ),
        etcd_instance_type="etcdInstanceType",
        etcd_placement=eks.CfnCluster.EtcdPlacementProperty(
            spread_level="spreadLevel"
        )
    ),
    remote_network_config=eks.CfnCluster.RemoteNetworkConfigProperty(
        remote_node_networks=[eks.CfnCluster.RemoteNodeNetworkProperty(
            cidrs=["cidrs"]
        )],
        remote_pod_networks=[eks.CfnCluster.RemotePodNetworkProperty(
            cidrs=["cidrs"]
        )]
    ),
    rollback_config=eks.CfnCluster.RollbackConfigProperty(
        timeout_minutes=123
    ),
    storage_config=eks.CfnCluster.StorageConfigProperty(
        block_storage=eks.CfnCluster.BlockStorageProperty(
            enabled=False
        )
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    upgrade_policy=eks.CfnCluster.UpgradePolicyProperty(
        support_type="supportType"
    ),
    version="version",
    zonal_shift_config=eks.CfnCluster.ZonalShiftConfigProperty(
        enabled=False
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.eks.*;

CfnCluster cfnCluster = CfnCluster.Builder.create(this, "MyCfnCluster")
        .resourcesVpcConfig(ResourcesVpcConfigProperty.builder()
                .subnetIds(List.of("subnetIds"))

                // the properties below are optional
                .controlPlaneEgressMode("controlPlaneEgressMode")
                .endpointPrivateAccess(false)
                .endpointPublicAccess(false)
                .publicAccessCidrs(List.of("publicAccessCidrs"))
                .securityGroupIds(List.of("securityGroupIds"))
                .build())
        .roleArn("roleArn")

        // the properties below are optional
        .accessConfig(AccessConfigProperty.builder()
                .authenticationMode("authenticationMode")
                .bootstrapClusterCreatorAdminPermissions(false)
                .build())
        .activeCertificateAuthorityId("activeCertificateAuthorityId")
        .bootstrapSelfManagedAddons(false)
        .certificateAuthority(CertificateAuthorityProperty.builder()
                .active(ActiveCertificateAuthorityProperty.builder()
                        .activatedBy("activatedBy")
                        .id("id")
                        .build())
                .data("data")
                .build())
        .computeConfig(ComputeConfigProperty.builder()
                .enabled(false)
                .nodePools(List.of("nodePools"))
                .nodeRoleArn("nodeRoleArn")
                .build())
        .controlPlaneScalingConfig(ControlPlaneScalingConfigProperty.builder()
                .tier("tier")
                .build())
        .deletionProtection(false)
        .encryptionConfig(List.of(EncryptionConfigProperty.builder()
                .provider(ProviderProperty.builder()
                        .keyArn("keyArn")
                        .build())
                .resources(List.of("resources"))
                .build()))
        .force(false)
        .kubeApiServerConfig(KubeApiServerConfigProperty.builder()
                .eventTtl("eventTtl")
                .serviceNodePortRange(ServiceNodePortRangeProperty.builder()
                        .maxPort(123)
                        .minPort(123)
                        .build())
                .build())
        .kubeControllerManagerConfig(KubeControllerManagerConfigProperty.builder()
                .horizontalPodAutoscalerControllerConfig(HorizontalPodAutoscalerControllerConfigProperty.builder()
                        .horizontalPodAutoscalerSyncPeriod("horizontalPodAutoscalerSyncPeriod")
                        .build())
                .podGcControllerConfig(PodGcControllerConfigProperty.builder()
                        .terminatedPodGcThreshold(123)
                        .build())
                .build())
        .kubernetesNetworkConfig(KubernetesNetworkConfigProperty.builder()
                .elasticLoadBalancing(ElasticLoadBalancingProperty.builder()
                        .enabled(false)
                        .build())
                .ipFamily("ipFamily")
                .serviceIpv4Cidr("serviceIpv4Cidr")
                .serviceIpv6Cidr("serviceIpv6Cidr")
                .build())
        .kubeSchedulerConfig(KubeSchedulerConfigProperty.builder()
                .nodeResourcesFit(NodeResourcesFitConfigProperty.builder()
                        .scoringStrategy(ScoringStrategyProperty.builder()
                                .resources(List.of(ResourceWeightProperty.builder()
                                        .name("name")
                                        .weight(123)
                                        .build()))
                                .type("type")
                                .build())
                        .build())
                .build())
        .logging(LoggingProperty.builder()
                .clusterLogging(ClusterLoggingProperty.builder()
                        .enabledTypes(List.of(LoggingTypeConfigProperty.builder()
                                .type("type")
                                .build()))
                        .build())
                .build())
        .name("name")
        .outpostConfig(OutpostConfigProperty.builder()
                .controlPlaneInstanceType("controlPlaneInstanceType")
                .outpostArns(List.of("outpostArns"))

                // the properties below are optional
                .controlPlanePlacement(ControlPlanePlacementProperty.builder()
                        .groupName("groupName")
                        .spreadLevel("spreadLevel")
                        .build())
                .etcdInstanceType("etcdInstanceType")
                .etcdPlacement(EtcdPlacementProperty.builder()
                        .spreadLevel("spreadLevel")
                        .build())
                .build())
        .remoteNetworkConfig(RemoteNetworkConfigProperty.builder()
                .remoteNodeNetworks(List.of(RemoteNodeNetworkProperty.builder()
                        .cidrs(List.of("cidrs"))
                        .build()))
                .remotePodNetworks(List.of(RemotePodNetworkProperty.builder()
                        .cidrs(List.of("cidrs"))
                        .build()))
                .build())
        .rollbackConfig(RollbackConfigProperty.builder()
                .timeoutMinutes(123)
                .build())
        .storageConfig(StorageConfigProperty.builder()
                .blockStorage(BlockStorageProperty.builder()
                        .enabled(false)
                        .build())
                .build())
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .upgradePolicy(UpgradePolicyProperty.builder()
                .supportType("supportType")
                .build())
        .version("version")
        .zonalShiftConfig(ZonalShiftConfigProperty.builder()
                .enabled(false)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EKS;

var cfnCluster = new CfnCluster(this, "MyCfnCluster", new CfnClusterProps {
    ResourcesVpcConfig = new ResourcesVpcConfigProperty {
        SubnetIds = new [] { "subnetIds" },

        // the properties below are optional
        ControlPlaneEgressMode = "controlPlaneEgressMode",
        EndpointPrivateAccess = false,
        EndpointPublicAccess = false,
        PublicAccessCidrs = new [] { "publicAccessCidrs" },
        SecurityGroupIds = new [] { "securityGroupIds" }
    },
    RoleArn = "roleArn",

    // the properties below are optional
    AccessConfig = new AccessConfigProperty {
        AuthenticationMode = "authenticationMode",
        BootstrapClusterCreatorAdminPermissions = false
    },
    ActiveCertificateAuthorityId = "activeCertificateAuthorityId",
    BootstrapSelfManagedAddons = false,
    CertificateAuthority = new CertificateAuthorityProperty {
        Active = new ActiveCertificateAuthorityProperty {
            ActivatedBy = "activatedBy",
            Id = "id"
        },
        Data = "data"
    },
    ComputeConfig = new ComputeConfigProperty {
        Enabled = false,
        NodePools = new [] { "nodePools" },
        NodeRoleArn = "nodeRoleArn"
    },
    ControlPlaneScalingConfig = new ControlPlaneScalingConfigProperty {
        Tier = "tier"
    },
    DeletionProtection = false,
    EncryptionConfig = new [] { new EncryptionConfigProperty {
        Provider = new ProviderProperty {
            KeyArn = "keyArn"
        },
        Resources = new [] { "resources" }
    } },
    Force = false,
    KubeApiServerConfig = new KubeApiServerConfigProperty {
        EventTtl = "eventTtl",
        ServiceNodePortRange = new ServiceNodePortRangeProperty {
            MaxPort = 123,
            MinPort = 123
        }
    },
    KubeControllerManagerConfig = new KubeControllerManagerConfigProperty {
        HorizontalPodAutoscalerControllerConfig = new HorizontalPodAutoscalerControllerConfigProperty {
            HorizontalPodAutoscalerSyncPeriod = "horizontalPodAutoscalerSyncPeriod"
        },
        PodGcControllerConfig = new PodGcControllerConfigProperty {
            TerminatedPodGcThreshold = 123
        }
    },
    KubernetesNetworkConfig = new KubernetesNetworkConfigProperty {
        ElasticLoadBalancing = new ElasticLoadBalancingProperty {
            Enabled = false
        },
        IpFamily = "ipFamily",
        ServiceIpv4Cidr = "serviceIpv4Cidr",
        ServiceIpv6Cidr = "serviceIpv6Cidr"
    },
    KubeSchedulerConfig = new KubeSchedulerConfigProperty {
        NodeResourcesFit = new NodeResourcesFitConfigProperty {
            ScoringStrategy = new ScoringStrategyProperty {
                Resources = new [] { new ResourceWeightProperty {
                    Name = "name",
                    Weight = 123
                } },
                Type = "type"
            }
        }
    },
    Logging = new LoggingProperty {
        ClusterLogging = new ClusterLoggingProperty {
            EnabledTypes = new [] { new LoggingTypeConfigProperty {
                Type = "type"
            } }
        }
    },
    Name = "name",
    OutpostConfig = new OutpostConfigProperty {
        ControlPlaneInstanceType = "controlPlaneInstanceType",
        OutpostArns = new [] { "outpostArns" },

        // the properties below are optional
        ControlPlanePlacement = new ControlPlanePlacementProperty {
            GroupName = "groupName",
            SpreadLevel = "spreadLevel"
        },
        EtcdInstanceType = "etcdInstanceType",
        EtcdPlacement = new EtcdPlacementProperty {
            SpreadLevel = "spreadLevel"
        }
    },
    RemoteNetworkConfig = new RemoteNetworkConfigProperty {
        RemoteNodeNetworks = new [] { new RemoteNodeNetworkProperty {
            Cidrs = new [] { "cidrs" }
        } },
        RemotePodNetworks = new [] { new RemotePodNetworkProperty {
            Cidrs = new [] { "cidrs" }
        } }
    },
    RollbackConfig = new RollbackConfigProperty {
        TimeoutMinutes = 123
    },
    StorageConfig = new StorageConfigProperty {
        BlockStorage = new BlockStorageProperty {
            Enabled = false
        }
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } },
    UpgradePolicy = new UpgradePolicyProperty {
        SupportType = "supportType"
    },
    Version = "version",
    ZonalShiftConfig = new ZonalShiftConfigProperty {
        Enabled = false
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnCluster := awscdk.Aws_eks.NewCfnCluster(this, jsii.String("MyCfnCluster"), &CfnClusterProps{
	ResourcesVpcConfig: &ResourcesVpcConfigProperty{
		SubnetIds: []*string{
			jsii.String("subnetIds"),
		},

		// the properties below are optional
		ControlPlaneEgressMode: jsii.String("controlPlaneEgressMode"),
		EndpointPrivateAccess: jsii.Boolean(false),
		EndpointPublicAccess: jsii.Boolean(false),
		PublicAccessCidrs: []*string{
			jsii.String("publicAccessCidrs"),
		},
		SecurityGroupIds: []*string{
			jsii.String("securityGroupIds"),
		},
	},
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	AccessConfig: &AccessConfigProperty{
		AuthenticationMode: jsii.String("authenticationMode"),
		BootstrapClusterCreatorAdminPermissions: jsii.Boolean(false),
	},
	ActiveCertificateAuthorityId: jsii.String("activeCertificateAuthorityId"),
	BootstrapSelfManagedAddons: jsii.Boolean(false),
	CertificateAuthority: &CertificateAuthorityProperty{
		Active: &ActiveCertificateAuthorityProperty{
			ActivatedBy: jsii.String("activatedBy"),
			Id: jsii.String("id"),
		},
		Data: jsii.String("data"),
	},
	ComputeConfig: &ComputeConfigProperty{
		Enabled: jsii.Boolean(false),
		NodePools: []*string{
			jsii.String("nodePools"),
		},
		NodeRoleArn: jsii.String("nodeRoleArn"),
	},
	ControlPlaneScalingConfig: &ControlPlaneScalingConfigProperty{
		Tier: jsii.String("tier"),
	},
	DeletionProtection: jsii.Boolean(false),
	EncryptionConfig: []interface{}{
		&EncryptionConfigProperty{
			Provider: &ProviderProperty{
				KeyArn: jsii.String("keyArn"),
			},
			Resources: []*string{
				jsii.String("resources"),
			},
		},
	},
	Force: jsii.Boolean(false),
	KubeApiServerConfig: &KubeApiServerConfigProperty{
		EventTtl: jsii.String("eventTtl"),
		ServiceNodePortRange: &ServiceNodePortRangeProperty{
			MaxPort: jsii.Number(123),
			MinPort: jsii.Number(123),
		},
	},
	KubeControllerManagerConfig: &KubeControllerManagerConfigProperty{
		HorizontalPodAutoscalerControllerConfig: &HorizontalPodAutoscalerControllerConfigProperty{
			HorizontalPodAutoscalerSyncPeriod: jsii.String("horizontalPodAutoscalerSyncPeriod"),
		},
		PodGcControllerConfig: &PodGcControllerConfigProperty{
			TerminatedPodGcThreshold: jsii.Number(123),
		},
	},
	KubernetesNetworkConfig: &KubernetesNetworkConfigProperty{
		ElasticLoadBalancing: &ElasticLoadBalancingProperty{
			Enabled: jsii.Boolean(false),
		},
		IpFamily: jsii.String("ipFamily"),
		ServiceIpv4Cidr: jsii.String("serviceIpv4Cidr"),
		ServiceIpv6Cidr: jsii.String("serviceIpv6Cidr"),
	},
	KubeSchedulerConfig: &KubeSchedulerConfigProperty{
		NodeResourcesFit: &NodeResourcesFitConfigProperty{
			ScoringStrategy: &ScoringStrategyProperty{
				Resources: []interface{}{
					&ResourceWeightProperty{
						Name: jsii.String("name"),
						Weight: jsii.Number(123),
					},
				},
				Type: jsii.String("type"),
			},
		},
	},
	Logging: &LoggingProperty{
		ClusterLogging: &ClusterLoggingProperty{
			EnabledTypes: []interface{}{
				&LoggingTypeConfigProperty{
					Type: jsii.String("type"),
				},
			},
		},
	},
	Name: jsii.String("name"),
	OutpostConfig: &OutpostConfigProperty{
		ControlPlaneInstanceType: jsii.String("controlPlaneInstanceType"),
		OutpostArns: []*string{
			jsii.String("outpostArns"),
		},

		// the properties below are optional
		ControlPlanePlacement: &ControlPlanePlacementProperty{
			GroupName: jsii.String("groupName"),
			SpreadLevel: jsii.String("spreadLevel"),
		},
		EtcdInstanceType: jsii.String("etcdInstanceType"),
		EtcdPlacement: &EtcdPlacementProperty{
			SpreadLevel: jsii.String("spreadLevel"),
		},
	},
	RemoteNetworkConfig: &RemoteNetworkConfigProperty{
		RemoteNodeNetworks: []interface{}{
			&RemoteNodeNetworkProperty{
				Cidrs: []*string{
					jsii.String("cidrs"),
				},
			},
		},
		RemotePodNetworks: []interface{}{
			&RemotePodNetworkProperty{
				Cidrs: []*string{
					jsii.String("cidrs"),
				},
			},
		},
	},
	RollbackConfig: &RollbackConfigProperty{
		TimeoutMinutes: jsii.Number(123),
	},
	StorageConfig: &StorageConfigProperty{
		BlockStorage: &BlockStorageProperty{
			Enabled: jsii.Boolean(false),
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
	UpgradePolicy: &UpgradePolicyProperty{
		SupportType: jsii.String("supportType"),
	},
	Version: jsii.String("version"),
	ZonalShiftConfig: &ZonalShiftConfigProperty{
		Enabled: jsii.Boolean(false),
	},
})

Initializer ​

ts
new CfnCluster(scope: Construct, id: string, props: CfnClusterProps)
python
CfnCluster(scope: Construct, id: str, props: CfnClusterProps)
java
new CfnCluster(Construct scope, String id, CfnClusterProps props)
csharp
new CfnCluster(Construct scope, string id, CfnClusterProps props)
go
NewCfnCluster(Scope Construct, Id *string, Props CfnClusterProps)

Construct Props ​

accessConfigIResolvable | CfnCluster.AccessConfigPropertyaccess_configtyping.Union[IResolvable, AccessConfigProperty]accessConfigIResolvableAccessConfigIResolvableAccessConfiginterface{}#
The access configuration for the cluster.
activeCertificateAuthorityIdstringactive_certificate_authority_idstractiveCertificateAuthorityIdStringActiveCertificateAuthorityIdstringActiveCertificateAuthorityId*string#
The ID of the certificate authority to activate as the cluster's signing CA.

Setting or changing this value activates the specified CA (the previously active CA becomes trusted).

bootstrapSelfManagedAddonsboolean | IResolvablebootstrap_self_managed_addonstyping.Union[bool, IResolvable]bootstrapSelfManagedAddonsBooleanBootstrapSelfManagedAddonsboolBootstrapSelfManagedAddonsinterface{}#
If you set this value to `False` when creating a cluster, the default networking add-ons will not be installed.

The default networking add-ons include vpc-cni , coredns , and kube-proxy .

Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.

certificateAuthorityIResolvable | CfnCluster.CertificateAuthorityPropertycertificate_authoritytyping.Union[IResolvable, CertificateAuthorityProperty]certificateAuthorityIResolvableCertificateAuthorityIResolvableCertificateAuthorityinterface{}#
The certificate authority information for the cluster, including the trust bundle and the currently active signing certificate authority.
computeConfigIResolvable | CfnCluster.ComputeConfigPropertycompute_configtyping.Union[IResolvable, ComputeConfigProperty]computeConfigIResolvableComputeConfigIResolvableComputeConfiginterface{}#
Indicates the current configuration of the compute capability on your EKS Auto Mode cluster.
notes

For example, if the capability is enabled or disabled. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your AWS account. For more information, see EKS Auto Mode compute capability in the Amazon EKS User Guide .

controlPlaneScalingConfigIResolvable | CfnCluster.ControlPlaneScalingConfigPropertycontrol_plane_scaling_configtyping.Union[IResolvable, ControlPlaneScalingConfigProperty]controlPlaneScalingConfigIResolvableControlPlaneScalingConfigIResolvableControlPlaneScalingConfiginterface{}#
The control plane scaling tier configuration.

For more information, see EKS Provisioned Control Plane in the Amazon EKS User Guide.

deletionProtectionboolean | IResolvabledeletion_protectiontyping.Union[bool, IResolvable]deletionProtectionBooleanDeletionProtectionboolDeletionProtectioninterface{}#
The current deletion protection setting for the cluster.

When true , deletion protection is enabled and the cluster cannot be deleted until protection is disabled. When false , the cluster can be deleted normally. This setting only applies to clusters in an active state.

encryptionConfigIResolvable | IResolvable | CfnCluster.EncryptionConfigProperty[]encryption_configtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EncryptionConfigProperty]]]encryptionConfigIResolvableEncryptionConfigIResolvableEncryptionConfiginterface{}#
The encryption configuration for the cluster.
forceboolean | IResolvableforcetyping.Union[bool, IResolvable]forceBooleanForceboolForceinterface{}= false#
Set this value to `true` to override upgrade-blocking readiness checks when updating a cluster.
kubeApiServerConfigIResolvable | CfnCluster.KubeApiServerConfigPropertykube_api_server_configtyping.Union[IResolvable, KubeApiServerConfigProperty]kubeApiServerConfigIResolvableKubeApiServerConfigIResolvableKubeApiServerConfiginterface{}#
The configuration for the Kubernetes API server on an Amazon EKS cluster.
kubeControllerManagerConfigIResolvable | CfnCluster.KubeControllerManagerConfigPropertykube_controller_manager_configtyping.Union[IResolvable, KubeControllerManagerConfigProperty]kubeControllerManagerConfigIResolvableKubeControllerManagerConfigIResolvableKubeControllerManagerConfiginterface{}#
The configuration for the Kubernetes controller manager on an Amazon EKS cluster.
kubernetesNetworkConfigIResolvable | CfnCluster.KubernetesNetworkConfigPropertykubernetes_network_configtyping.Union[IResolvable, KubernetesNetworkConfigProperty]kubernetesNetworkConfigIResolvableKubernetesNetworkConfigIResolvableKubernetesNetworkConfiginterface{}#
The Kubernetes network configuration for the cluster.
kubeSchedulerConfigIResolvable | CfnCluster.KubeSchedulerConfigPropertykube_scheduler_configtyping.Union[IResolvable, KubeSchedulerConfigProperty]kubeSchedulerConfigIResolvableKubeSchedulerConfigIResolvableKubeSchedulerConfiginterface{}#
The configuration for the Kubernetes scheduler on an Amazon EKS cluster.
loggingIResolvable | CfnCluster.LoggingPropertyloggingtyping.Union[IResolvable, LoggingProperty]loggingIResolvableLoggingIResolvableLogginginterface{}#
The logging configuration for your cluster.
namestringnamestrnameStringNamestringName*string#
The unique name to give to your cluster.
notes

The name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphanumeric character and can't be longer than 100 characters. The name must be unique within the AWS Region and AWS account that you're creating the cluster in. Note that underscores can't be used in CloudFormation .

outpostConfigIResolvable | CfnCluster.OutpostConfigPropertyoutpost_configtyping.Union[IResolvable, OutpostConfigProperty]outpostConfigIResolvableOutpostConfigIResolvableOutpostConfiginterface{}#
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.

This object isn't available for clusters on the AWS cloud.

remoteNetworkConfigIResolvable | CfnCluster.RemoteNetworkConfigPropertyremote_network_configtyping.Union[IResolvable, RemoteNetworkConfigProperty]remoteNetworkConfigIResolvableRemoteNetworkConfigIResolvableRemoteNetworkConfiginterface{}#
The configuration in the cluster for EKS Hybrid Nodes.

You can add, change, or remove this configuration after the cluster is created.

resourcesVpcConfigIResolvable | CfnCluster.ResourcesVpcConfigPropertyresources_vpc_configtyping.Union[IResolvable, ResourcesVpcConfigProperty]resourcesVpcConfigIResolvableResourcesVpcConfigIResolvableResourcesVpcConfiginterface{}required#
The VPC configuration that's used by the cluster control plane.
notes

Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide . You must specify at least two subnets. You can specify up to five security groups, but we recommend that you use a dedicated security group for your cluster control plane.

roleArnstring | IRoleRefrole_arntyping.Union[str, IRoleRef]roleArnStringRoleArnstringRoleArninterface{}required#
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

For more information, see Amazon EKS Service IAM Role in the Amazon EKS User Guide .

rollbackConfigIResolvable | CfnCluster.RollbackConfigPropertyrollback_configtyping.Union[IResolvable, RollbackConfigProperty]rollbackConfigIResolvableRollbackConfigIResolvableRollbackConfiginterface{}#
The rollback configuration to use for the cluster version rollback.
storageConfigIResolvable | CfnCluster.StorageConfigPropertystorage_configtyping.Union[IResolvable, StorageConfigProperty]storageConfigIResolvableStorageConfigIResolvableStorageConfiginterface{}#
Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster.
notes

For example, if the capability is enabled or disabled. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your AWS account. For more information, see EKS Auto Mode block storage capability in the Amazon EKS User Guide .

tagsCfnTag[]tagstyping.List[CfnTag]tagsList<CfnTag>TagsCfnTag[]Tags*[]CfnTag#
The metadata that you apply to the cluster to assist with categorization and organization.
notes

Each tag consists of a key and an optional value, both of which you define. Cluster tags don't propagate to any other resources associated with the cluster.

You must have the eks:TagResource and eks:UntagResource permissions for your IAM principal to manage the CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.

upgradePolicyIResolvable | CfnCluster.UpgradePolicyPropertyupgrade_policytyping.Union[IResolvable, UpgradePolicyProperty]upgradePolicyIResolvableUpgradePolicyIResolvableUpgradePolicyinterface{}#
This value indicates if extended support is enabled or disabled for the cluster.
versionstringversionstrversionStringVersionstringVersion*string#
The desired Kubernetes version for your cluster.

If you don't specify a value here, the default version available in Amazon EKS is used.

The default version might not be the latest version available.

zonalShiftConfigIResolvable | CfnCluster.ZonalShiftConfigPropertyzonal_shift_configtyping.Union[IResolvable, ZonalShiftConfigProperty]zonalShiftConfigIResolvableZonalShiftConfigIResolvableZonalShiftConfiginterface{}#
The configuration for zonal shift for the cluster.

Properties ​

accessConfigIResolvable | CfnCluster.AccessConfigPropertyaccess_configtyping.Union[IResolvable, AccessConfigProperty]accessConfigIResolvableAccessConfigIResolvableAccessConfiginterface{}#
The access configuration for the cluster.
activeCertificateAuthorityIdstringactive_certificate_authority_idstractiveCertificateAuthorityIdStringActiveCertificateAuthorityIdstringActiveCertificateAuthorityId*string#
The ID of the certificate authority to activate as the cluster's signing CA.
attrArnstringattr_arnstrattrArnStringAttrArnstringAttrArn*stringrequired#
The ARN of the cluster, such as `arn:aws:eks:us-west-2:666666666666:cluster/prod` .
attrCertificateAuthorityActiveActivatedBystringattr_certificate_authority_active_activated_bystrattrCertificateAuthorityActiveActivatedByStringAttrCertificateAuthorityActiveActivatedBystringAttrCertificateAuthorityActiveActivatedBy*stringrequired#
Indicates whether the active certificate authority was activated by EKS or by the customer.
attrCertificateAuthorityActiveIdstringattr_certificate_authority_active_idstrattrCertificateAuthorityActiveIdStringAttrCertificateAuthorityActiveIdstringAttrCertificateAuthorityActiveId*stringrequired#
The ID of the active (signing) certificate authority.
attrCertificateAuthorityCertificateDatastringattr_certificate_authority_certificate_datastrattrCertificateAuthorityCertificateDataStringAttrCertificateAuthorityCertificateDatastringAttrCertificateAuthorityCertificateData*stringrequired#
The base64-encoded certificate-authority trust bundle for the cluster (all trusted CAs).
attrCertificateAuthorityDatastringattr_certificate_authority_datastrattrCertificateAuthorityDataStringAttrCertificateAuthorityDatastringAttrCertificateAuthorityData*stringrequired#
The `certificate-authority-data` for your cluster.
attrClusterSecurityGroupIdstringattr_cluster_security_group_idstrattrClusterSecurityGroupIdStringAttrClusterSecurityGroupIdstringAttrClusterSecurityGroupId*stringrequired#
The cluster security group that was created by Amazon EKS for the cluster.
notes

Managed node groups use this security group for control plane to data plane communication.

This parameter is only returned by Amazon EKS clusters that support managed node groups. For more information, see Managed node groups in the Amazon EKS User Guide .

attrEncryptionConfigKeyArnstringattr_encryption_config_key_arnstrattrEncryptionConfigKeyArnStringAttrEncryptionConfigKeyArnstringAttrEncryptionConfigKeyArn*stringrequired#
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
attrEndpointstringattr_endpointstrattrEndpointStringAttrEndpointstringAttrEndpoint*stringrequired#
The endpoint for your Kubernetes API server, such as `https://5E1D0CEXAMPLEA591B746AFC5AB30262.yl4.us-west-2.eks.amazonaws.com` .
attrIdstringattr_idstrattrIdStringAttrIdstringAttrId*stringrequired#
The ID of your local Amazon EKS cluster on an AWS Outpost.

This property isn't available for an Amazon EKS cluster on the AWS cloud.

attrKubernetesNetworkConfigServiceIpv6Cidrstringattr_kubernetes_network_config_service_ipv6_cidrstrattrKubernetesNetworkConfigServiceIpv6CidrStringAttrKubernetesNetworkConfigServiceIpv6CidrstringAttrKubernetesNetworkConfigServiceIpv6Cidr*stringrequired#
The CIDR block that Kubernetes Service IP addresses are assigned from if you created a `1.21` or later cluster with version `>1.10.1` or later of the Amazon VPC CNI add-on and specified `ipv6` for *ipFamily* when you created the cluster. Kubernetes assigns Service addresses from the unique local address range ( `fc00::/7` ) because you can't specify a custom `IPv6` CIDR block when you create the cluster.
attrOpenIdConnectIssuerUrlstringattr_open_id_connect_issuer_urlstrattrOpenIdConnectIssuerUrlStringAttrOpenIdConnectIssuerUrlstringAttrOpenIdConnectIssuerUrl*stringrequired#
The issuer URL for the OIDC identity provider of the cluster, such as `https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B716D3041E` . If you need to remove `https://` from this output value, you can include the following code in your template.

!Select [1, !Split ["//", !GetAtt EKSCluster.OpenIdConnectIssuerUrl]]

bootstrapSelfManagedAddonsboolean | IResolvablebootstrap_self_managed_addonstyping.Union[bool, IResolvable]bootstrapSelfManagedAddonsBooleanBootstrapSelfManagedAddonsboolBootstrapSelfManagedAddonsinterface{}#
If you set this value to `False` when creating a cluster, the default networking add-ons will not be installed.
certificateAuthorityIResolvable | CfnCluster.CertificateAuthorityPropertycertificate_authoritytyping.Union[IResolvable, CertificateAuthorityProperty]certificateAuthorityIResolvableCertificateAuthorityIResolvableCertificateAuthorityinterface{}#
The certificate authority information for the cluster, including the trust bundle and the currently active signing certificate authority.
CFN_RESOURCE_TYPE_NAMEstringcfn_resource_type_namestrCFN_RESOURCE_TYPE_NAMEStringCFN_RESOURCE_TYPE_NAMEstringCFN_RESOURCE_TYPE_NAME*stringrequiredstatic#
The CloudFormation resource type name for this resource class.
Options for this resource, such as condition, update policy etc.
cfnResourceTypestringcfn_resource_typestrcfnResourceTypeStringCfnResourceTypestringCfnResourceType*stringrequired#
AWS resource type.
clusterRefClusterReferencecluster_refClusterReferenceclusterRefClusterReferenceClusterRefClusterReferenceClusterRefClusterReferencerequired#
A reference to a Cluster resource.
computeConfigIResolvable | CfnCluster.ComputeConfigPropertycompute_configtyping.Union[IResolvable, ComputeConfigProperty]computeConfigIResolvableComputeConfigIResolvableComputeConfiginterface{}#
Indicates the current configuration of the compute capability on your EKS Auto Mode cluster.
controlPlaneScalingConfigIResolvable | CfnCluster.ControlPlaneScalingConfigPropertycontrol_plane_scaling_configtyping.Union[IResolvable, ControlPlaneScalingConfigProperty]controlPlaneScalingConfigIResolvableControlPlaneScalingConfigIResolvableControlPlaneScalingConfiginterface{}#
The control plane scaling tier configuration.
creationStackstring[]creation_stacktyping.List[str]creationStackList<String>CreationStackstring[]CreationStack*[]*stringrequired#
deletionProtectionboolean | IResolvabledeletion_protectiontyping.Union[bool, IResolvable]deletionProtectionBooleanDeletionProtectionboolDeletionProtectioninterface{}#
The current deletion protection setting for the cluster.
encryptionConfigIResolvable | IResolvable | CfnCluster.EncryptionConfigProperty[]encryption_configtyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EncryptionConfigProperty]]]encryptionConfigIResolvableEncryptionConfigIResolvableEncryptionConfiginterface{}#
The encryption configuration for the cluster.
forceboolean | IResolvableforcetyping.Union[bool, IResolvable]forceBooleanForceboolForceinterface{}#
Set this value to `true` to override upgrade-blocking readiness checks when updating a cluster.
kubeApiServerConfigIResolvable | CfnCluster.KubeApiServerConfigPropertykube_api_server_configtyping.Union[IResolvable, KubeApiServerConfigProperty]kubeApiServerConfigIResolvableKubeApiServerConfigIResolvableKubeApiServerConfiginterface{}#
The configuration for the Kubernetes API server on an Amazon EKS cluster.
kubeControllerManagerConfigIResolvable | CfnCluster.KubeControllerManagerConfigPropertykube_controller_manager_configtyping.Union[IResolvable, KubeControllerManagerConfigProperty]kubeControllerManagerConfigIResolvableKubeControllerManagerConfigIResolvableKubeControllerManagerConfiginterface{}#
The configuration for the Kubernetes controller manager on an Amazon EKS cluster.
kubernetesNetworkConfigIResolvable | CfnCluster.KubernetesNetworkConfigPropertykubernetes_network_configtyping.Union[IResolvable, KubernetesNetworkConfigProperty]kubernetesNetworkConfigIResolvableKubernetesNetworkConfigIResolvableKubernetesNetworkConfiginterface{}#
The Kubernetes network configuration for the cluster.
kubeSchedulerConfigIResolvable | CfnCluster.KubeSchedulerConfigPropertykube_scheduler_configtyping.Union[IResolvable, KubeSchedulerConfigProperty]kubeSchedulerConfigIResolvableKubeSchedulerConfigIResolvableKubeSchedulerConfiginterface{}#
The configuration for the Kubernetes scheduler on an Amazon EKS cluster.
loggingIResolvable | CfnCluster.LoggingPropertyloggingtyping.Union[IResolvable, LoggingProperty]loggingIResolvableLoggingIResolvableLogginginterface{}#
The logging configuration for your cluster.
logicalIdstringlogical_idstrlogicalIdStringLogicalIdstringLogicalId*stringrequired#
The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

namestringnamestrnameStringNamestringName*string#
The unique name to give to your cluster.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
outpostConfigIResolvable | CfnCluster.OutpostConfigPropertyoutpost_configtyping.Union[IResolvable, OutpostConfigProperty]outpostConfigIResolvableOutpostConfigIResolvableOutpostConfiginterface{}#
An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost.
refstringrefstrrefStringRefstringRef*stringrequired#
Return a string that will be resolved to a CloudFormation `{ Ref }` for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

remoteNetworkConfigIResolvable | CfnCluster.RemoteNetworkConfigPropertyremote_network_configtyping.Union[IResolvable, RemoteNetworkConfigProperty]remoteNetworkConfigIResolvableRemoteNetworkConfigIResolvableRemoteNetworkConfiginterface{}#
The configuration in the cluster for EKS Hybrid Nodes.
resourcesVpcConfigIResolvable | CfnCluster.ResourcesVpcConfigPropertyresources_vpc_configtyping.Union[IResolvable, ResourcesVpcConfigProperty]resourcesVpcConfigIResolvableResourcesVpcConfigIResolvableResourcesVpcConfiginterface{}required#
The VPC configuration that's used by the cluster control plane.
roleArnstringrole_arnstrroleArnStringRoleArnstringRoleArn*stringrequired#
The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
rollbackConfigIResolvable | CfnCluster.RollbackConfigPropertyrollback_configtyping.Union[IResolvable, RollbackConfigProperty]rollbackConfigIResolvableRollbackConfigIResolvableRollbackConfiginterface{}#
The rollback configuration to use for the cluster version rollback.
stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

storageConfigIResolvable | CfnCluster.StorageConfigPropertystorage_configtyping.Union[IResolvable, StorageConfigProperty]storageConfigIResolvableStorageConfigIResolvableStorageConfiginterface{}#
Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster.
Tag Manager which manages the tags for this resource.
tagsRawCfnTag[]tags_rawtyping.List[CfnTag]tagsRawList<CfnTag>TagsRawCfnTag[]TagsRaw*[]CfnTag#
The metadata that you apply to the cluster to assist with categorization and organization.
upgradePolicyIResolvable | CfnCluster.UpgradePolicyPropertyupgrade_policytyping.Union[IResolvable, UpgradePolicyProperty]upgradePolicyIResolvableUpgradePolicyIResolvableUpgradePolicyinterface{}#
This value indicates if extended support is enabled or disabled for the cluster.
versionstringversionstrversionStringVersionstringVersion*string#
The desired Kubernetes version for your cluster.
zonalShiftConfigIResolvable | CfnCluster.ZonalShiftConfigPropertyzonal_shift_configtyping.Union[IResolvable, ZonalShiftConfigProperty]zonalShiftConfigIResolvableZonalShiftConfigIResolvableZonalShiftConfiginterface{}#
The configuration for zonal shift for the cluster.

Methods ​

addDeletionOverride(path: string): voiddef add_deletion_override(self, path: str) -> Nonepublic void addDeletionOverride(String path)public void AddDeletionOverride(string path)func AddDeletionOverride(Path *string)#
Syntactic sugar for `addOverride(path, undefined)`.
1 parameter

Parameters

  • pathpathpathpathPath — The path of the value to delete.
addDependency(target: CfnResource): voiddef add_dependency(self, target: CfnResource) -> Nonepublic void addDependency(CfnResource target)public void AddDependency(CfnResource target)func AddDependency(Target CfnResource)deprecated#
Use `addResourceDependency` instead.

This method has been renamed to addResourceDependency to more clearly set it apart from construct.node.addDependency. See the documentation of that function for more details.

addDependsOn(target: CfnResource): voiddef add_depends_on(self, target: CfnResource) -> Nonepublic void addDependsOn(CfnResource target)public void AddDependsOn(CfnResource target)func AddDependsOn(Target CfnResource)deprecated#
Use `addResourceDependency` instead.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method has been renamed to addResourceDependency, which makes it more clear that this method operates at a different level from the construct-level construct.node.addDependency() mechanism.

addMetadata(key: string, value: any): voiddef add_metadata(self, key: str, value: Any) -> Nonepublic void addMetadata(String key, Object value)public void AddMetadata(string key, object value)func AddMetadata(Key *string, Value interface{})#
Add a value to the CloudFormation Resource Metadata.
addOverride(path: string, value: any): voiddef add_override(self, path: str, value: Any) -> Nonepublic void addOverride(String path, Object value)public void AddOverride(string path, object value)func AddOverride(Path *string, Value interface{})#
Adds an override to the synthesized CloudFormation resource.
notes · 2 parameters

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example,

typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');

would add the overrides

json
"Properties": {
  "GlobalSecondaryIndexes": [
    {
      "Projection": {
        "NonKeyAttributes": [ "myattribute" ]
        ...
      }
      ...
    },
    {
      "ProjectionType": "INCLUDE"
      ...
    },
  ]
  ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters

  • pathpathpathpathPath — - The path of the property, you can use dot notation to override values in complex types.
  • valuevaluevaluevalueValue — - The value.
addPropertyDeletionOverride(propertyPath: string): voiddef add_property_deletion_override(self, property_path: str) -> Nonepublic void addPropertyDeletionOverride(String propertyPath)public void AddPropertyDeletionOverride(string propertyPath)func AddPropertyDeletionOverride(PropertyPath *string)#
Adds an override that deletes the value of a property from the resource definition.
1 parameter

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path to the property.
addPropertyOverride(propertyPath: string, value: any): voiddef add_property_override(self, property_path: str, value: Any) -> Nonepublic void addPropertyOverride(String propertyPath, Object value)public void AddPropertyOverride(string propertyPath, object value)func AddPropertyOverride(PropertyPath *string, Value interface{})#
Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

2 parameters

Parameters

  • propertyPathproperty_pathpropertyPathpropertyPathPropertyPath — The path of the property.
  • valuevaluevaluevalueValue — The value.
addResourceDependency(target: CfnResource, reason?: string): voiddef add_resource_dependency(self, target: CfnResource, reason: typing.Optional[str] = None) -> Nonepublic void addResourceDependency(CfnResource target, String reason)public void AddResourceDependency(CfnResource target, string? reason = null)func AddResourceDependency(Target CfnResource, Reason *string)#
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
notes

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

This method only adds dependencies between L1 resources. If you are looking for a generic construct-to-construct dependency mechanism that works for all constructs including L2s, use construct.node.addDependency instead.

applyCrossStackReferenceStrength(strength: ReferenceStrength): voiddef apply_cross_stack_reference_strength(self, strength: ReferenceStrength) -> Nonepublic void applyCrossStackReferenceStrength(ReferenceStrength strength)public void ApplyCrossStackReferenceStrength(ReferenceStrength strength)func ApplyCrossStackReferenceStrength(Strength ReferenceStrength)#
Sets the cross-stack reference strength for this resource.

When set, any cross-stack reference to this resource will use the specified strength instead of the global default from the consuming stack's context.

1 parameter

Parameters

  • strengthstrengthstrengthstrengthStrength — - The reference strength to use for this resource.
applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): voiddef apply_removal_policy(self, policy: typing.Optional[RemovalPolicy] = None, options: typing.Optional[RemovalPolicyOptions] = None) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)public void ApplyRemovalPolicy(RemovalPolicy? policy = null, RemovalPolicyOptions? options = null)func ApplyRemovalPolicy(Policy RemovalPolicy, Options RemovalPolicyOptions)#
Sets the deletion policy of the resource based on the removal policy specified.
notes

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). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT). A list of resources that support this policy can be found in the following link:

arnForCluster(resource: IClusterRef): string@staticmethod def arn_for_cluster(resource: IClusterRef) -> strpublic static String arnForCluster(IClusterRef resource)public static string ArnForCluster(IClusterRef resource)func ArnForCluster(Resource IClusterRef) *stringstatic#
cfnPropertyName(cdkPropertyName: string): stringdef cfn_property_name(self, cdk_property_name: str) -> strpublic String cfnPropertyName(String cdkPropertyName)public string CfnPropertyName(string cdkPropertyName)func CfnPropertyName(CdkPropertyName *string) *string#
fromClusterArn(scope: Construct, id: string, arn: string): IClusterRef@staticmethod def from_cluster_arn(scope: Construct, id: str, arn: str) -> IClusterRefpublic static IClusterRef fromClusterArn(Construct scope, String id, String arn)public static IClusterRef FromClusterArn(Construct scope, string id, string arn)func FromClusterArn(Scope Construct, Id *string, Arn *string) IClusterRefstatic#
Creates a new IClusterRef from an ARN.
fromClusterName(scope: Construct, id: string, clusterName: string): IClusterRef@staticmethod def from_cluster_name(scope: Construct, id: str, cluster_name: str) -> IClusterRefpublic static IClusterRef fromClusterName(Construct scope, String id, String clusterName)public static IClusterRef FromClusterName(Construct scope, string id, string clusterName)func FromClusterName(Scope Construct, Id *string, ClusterName *string) IClusterRefstatic#
Creates a new IClusterRef from a clusterName.
getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Referencedef get_att(self, attribute_name: str, type_hint: typing.Optional[ResolutionTypeHint] = None) -> Referencepublic Reference getAtt(String attributeName, ResolutionTypeHint typeHint)public Reference GetAtt(string attributeName, ResolutionTypeHint? typeHint = null)func GetAtt(AttributeName *string, TypeHint ResolutionTypeHint) Reference#
Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

1 parameter

Parameters

  • attributeNameattribute_nameattributeNameattributeNameAttributeName — The name of the attribute.
getMetadata(key: string): anydef get_metadata(self, key: str) -> Anypublic Object getMetadata(String key)public object GetMetadata(string key)func GetMetadata(Key *string) interface{}#
Retrieve a value value from the CloudFormation Resource Metadata.
inspect(inspector: TreeInspector): voiddef inspect(self, inspector: TreeInspector) -> Nonepublic void inspect(TreeInspector inspector)public void Inspect(TreeInspector inspector)func Inspect(Inspector TreeInspector)#
Examines the CloudFormation resource and discloses attributes.
1 parameter

Parameters

  • inspectorinspectorinspectorinspectorInspector — tree inspector to collect and process attributes.
isCfnCluster(x: any): boolean@staticmethod def is_cfn_cluster(x: Any) -> boolpublic static Boolean isCfnCluster(Object x)public static bool IsCfnCluster(object x)func IsCfnCluster(X interface{}) *boolstatic#
Checks whether the given object is a CfnCluster.
isCfnElement(x: any): boolean@staticmethod def is_cfn_element(x: Any) -> boolpublic static Boolean isCfnElement(Object x)public static bool IsCfnElement(object x)func IsCfnElement(X interface{}) *boolstatic#
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

returns

Returns: The construct as a stack element or undefined if it is not a stack element.

isCfnResource(x: any): boolean@staticmethod def is_cfn_resource(x: Any) -> boolpublic static Boolean isCfnResource(Object x)public static bool IsCfnResource(object x)func IsCfnResource(X interface{}) *boolstatic#
Check whether the given object is a CfnResource.
isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

obtainDependencies(): Stack | CfnResource[]def obtain_dependencies(self, ) -> typing.List[typing.Union[Stack, CfnResource]]public List<Stack> obtainDependencies()public Stack[] ObtainDependencies()func ObtainDependencies() *[]interface{}#
Retrieves an array of resources and stacks this resource depends on.

For resources depended on directly, returns the CfnResource object. For dependencies on other stacks, returns the Stack object. The order of the array is not guaranteed.

overrideLogicalId(newLogicalId: string): voiddef override_logical_id(self, new_logical_id: str) -> Nonepublic void overrideLogicalId(String newLogicalId)public void OverrideLogicalId(string newLogicalId)func OverrideLogicalId(NewLogicalId *string)#
Overrides the auto-generated logical ID with a specific ID.
1 parameter

Parameters

  • newLogicalIdnew_logical_idnewLogicalIdnewLogicalIdNewLogicalId — The new logical ID to use for this stack element.
removeDependency(target: CfnResource): voiddef remove_dependency(self, target: CfnResource) -> Nonepublic void removeDependency(CfnResource target)public void RemoveDependency(CfnResource target)func RemoveDependency(Target CfnResource)deprecated#
Use `removeResourceDependency` instead

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

removeResourceDependency(target: CfnResource): voiddef remove_resource_dependency(self, target: CfnResource) -> Nonepublic void removeResourceDependency(CfnResource target)public void RemoveResourceDependency(CfnResource target)func RemoveResourceDependency(Target CfnResource)#
Indicates that this resource no longer depends on another resource.

This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.

replaceDependency(target: CfnResource, newTarget: CfnResource): voiddef replace_dependency(self, target: CfnResource, new_target: CfnResource) -> Nonepublic void replaceDependency(CfnResource target, CfnResource newTarget)public void ReplaceDependency(CfnResource target, CfnResource newTarget)func ReplaceDependency(Target CfnResource, NewTarget CfnResource)#
Replaces one dependency with another.
2 parameters

Parameters

  • targettargettargettargetTarget — The dependency to replace.
  • newTargetnew_targetnewTargetnewTargetNewTarget — The new dependency to add.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
returns

Returns: a string representation of this resource

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) 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.