Skip to content

AWS::ECS::Cluster

The AWS::ECS::Cluster resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.

Generated by cfn-typegen --out cfn_types AWS::ECS::Cluster into cfn_types/ecs.py:

# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::ECS resources."""

from collections.abc import Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, Tag, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr


CONSTRAINTS:dict[str,Any]={
}


ATTRIBUTES:dict[str,Any]={"AWS::ECS::Cluster":["Arn","ClusterName"]}


RULES:dict[str,Any]={}
Nested types (10)

These are defined above the properties in the generated module.

class ClusterClusterSettings(TypedDict, closed=True):
    'The settings to use when creating a cluster.'
    Value: NotRequired[Expr[str]]
    'The value to set for the cluster setting.'
    Name: NotRequired[Expr[str]]
    'The name of the cluster setting.'


class ClusterCapacityProviderStrategyItem(TypedDict, closed=True):
    'The ``CapacityProviderStrategyItem`` property specifies the details of the default capacity provider strategy for the cluster.'
    CapacityProvider: NotRequired[Expr[str]]
    'The short name of the capacity provider.'
    Weight: NotRequired[Expr[int]]
    'The *weight* value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.'
    Base: NotRequired[Expr[int]]
    'The *base* value designates how many tasks, at a minimum, to run on the specified capacity provider for each service.'


class ClusterManagedStorageConfiguration(TypedDict, closed=True):
    'The managed storage configuration for the cluster.'
    FargateEphemeralStorageKmsKeyId: NotRequired[Expr[str]]
    'Specify the KMSlong key ID for Fargate ephemeral storage.'
    KmsKeyId: NotRequired[Expr[str]]
    'Specify a KMSlong key ID to encrypt Amazon ECS managed storage.'


class ClusterExecuteCommandLogConfiguration(TypedDict, closed=True):
    'The log configuration for the results of the execute command actions.'
    S3EncryptionEnabled: NotRequired[Expr[bool]]
    'Determines whether to use encryption on the S3 logs.'
    CloudWatchEncryptionEnabled: NotRequired[Expr[bool]]
    'Determines whether to use encryption on the CloudWatch logs.'
    CloudWatchLogGroupName: NotRequired[Expr[str]]
    'The name of the CloudWatch log group to send logs to.'
    S3KeyPrefix: NotRequired[Expr[str]]
    'An optional folder in the S3 bucket to place logs in.'
    S3BucketName: NotRequired[Expr[str]]
    'The name of the S3 bucket to send logs to.'


class ClusterExecuteCommandConfiguration(TypedDict, closed=True):
    'The details of the execute command configuration.'
    Logging: NotRequired[Expr[str]]
    'The log setting to use for redirecting logs for your execute command results.'
    KmsKeyId: NotRequired[Expr[str]]
    'Specify an KMSlong key ID to encrypt the data between the local client and the container.'
    LogConfiguration: NotRequired[Expr[ClusterExecuteCommandLogConfiguration]]
    'The log configuration for the results of the execute command actions.'


class ClusterClusterConfiguration(TypedDict, closed=True):
    'The execute command and managed storage configuration for the cluster.'
    ManagedStorageConfiguration: NotRequired[Expr[ClusterManagedStorageConfiguration]]
    'The details of the managed storage configuration.'
    ExecuteCommandConfiguration: NotRequired[Expr[ClusterExecuteCommandConfiguration]]
    'The details of the execute command configuration.'


class ClusterServiceConnectDefaults(TypedDict, closed=True):
    'Use this parameter to set a default Service Connect namespace.'
    Namespace: NotRequired[Expr[str]]
    "The namespace name or full Amazon Resource Name (ARN) of the CMAPlong namespace that's used when you create a service and don't specify a Service Connect con..."


class ClusterProps(TypedDict, closed=True):
    'The ``AWS::ECS::Cluster`` resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.'
    ClusterSettings: NotRequired[Expr[Sequence[Expr[ClusterClusterSettings]]]]
    'The settings to use when creating a cluster.'
    DefaultCapacityProviderStrategy: NotRequired[Expr[Sequence[Expr[ClusterCapacityProviderStrategyItem]]]]
    'The default capacity provider strategy for the cluster.'
    Configuration: NotRequired[Expr[ClusterClusterConfiguration]]
    'The execute command and managed storage configuration for the cluster.'
    ServiceConnectDefaults: NotRequired[Expr[ClusterServiceConnectDefaults]]
    'Use this parameter to set a default Service Connect namespace.'
    CapacityProviders: NotRequired[Expr[list[Expr[str]]]]
    'The short name of one or more capacity providers to associate with the cluster.'
    ClusterName: NotRequired[Expr[str]]
    'A user-generated string that you use to identify your cluster.'
    Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
    'The metadata that you apply to the cluster to help you categorize and organize them.'


class Cluster(ResourceAttrs):
    'The ``AWS::ECS::Cluster`` resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.'
    Type: Literal['AWS::ECS::Cluster']
    Properties: NotRequired[ClusterProps]


def cluster(
    *,
    depends_on: DependsOn | None = None,
    deletion_policy: DeletionPolicy | None = None,
    update_replace_policy: UpdateReplacePolicy | None = None,
    condition: str | None = None,
    metadata: dict[str, Any] | None = None,
    **props: Unpack[ClusterProps],
) -> Cluster:
    return build('AWS::ECS::Cluster', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)

Attributes

Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.

  • Arn