aws-cdk-lib.aws_ecs.ClusterAttributes

interface ClusterAttributes

LanguageType name
.NETAmazon.CDK.AWS.ECS.ClusterAttributes
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#ClusterAttributes
Javasoftware.amazon.awscdk.services.ecs.ClusterAttributes
Pythonaws_cdk.aws_ecs.ClusterAttributes
TypeScript (source)aws-cdk-lib » aws_ecs » ClusterAttributes

The properties to import from the ECS cluster.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_kms as kms } from 'aws-cdk-lib';
import { aws_logs as logs } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';
import { aws_servicediscovery as servicediscovery } from 'aws-cdk-lib';

declare const autoScalingGroup: autoscaling.AutoScalingGroup;
declare const bucket: s3.Bucket;
declare const key: kms.Key;
declare const logGroup: logs.LogGroup;
declare const namespace: servicediscovery.INamespace;
declare const securityGroup: ec2.SecurityGroup;
declare const vpc: ec2.Vpc;
const clusterAttributes: ecs.ClusterAttributes = {
  clusterName: 'clusterName',
  vpc: vpc,

  // the properties below are optional
  autoscalingGroup: autoScalingGroup,
  clusterArn: 'clusterArn',
  defaultCloudMapNamespace: namespace,
  executeCommandConfiguration: {
    kmsKey: key,
    logConfiguration: {
      cloudWatchEncryptionEnabled: false,
      cloudWatchLogGroup: logGroup,
      s3Bucket: bucket,
      s3EncryptionEnabled: false,
      s3KeyPrefix: 's3KeyPrefix',
    },
    logging: ecs.ExecuteCommandLogging.NONE,
  },
  hasEc2Capacity: false,
  securityGroups: [securityGroup],
};

Properties

NameTypeDescription
clusterNamestringThe name of the cluster.
vpcIVpcThe VPC associated with the cluster.
autoscalingGroup?IAutoScalingGroupAutoscaling group added to the cluster if capacity is added.
clusterArn?stringThe Amazon Resource Name (ARN) that identifies the cluster.
defaultCloudMapNamespace?INamespaceThe AWS Cloud Map namespace to associate with the cluster.
executeCommandConfiguration?ExecuteCommandConfigurationThe execute command configuration for the cluster.
hasEc2Capacity?booleanSpecifies whether the cluster has EC2 instance capacity.
securityGroups?ISecurityGroup[]The security groups associated with the container instances registered to the cluster.

clusterName

Type: string

The name of the cluster.


vpc

Type: IVpc

The VPC associated with the cluster.


autoscalingGroup?

Type: IAutoScalingGroup (optional, default: No default autoscaling group)

Autoscaling group added to the cluster if capacity is added.


clusterArn?

Type: string (optional, default: Derived from clusterName)

The Amazon Resource Name (ARN) that identifies the cluster.


defaultCloudMapNamespace?

Type: INamespace (optional, default: No default namespace)

The AWS Cloud Map namespace to associate with the cluster.


executeCommandConfiguration?

Type: ExecuteCommandConfiguration (optional, default: none.)

The execute command configuration for the cluster.


hasEc2Capacity?

Type: boolean (optional, default: true)

Specifies whether the cluster has EC2 instance capacity.


securityGroups?

Type: ISecurityGroup[] (optional, default: no security groups)

The security groups associated with the container instances registered to the cluster.