ClusterAttributes

class aws_cdk.aws_ecs.ClusterAttributes(*, cluster_name, security_groups, vpc, autoscaling_group=None, cluster_arn=None, default_cloud_map_namespace=None, execute_command_configuration=None, has_ec2_capacity=None)

Bases: object

The properties to import from the ECS cluster.

Parameters
  • cluster_name (str) – The name of the cluster.

  • security_groups (Sequence[ISecurityGroup]) – The security groups associated with the container instances registered to the cluster.

  • vpc (IVpc) – The VPC associated with the cluster.

  • autoscaling_group (Optional[IAutoScalingGroup]) – Autoscaling group added to the cluster if capacity is added. Default: - No default autoscaling group

  • cluster_arn (Optional[str]) – The Amazon Resource Name (ARN) that identifies the cluster. Default: Derived from clusterName

  • default_cloud_map_namespace (Optional[INamespace]) – The AWS Cloud Map namespace to associate with the cluster. Default: - No default namespace

  • execute_command_configuration (Optional[ExecuteCommandConfiguration]) – The execute command configuration for the cluster. Default: - none.

  • has_ec2_capacity (Optional[bool]) – Specifies whether the cluster has EC2 instance capacity. Default: true

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_ecs as ecs
import aws_cdk.aws_kms as kms
import aws_cdk.aws_logs as logs
import aws_cdk.aws_s3 as s3
import aws_cdk.aws_servicediscovery as servicediscovery

# auto_scaling_group is of type AutoScalingGroup
# bucket is of type Bucket
# key is of type Key
# log_group is of type LogGroup
# namespace is of type INamespace
# security_group is of type SecurityGroup
# vpc is of type Vpc

cluster_attributes = ecs.ClusterAttributes(
    cluster_name="clusterName",
    security_groups=[security_group],
    vpc=vpc,

    # the properties below are optional
    autoscaling_group=auto_scaling_group,
    cluster_arn="clusterArn",
    default_cloud_map_namespace=namespace,
    execute_command_configuration=ecs.ExecuteCommandConfiguration(
        kms_key=key,
        log_configuration=ecs.ExecuteCommandLogConfiguration(
            cloud_watch_encryption_enabled=False,
            cloud_watch_log_group=log_group,
            s3_bucket=bucket,
            s3_encryption_enabled=False,
            s3_key_prefix="s3KeyPrefix"
        ),
        logging=ecs.ExecuteCommandLogging.NONE
    ),
    has_ec2_capacity=False
)

Attributes

autoscaling_group

Autoscaling group added to the cluster if capacity is added.

Default
  • No default autoscaling group

Return type

Optional[IAutoScalingGroup]

cluster_arn

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

Default

Derived from clusterName

Return type

Optional[str]

cluster_name

The name of the cluster.

Return type

str

default_cloud_map_namespace

The AWS Cloud Map namespace to associate with the cluster.

Default
  • No default namespace

Return type

Optional[INamespace]

execute_command_configuration

The execute command configuration for the cluster.

Default
  • none.

Return type

Optional[ExecuteCommandConfiguration]

has_ec2_capacity

Specifies whether the cluster has EC2 instance capacity.

Default

true

Return type

Optional[bool]

security_groups

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

Return type

List[ISecurityGroup]

vpc

The VPC associated with the cluster.

Return type

IVpc