CfnClusterPropsMixin
- class aws_cdk.mixins_preview.aws_ecs.mixins.CfnClusterPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::ECS::Clusterresource creates an Amazon Elastic Container Service (Amazon ECS) cluster.- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html
- CloudformationResource:
AWS::ECS::Cluster
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins cfn_cluster_props_mixin = ecs_mixins.CfnClusterPropsMixin(ecs_mixins.CfnClusterMixinProps( capacity_providers=["capacityProviders"], cluster_name="clusterName", cluster_settings=[ecs_mixins.CfnClusterPropsMixin.ClusterSettingsProperty( name="name", value="value" )], configuration=ecs_mixins.CfnClusterPropsMixin.ClusterConfigurationProperty( execute_command_configuration=ecs_mixins.CfnClusterPropsMixin.ExecuteCommandConfigurationProperty( kms_key_id="kmsKeyId", log_configuration=ecs_mixins.CfnClusterPropsMixin.ExecuteCommandLogConfigurationProperty( cloud_watch_encryption_enabled=False, cloud_watch_log_group_name="cloudWatchLogGroupName", s3_bucket_name="s3BucketName", s3_encryption_enabled=False, s3_key_prefix="s3KeyPrefix" ), logging="logging" ), managed_storage_configuration=ecs_mixins.CfnClusterPropsMixin.ManagedStorageConfigurationProperty( fargate_ephemeral_storage_kms_key_id="fargateEphemeralStorageKmsKeyId", kms_key_id="kmsKeyId" ) ), default_capacity_provider_strategy=[ecs_mixins.CfnClusterPropsMixin.CapacityProviderStrategyItemProperty( base=123, capacity_provider="capacityProvider", weight=123 )], service_connect_defaults=ecs_mixins.CfnClusterPropsMixin.ServiceConnectDefaultsProperty( namespace="namespace" ), tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ECS::Cluster.- Parameters:
props (
Union[CfnClusterMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['capacityProviders', 'clusterName', 'clusterSettings', 'configuration', 'defaultCapacityProviderStrategy', 'serviceConnectDefaults', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
CapacityProviderStrategyItemProperty
- class CfnClusterPropsMixin.CapacityProviderStrategyItemProperty(*, base=None, capacity_provider=None, weight=None)
Bases:
objectThe
CapacityProviderStrategyItemproperty specifies the details of the default capacity provider strategy for the cluster.When services or tasks are run in the cluster with no launch type or capacity provider strategy specified, the default capacity provider strategy is used.
- Parameters:
base (
Union[int,float,None]) – The base value designates how many tasks, at a minimum, to run on the specified capacity provider for each service. Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of0is used. Base value characteristics: - Only one capacity provider in a strategy can have a base defined - The default value is0if not specified - The valid range is 0 to 100,000 - Base requirements are satisfied first before weight distributioncapacity_provider (
Optional[str]) – The short name of the capacity provider. This can be either an AWS managed capacity provider (FARGATEorFARGATE_SPOT) or the name of a custom capacity provider that you created.weight (
Union[int,float,None]) – The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider. Theweightvalue is taken into consideration after thebasevalue, if defined, is satisfied. If noweightvalue is specified, the default value of0is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of0can’t be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of0, anyRunTaskorCreateServiceactions using the capacity provider strategy will fail. Weight value characteristics: - Weight is considered after the base value is satisfied - The default value is0if not specified - The valid range is 0 to 1,000 - At least one capacity provider must have a weight greater than zero - Capacity providers with weight of0cannot place tasks Task distribution logic: - Base satisfaction: The minimum number of tasks specified by the base value are placed on that capacity provider - Weight distribution: After base requirements are met, additional tasks are distributed according to weight ratios Examples: Equal Distribution: Two capacity providers both with weight1will split tasks evenly after base requirements are met. Weighted Distribution: If capacityProviderA has weight1and capacityProviderB has weight4, then for every 1 task on A, 4 tasks will run on B.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins capacity_provider_strategy_item_property = ecs_mixins.CfnClusterPropsMixin.CapacityProviderStrategyItemProperty( base=123, capacity_provider="capacityProvider", weight=123 )
Attributes
- base
The base value designates how many tasks, at a minimum, to run on the specified capacity provider for each service.
Only one capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default value of
0is used.Base value characteristics:
Only one capacity provider in a strategy can have a base defined
The default value is
0if not specifiedThe valid range is 0 to 100,000
Base requirements are satisfied first before weight distribution
- capacity_provider
The short name of the capacity provider.
This can be either an AWS managed capacity provider (
FARGATEorFARGATE_SPOT) or the name of a custom capacity provider that you created.
- weight
The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.
The
weightvalue is taken into consideration after thebasevalue, if defined, is satisfied.If no
weightvalue is specified, the default value of0is used. When multiple capacity providers are specified within a capacity provider strategy, at least one of the capacity providers must have a weight value greater than zero and any capacity providers with a weight of0can’t be used to place tasks. If you specify multiple capacity providers in a strategy that all have a weight of0, anyRunTaskorCreateServiceactions using the capacity provider strategy will fail.Weight value characteristics:
Weight is considered after the base value is satisfied
The default value is
0if not specifiedThe valid range is 0 to 1,000
At least one capacity provider must have a weight greater than zero
Capacity providers with weight of
0cannot place tasks
Task distribution logic:
Base satisfaction: The minimum number of tasks specified by the base value are placed on that capacity provider
Weight distribution: After base requirements are met, additional tasks are distributed according to weight ratios
Examples:
Equal Distribution: Two capacity providers both with weight
1will split tasks evenly after base requirements are met.Weighted Distribution: If capacityProviderA has weight
1and capacityProviderB has weight4, then for every 1 task on A, 4 tasks will run on B.
ClusterConfigurationProperty
- class CfnClusterPropsMixin.ClusterConfigurationProperty(*, execute_command_configuration=None, managed_storage_configuration=None)
Bases:
objectThe execute command and managed storage configuration for the cluster.
- Parameters:
execute_command_configuration (
Union[IResolvable,ExecuteCommandConfigurationProperty,Dict[str,Any],None]) – The details of the execute command configuration.managed_storage_configuration (
Union[IResolvable,ManagedStorageConfigurationProperty,Dict[str,Any],None]) – The details of the managed storage configuration.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins cluster_configuration_property = ecs_mixins.CfnClusterPropsMixin.ClusterConfigurationProperty( execute_command_configuration=ecs_mixins.CfnClusterPropsMixin.ExecuteCommandConfigurationProperty( kms_key_id="kmsKeyId", log_configuration=ecs_mixins.CfnClusterPropsMixin.ExecuteCommandLogConfigurationProperty( cloud_watch_encryption_enabled=False, cloud_watch_log_group_name="cloudWatchLogGroupName", s3_bucket_name="s3BucketName", s3_encryption_enabled=False, s3_key_prefix="s3KeyPrefix" ), logging="logging" ), managed_storage_configuration=ecs_mixins.CfnClusterPropsMixin.ManagedStorageConfigurationProperty( fargate_ephemeral_storage_kms_key_id="fargateEphemeralStorageKmsKeyId", kms_key_id="kmsKeyId" ) )
Attributes
- execute_command_configuration
The details of the execute command configuration.
- managed_storage_configuration
The details of the managed storage configuration.
ClusterSettingsProperty
- class CfnClusterPropsMixin.ClusterSettingsProperty(*, name=None, value=None)
Bases:
objectThe settings to use when creating a cluster.
This parameter is used to turn on CloudWatch Container Insights with enhanced observability or CloudWatch Container Insights for a cluster.
Container Insights with enhanced observability provides all the Container Insights metrics, plus additional task and container metrics. This version supports enhanced observability for Amazon ECS clusters using the Amazon EC2 and Fargate launch types. After you configure Container Insights with enhanced observability on Amazon ECS, Container Insights auto-collects detailed infrastructure telemetry from the cluster level down to the container level in your environment and displays these critical performance data in curated dashboards removing the heavy lifting in observability set-up.
For more information, see Monitor Amazon ECS containers using Container Insights with enhanced observability in the Amazon Elastic Container Service Developer Guide .
- Parameters:
name (
Optional[str]) – The name of the cluster setting. The value iscontainerInsights.value (
Optional[str]) – The value to set for the cluster setting. The supported values areenhanced,enabled, anddisabled. To use Container Insights with enhanced observability, set thecontainerInsightsaccount setting toenhanced. To use Container Insights, set thecontainerInsightsaccount setting toenabled. If a cluster value is specified, it will override thecontainerInsightsvalue set with PutAccountSetting or PutAccountSettingDefault .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins cluster_settings_property = ecs_mixins.CfnClusterPropsMixin.ClusterSettingsProperty( name="name", value="value" )
Attributes
- name
The name of the cluster setting.
The value is
containerInsights.
- value
The value to set for the cluster setting. The supported values are
enhanced,enabled, anddisabled.To use Container Insights with enhanced observability, set the
containerInsightsaccount setting toenhanced.To use Container Insights, set the
containerInsightsaccount setting toenabled.If a cluster value is specified, it will override the
containerInsightsvalue set with PutAccountSetting or PutAccountSettingDefault .
ExecuteCommandConfigurationProperty
- class CfnClusterPropsMixin.ExecuteCommandConfigurationProperty(*, kms_key_id=None, log_configuration=None, logging=None)
Bases:
objectThe details of the execute command configuration.
- Parameters:
kms_key_id (
Optional[str]) – Specify an AWS Key Management Service key ID to encrypt the data between the local client and the container.log_configuration (
Union[IResolvable,ExecuteCommandLogConfigurationProperty,Dict[str,Any],None]) – The log configuration for the results of the execute command actions. The logs can be sent to CloudWatch Logs or an Amazon S3 bucket. Whenlogging=OVERRIDEis specified, alogConfigurationmust be provided.logging (
Optional[str]) – The log setting to use for redirecting logs for your execute command results. The following log settings are available. -NONE: The execute command session is not logged. -DEFAULT: Theawslogsconfiguration in the task definition is used. If no logging parameter is specified, it defaults to this value. If noawslogslog driver is configured in the task definition, the output won’t be logged. -OVERRIDE: Specify the logging details as a part oflogConfiguration. If theOVERRIDElogging option is specified, thelogConfigurationis required.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins execute_command_configuration_property = ecs_mixins.CfnClusterPropsMixin.ExecuteCommandConfigurationProperty( kms_key_id="kmsKeyId", log_configuration=ecs_mixins.CfnClusterPropsMixin.ExecuteCommandLogConfigurationProperty( cloud_watch_encryption_enabled=False, cloud_watch_log_group_name="cloudWatchLogGroupName", s3_bucket_name="s3BucketName", s3_encryption_enabled=False, s3_key_prefix="s3KeyPrefix" ), logging="logging" )
Attributes
- kms_key_id
Specify an AWS Key Management Service key ID to encrypt the data between the local client and the container.
- log_configuration
The log configuration for the results of the execute command actions.
The logs can be sent to CloudWatch Logs or an Amazon S3 bucket. When
logging=OVERRIDEis specified, alogConfigurationmust be provided.
- logging
The log setting to use for redirecting logs for your execute command results. The following log settings are available.
NONE: The execute command session is not logged.DEFAULT: Theawslogsconfiguration in the task definition is used. If no logging parameter is specified, it defaults to this value. If noawslogslog driver is configured in the task definition, the output won’t be logged.OVERRIDE: Specify the logging details as a part oflogConfiguration. If theOVERRIDElogging option is specified, thelogConfigurationis required.
ExecuteCommandLogConfigurationProperty
- class CfnClusterPropsMixin.ExecuteCommandLogConfigurationProperty(*, cloud_watch_encryption_enabled=None, cloud_watch_log_group_name=None, s3_bucket_name=None, s3_encryption_enabled=None, s3_key_prefix=None)
Bases:
objectThe log configuration for the results of the execute command actions.
The logs can be sent to CloudWatch Logs or an Amazon S3 bucket.
- Parameters:
cloud_watch_encryption_enabled (
Union[bool,IResolvable,None]) – Determines whether to use encryption on the CloudWatch logs. If not specified, encryption will be off.cloud_watch_log_group_name (
Optional[str]) – The name of the CloudWatch log group to send logs to. .. epigraph:: The CloudWatch log group must already be created.s3_bucket_name (
Optional[str]) – The name of the S3 bucket to send logs to. .. epigraph:: The S3 bucket must already be created.s3_encryption_enabled (
Union[bool,IResolvable,None]) – Determines whether to use encryption on the S3 logs. If not specified, encryption is not used.s3_key_prefix (
Optional[str]) – An optional folder in the S3 bucket to place logs in.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins execute_command_log_configuration_property = ecs_mixins.CfnClusterPropsMixin.ExecuteCommandLogConfigurationProperty( cloud_watch_encryption_enabled=False, cloud_watch_log_group_name="cloudWatchLogGroupName", s3_bucket_name="s3BucketName", s3_encryption_enabled=False, s3_key_prefix="s3KeyPrefix" )
Attributes
- cloud_watch_encryption_enabled
Determines whether to use encryption on the CloudWatch logs.
If not specified, encryption will be off.
- cloud_watch_log_group_name
The name of the CloudWatch log group to send logs to.
The CloudWatch log group must already be created.
- s3_bucket_name
The name of the S3 bucket to send logs to.
The S3 bucket must already be created.
- s3_encryption_enabled
Determines whether to use encryption on the S3 logs.
If not specified, encryption is not used.
- s3_key_prefix
An optional folder in the S3 bucket to place logs in.
ManagedStorageConfigurationProperty
- class CfnClusterPropsMixin.ManagedStorageConfigurationProperty(*, fargate_ephemeral_storage_kms_key_id=None, kms_key_id=None)
Bases:
objectThe managed storage configuration for the cluster.
- Parameters:
fargate_ephemeral_storage_kms_key_id (
Optional[str]) – Specify the AWS Key Management Service key ID for Fargate ephemeral storage. When you specify afargateEphemeralStorageKmsKeyId, AWS Fargate uses the key to encrypt data at rest in ephemeral storage. For more information about Fargate ephemeral storage encryption, see Customer managed keys for AWS Fargate ephemeral storage for Amazon ECS in the Amazon Elastic Container Service Developer Guide . The key must be a single Region key.kms_key_id (
Optional[str]) – Specify a AWS Key Management Service key ID to encrypt Amazon ECS managed storage. When you specify akmsKeyId, Amazon ECS uses the key to encrypt data volumes managed by Amazon ECS that are attached to tasks in the cluster. The following data volumes are managed by Amazon ECS: Amazon EBS. For more information about encryption of Amazon EBS volumes attached to Amazon ECS tasks, see Encrypt data stored in Amazon EBS volumes for Amazon ECS in the Amazon Elastic Container Service Developer Guide . The key must be a single Region key.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins managed_storage_configuration_property = ecs_mixins.CfnClusterPropsMixin.ManagedStorageConfigurationProperty( fargate_ephemeral_storage_kms_key_id="fargateEphemeralStorageKmsKeyId", kms_key_id="kmsKeyId" )
Attributes
- fargate_ephemeral_storage_kms_key_id
Specify the AWS Key Management Service key ID for Fargate ephemeral storage.
When you specify a
fargateEphemeralStorageKmsKeyId, AWS Fargate uses the key to encrypt data at rest in ephemeral storage. For more information about Fargate ephemeral storage encryption, see Customer managed keys for AWS Fargate ephemeral storage for Amazon ECS in the Amazon Elastic Container Service Developer Guide .The key must be a single Region key.
- kms_key_id
Specify a AWS Key Management Service key ID to encrypt Amazon ECS managed storage.
When you specify a
kmsKeyId, Amazon ECS uses the key to encrypt data volumes managed by Amazon ECS that are attached to tasks in the cluster. The following data volumes are managed by Amazon ECS: Amazon EBS. For more information about encryption of Amazon EBS volumes attached to Amazon ECS tasks, see Encrypt data stored in Amazon EBS volumes for Amazon ECS in the Amazon Elastic Container Service Developer Guide .The key must be a single Region key.
ServiceConnectDefaultsProperty
- class CfnClusterPropsMixin.ServiceConnectDefaultsProperty(*, namespace=None)
Bases:
objectUse this parameter to set a default Service Connect namespace.
After you set a default Service Connect namespace, any new services with Service Connect turned on that are created in the cluster are added as client services in the namespace. This setting only applies to new services that set the
enabledparameter totruein theServiceConnectConfiguration. You can set the namespace of each service individually in theServiceConnectConfigurationto override this default parameter.Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide .
- Parameters:
namespace (
Optional[str]) – The namespace name or full Amazon Resource Name (ARN) of the AWS Cloud Map namespace that’s used when you create a service and don’t specify a Service Connect configuration. The namespace name can include up to 1024 characters. The name is case-sensitive. The name can’t include greater than (>), less than (<), double quotation marks (“), or slash (/). If you enter an existing namespace name or ARN, then that namespace will be used. Any namespace type is supported. The namespace must be in this account and this AWS Region. If you enter a new name, a AWS Cloud Map namespace will be created. Amazon ECS creates a AWS Cloud Map namespace with the “API calls” method of instance discovery only. This instance discovery method is the “HTTP” namespace type in the AWS Command Line Interface . Other types of instance discovery aren’t used by Service Connect. If you update the cluster with an empty string""for the namespace name, the cluster configuration for Service Connect is removed. Note that the namespace will remain in AWS Cloud Map and must be deleted separately. For more information about AWS Cloud Map , see Working with Services in the AWS Cloud Map Developer Guide .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_ecs import mixins as ecs_mixins service_connect_defaults_property = ecs_mixins.CfnClusterPropsMixin.ServiceConnectDefaultsProperty( namespace="namespace" )
Attributes
- namespace
The namespace name or full Amazon Resource Name (ARN) of the AWS Cloud Map namespace that’s used when you create a service and don’t specify a Service Connect configuration.
The namespace name can include up to 1024 characters. The name is case-sensitive. The name can’t include greater than (>), less than (<), double quotation marks (“), or slash (/).
If you enter an existing namespace name or ARN, then that namespace will be used. Any namespace type is supported. The namespace must be in this account and this AWS Region.
If you enter a new name, a AWS Cloud Map namespace will be created. Amazon ECS creates a AWS Cloud Map namespace with the “API calls” method of instance discovery only. This instance discovery method is the “HTTP” namespace type in the AWS Command Line Interface . Other types of instance discovery aren’t used by Service Connect.
If you update the cluster with an empty string
""for the namespace name, the cluster configuration for Service Connect is removed. Note that the namespace will remain in AWS Cloud Map and must be deleted separately.For more information about AWS Cloud Map , see Working with Services in the AWS Cloud Map Developer Guide .