CfnExpressGatewayServicePropsMixin
- class aws_cdk.mixins_preview.aws_ecs.mixins.CfnExpressGatewayServicePropsMixin(props, *, strategy=None)
Bases:
MixinCreates an Express service that simplifies deploying containerized web applications on Amazon ECS with managed AWS infrastructure.
This operation provisions and configures Application Load Balancers, target groups, security groups, and auto-scaling policies automatically.
Specify a primary container configuration with your application image and basic settings. Amazon ECS creates the necessary AWS resources for traffic distribution, health monitoring, network access control, and capacity management.
Provide an execution role for task operations and an infrastructure role for managing AWS resources on your behalf.
- See:
- CloudformationResource:
AWS::ECS::ExpressGatewayService
- 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_express_gateway_service_props_mixin = ecs_mixins.CfnExpressGatewayServicePropsMixin(ecs_mixins.CfnExpressGatewayServiceMixinProps( cluster="cluster", cpu="cpu", execution_role_arn="executionRoleArn", health_check_path="healthCheckPath", infrastructure_role_arn="infrastructureRoleArn", memory="memory", network_configuration=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceNetworkConfigurationProperty( security_groups=["securityGroups"], subnets=["subnets"] ), primary_container=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayContainerProperty( aws_logs_configuration=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceAwsLogsConfigurationProperty( log_group="logGroup", log_stream_prefix="logStreamPrefix" ), command=["command"], container_port=123, environment=[ecs_mixins.CfnExpressGatewayServicePropsMixin.KeyValuePairProperty( name="name", value="value" )], image="image", repository_credentials=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayRepositoryCredentialsProperty( credentials_parameter="credentialsParameter" ), secrets=[ecs_mixins.CfnExpressGatewayServicePropsMixin.SecretProperty( name="name", value_from="valueFrom" )] ), scaling_target=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayScalingTargetProperty( auto_scaling_metric="autoScalingMetric", auto_scaling_target_value=123, max_task_count=123, min_task_count=123 ), service_name="serviceName", tags=[CfnTag( key="key", value="value" )], task_role_arn="taskRoleArn" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ECS::ExpressGatewayService.- Parameters:
props (
Union[CfnExpressGatewayServiceMixinProps,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 = ['cluster', 'cpu', 'executionRoleArn', 'healthCheckPath', 'infrastructureRoleArn', 'memory', 'networkConfiguration', 'primaryContainer', 'scalingTarget', 'serviceName', 'tags', 'taskRoleArn']
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
ExpressGatewayContainerProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayContainerProperty(*, aws_logs_configuration=None, command=None, container_port=None, environment=None, image=None, repository_credentials=None, secrets=None)
Bases:
objectDefines the configuration for the primary container in an Express service.
This container receives traffic from the Application Load Balancer and runs your application code.
The container configuration includes the container image, port mapping, logging settings, environment variables, and secrets. The container image is the only required parameter, with sensible defaults provided for other settings.
- Parameters:
aws_logs_configuration (
Union[IResolvable,ExpressGatewayServiceAwsLogsConfigurationProperty,Dict[str,Any],None]) – The log configuration for the container.command (
Optional[Sequence[str]]) – The command that is passed to the container.container_port (
Union[int,float,None]) – The port number on the container that receives traffic from the load balancer. Default is 80. Default: - 80environment (
Union[IResolvable,Sequence[Union[IResolvable,KeyValuePairProperty,Dict[str,Any]]],None]) – The environment variables to pass to the container.image (
Optional[str]) – The image used to start a container. This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with eitherrepository-url/image:tagorrepository-url/image@digest. For Express services, the image typically contains a web application that listens on the specified container port. The image can be stored in Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.repository_credentials (
Union[IResolvable,ExpressGatewayRepositoryCredentialsProperty,Dict[str,Any],None]) – The configuration for repository credentials for private registry authentication.secrets (
Union[IResolvable,Sequence[Union[IResolvable,SecretProperty,Dict[str,Any]]],None]) – The secrets to pass to the container.
- 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 express_gateway_container_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayContainerProperty( aws_logs_configuration=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceAwsLogsConfigurationProperty( log_group="logGroup", log_stream_prefix="logStreamPrefix" ), command=["command"], container_port=123, environment=[ecs_mixins.CfnExpressGatewayServicePropsMixin.KeyValuePairProperty( name="name", value="value" )], image="image", repository_credentials=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayRepositoryCredentialsProperty( credentials_parameter="credentialsParameter" ), secrets=[ecs_mixins.CfnExpressGatewayServicePropsMixin.SecretProperty( name="name", value_from="valueFrom" )] )
Attributes
- aws_logs_configuration
The log configuration for the container.
- command
The command that is passed to the container.
- container_port
The port number on the container that receives traffic from the load balancer.
Default is 80.
- environment
The environment variables to pass to the container.
- image
The image used to start a container.
This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either
repository-url/image:tagorrepository-url/image@digest.For Express services, the image typically contains a web application that listens on the specified container port. The image can be stored in Amazon ECR, Docker Hub, or any other container registry accessible to your execution role.
- repository_credentials
The configuration for repository credentials for private registry authentication.
- secrets
The secrets to pass to the container.
ExpressGatewayRepositoryCredentialsProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayRepositoryCredentialsProperty(*, credentials_parameter=None)
Bases:
objectThe repository credentials for private registry authentication to pass to the container.
- Parameters:
credentials_parameter (
Optional[str]) – The Amazon Resource Name (ARN) of the secret containing the private repository credentials.- 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 express_gateway_repository_credentials_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayRepositoryCredentialsProperty( credentials_parameter="credentialsParameter" )
Attributes
- credentials_parameter
The Amazon Resource Name (ARN) of the secret containing the private repository credentials.
ExpressGatewayScalingTargetProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayScalingTargetProperty(*, auto_scaling_metric=None, auto_scaling_target_value=None, max_task_count=None, min_task_count=None)
Bases:
objectDefines the auto-scaling configuration for an Express service.
This determines how the service automatically adjusts the number of running tasks based on demand metrics such as CPU utilization, memory utilization, or request count per target.
Auto-scaling helps ensure your application can handle varying levels of traffic while optimizing costs by scaling down during low-demand periods. You can specify the minimum and maximum number of tasks, the scaling metric, and the target value for that metric.
- Parameters:
auto_scaling_metric (
Optional[str]) – The metric used for auto-scaling decisions. The default metric used for an Express service isCPUUtilization. Default: - “AVERAGE_CPU”auto_scaling_target_value (
Union[int,float,None]) – The target value for the auto-scaling metric. The default value for an Express service is 60. Default: - 60max_task_count (
Union[int,float,None]) – The maximum number of tasks to run in the Express service. Default: - 1min_task_count (
Union[int,float,None]) – The minimum number of tasks to run in the Express service. Default: - 1
- 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 express_gateway_scaling_target_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayScalingTargetProperty( auto_scaling_metric="autoScalingMetric", auto_scaling_target_value=123, max_task_count=123, min_task_count=123 )
Attributes
- auto_scaling_metric
The metric used for auto-scaling decisions.
The default metric used for an Express service is
CPUUtilization.
- auto_scaling_target_value
The target value for the auto-scaling metric.
The default value for an Express service is 60.
- max_task_count
The maximum number of tasks to run in the Express service.
- min_task_count
The minimum number of tasks to run in the Express service.
ExpressGatewayServiceAwsLogsConfigurationProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceAwsLogsConfigurationProperty(*, log_group=None, log_stream_prefix=None)
Bases:
objectSpecifies the Amazon CloudWatch Logs configuration for the Express service container.
- Parameters:
log_group (
Optional[str]) – The name of the CloudWatch Logs log group to send container logs to.log_stream_prefix (
Optional[str]) – The prefix for the CloudWatch Logs log stream names. The default for an Express service isecs. Default: - “ecs”
- 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 express_gateway_service_aws_logs_configuration_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceAwsLogsConfigurationProperty( log_group="logGroup", log_stream_prefix="logStreamPrefix" )
Attributes
- log_group
The name of the CloudWatch Logs log group to send container logs to.
- log_stream_prefix
The prefix for the CloudWatch Logs log stream names.
The default for an Express service is
ecs.
ExpressGatewayServiceConfigurationProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceConfigurationProperty(*, cpu=None, created_at=None, execution_role_arn=None, health_check_path=None, ingress_paths=None, memory=None, network_configuration=None, primary_container=None, scaling_target=None, service_revision_arn=None, task_role_arn=None)
Bases:
objectRepresents a specific configuration revision of an Express service, containing all the settings and parameters for that revision.
- Parameters:
cpu (
Optional[str]) – The CPU allocation for tasks in this service revision.created_at (
Optional[str]) – The Unix timestamp for when this service revision was created.execution_role_arn (
Optional[str]) – The ARN of the task execution role for the service revision.health_check_path (
Optional[str]) – The health check path for this service revision.ingress_paths (
Union[IResolvable,Sequence[Union[IResolvable,IngressPathSummaryProperty,Dict[str,Any]]],None]) – The entry point into this service revision.memory (
Optional[str]) – The memory allocation for tasks in this service revision.network_configuration (
Union[IResolvable,ExpressGatewayServiceNetworkConfigurationProperty,Dict[str,Any],None]) – The network configuration for tasks in this service revision.primary_container (
Union[IResolvable,ExpressGatewayContainerProperty,Dict[str,Any],None]) – The primary container configuration for this service revision.scaling_target (
Union[IResolvable,ExpressGatewayScalingTargetProperty,Dict[str,Any],None]) – The auto-scaling configuration for this service revision.service_revision_arn (
Optional[str]) – The ARN of the service revision.task_role_arn (
Optional[str]) – The ARN of the task role for the service revision.
- 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 express_gateway_service_configuration_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceConfigurationProperty( cpu="cpu", created_at="createdAt", execution_role_arn="executionRoleArn", health_check_path="healthCheckPath", ingress_paths=[ecs_mixins.CfnExpressGatewayServicePropsMixin.IngressPathSummaryProperty( access_type="accessType", endpoint="endpoint" )], memory="memory", network_configuration=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceNetworkConfigurationProperty( security_groups=["securityGroups"], subnets=["subnets"] ), primary_container=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayContainerProperty( aws_logs_configuration=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceAwsLogsConfigurationProperty( log_group="logGroup", log_stream_prefix="logStreamPrefix" ), command=["command"], container_port=123, environment=[ecs_mixins.CfnExpressGatewayServicePropsMixin.KeyValuePairProperty( name="name", value="value" )], image="image", repository_credentials=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayRepositoryCredentialsProperty( credentials_parameter="credentialsParameter" ), secrets=[ecs_mixins.CfnExpressGatewayServicePropsMixin.SecretProperty( name="name", value_from="valueFrom" )] ), scaling_target=ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayScalingTargetProperty( auto_scaling_metric="autoScalingMetric", auto_scaling_target_value=123, max_task_count=123, min_task_count=123 ), service_revision_arn="serviceRevisionArn", task_role_arn="taskRoleArn" )
Attributes
- cpu
The CPU allocation for tasks in this service revision.
- created_at
The Unix timestamp for when this service revision was created.
- execution_role_arn
The ARN of the task execution role for the service revision.
- health_check_path
The health check path for this service revision.
- ingress_paths
The entry point into this service revision.
- memory
The memory allocation for tasks in this service revision.
- network_configuration
The network configuration for tasks in this service revision.
- primary_container
The primary container configuration for this service revision.
- scaling_target
The auto-scaling configuration for this service revision.
- service_revision_arn
The ARN of the service revision.
- task_role_arn
The ARN of the task role for the service revision.
ExpressGatewayServiceNetworkConfigurationProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceNetworkConfigurationProperty(*, security_groups=None, subnets=None)
Bases:
objectThe network configuration for an Express service.
By default, an Express service utilizes subnets and security groups associated with the default VPC.
- Parameters:
security_groups (
Optional[Sequence[str]]) – The IDs of the security groups associated with the Express service.subnets (
Optional[Sequence[str]]) – The IDs of the subnets associated with the Express service.
- 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 express_gateway_service_network_configuration_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceNetworkConfigurationProperty( security_groups=["securityGroups"], subnets=["subnets"] )
Attributes
- security_groups
The IDs of the security groups associated with the Express service.
- subnets
The IDs of the subnets associated with the Express service.
ExpressGatewayServiceStatusProperty
- class CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceStatusProperty(*, status_code=None)
Bases:
objectAn object that defines the status of Express service creation and information about the status of the service.
- Parameters:
status_code (
Optional[str]) – The status of the Express service.- 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 express_gateway_service_status_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.ExpressGatewayServiceStatusProperty( status_code="statusCode" )
Attributes
- status_code
The status of the Express service.
IngressPathSummaryProperty
- class CfnExpressGatewayServicePropsMixin.IngressPathSummaryProperty(*, access_type=None, endpoint=None)
Bases:
objectThe entry point into an Express service.
- Parameters:
access_type (
Optional[str]) – The type of access to the endpoint for the Express service.endpoint (
Optional[str]) – The endpoint for access to the service.
- 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 ingress_path_summary_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.IngressPathSummaryProperty( access_type="accessType", endpoint="endpoint" )
Attributes
- access_type
The type of access to the endpoint for the Express service.
- endpoint
The endpoint for access to the service.
KeyValuePairProperty
- class CfnExpressGatewayServicePropsMixin.KeyValuePairProperty(*, name=None, value=None)
Bases:
objectA key-value pair object.
- Parameters:
name (
Optional[str]) – The name of the key-value pair. For environment variables, this is the name of the environment variable.value (
Optional[str]) – The value of the key-value pair. For environment variables, this is the value of the environment variable.
- 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 key_value_pair_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.KeyValuePairProperty( name="name", value="value" )
Attributes
- name
The name of the key-value pair.
For environment variables, this is the name of the environment variable.
- value
The value of the key-value pair.
For environment variables, this is the value of the environment variable.
SecretProperty
- class CfnExpressGatewayServicePropsMixin.SecretProperty(*, name=None, value_from=None)
Bases:
objectAn object representing the secret to expose to your container.
Secrets can be exposed to a container in the following ways:
To inject sensitive data into your containers as environment variables, use the
secretscontainer definition parameter.To reference sensitive information in the log configuration of a container, use the
secretOptionscontainer definition parameter.
For more information, see Specifying sensitive data in the Amazon Elastic Container Service Developer Guide .
- Parameters:
name (
Optional[str]) – The name of the secret.value_from (
Optional[str]) –The secret to expose to the container. The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. For information about the require AWS Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide . .. epigraph:: If the SSM Parameter Store parameter exists in the same Region as the task you’re launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.
- 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 secret_property = ecs_mixins.CfnExpressGatewayServicePropsMixin.SecretProperty( name="name", value_from="valueFrom" )
Attributes
- name
The name of the secret.
- value_from
The secret to expose to the container.
The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store.
For information about the require AWS Identity and Access Management permissions, see Required IAM permissions for Amazon ECS secrets (for Secrets Manager) or Required IAM permissions for Amazon ECS secrets (for Systems Manager Parameter store) in the Amazon Elastic Container Service Developer Guide . .. epigraph:
If the SSM Parameter Store parameter exists in the same Region as the task you're launching, then you can use either the full ARN or name of the parameter. If the parameter exists in a different Region, then the full ARN must be specified.