CfnContainerPropsMixin
- class aws_cdk.mixins_preview.aws_lightsail.mixins.CfnContainerPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::Lightsail::Containerresource specifies a container service.A Lightsail container service is a compute resource to which you can deploy containers.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lightsail-container.html
- CloudformationResource:
AWS::Lightsail::Container
- 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_lightsail import mixins as lightsail_mixins cfn_container_props_mixin = lightsail_mixins.CfnContainerPropsMixin(lightsail_mixins.CfnContainerMixinProps( container_service_deployment=lightsail_mixins.CfnContainerPropsMixin.ContainerServiceDeploymentProperty( containers=[lightsail_mixins.CfnContainerPropsMixin.ContainerProperty( command=["command"], container_name="containerName", environment=[lightsail_mixins.CfnContainerPropsMixin.EnvironmentVariableProperty( value="value", variable="variable" )], image="image", ports=[lightsail_mixins.CfnContainerPropsMixin.PortInfoProperty( port="port", protocol="protocol" )] )], public_endpoint=lightsail_mixins.CfnContainerPropsMixin.PublicEndpointProperty( container_name="containerName", container_port=123, health_check_config=lightsail_mixins.CfnContainerPropsMixin.HealthCheckConfigProperty( healthy_threshold=123, interval_seconds=123, path="path", success_codes="successCodes", timeout_seconds=123, unhealthy_threshold=123 ) ) ), is_disabled=False, power="power", private_registry_access=lightsail_mixins.CfnContainerPropsMixin.PrivateRegistryAccessProperty( ecr_image_puller_role=lightsail_mixins.CfnContainerPropsMixin.EcrImagePullerRoleProperty( is_active=False, principal_arn="principalArn" ) ), public_domain_names=[lightsail_mixins.CfnContainerPropsMixin.PublicDomainNameProperty( certificate_name="certificateName", domain_names=["domainNames"] )], scale=123, service_name="serviceName", tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::Lightsail::Container.- Parameters:
props (
Union[CfnContainerMixinProps,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 = ['containerServiceDeployment', 'isDisabled', 'power', 'privateRegistryAccess', 'publicDomainNames', 'scale', 'serviceName', '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
ContainerProperty
- class CfnContainerPropsMixin.ContainerProperty(*, command=None, container_name=None, environment=None, image=None, ports=None)
Bases:
objectContaineris a property of the ContainerServiceDeployment property. It describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.- Parameters:
command (
Optional[Sequence[str]]) – The launch command for the container.container_name (
Optional[str]) – The name of the container.environment (
Union[IResolvable,Sequence[Union[IResolvable,EnvironmentVariableProperty,Dict[str,Any]]],None]) – The environment variables of the container.image (
Optional[str]) – The name of the image used for the container. Container images that are sourced from (registered and stored on) your container service start with a colon (:). For example, if your container service name iscontainer-service-1, the container image label ismystaticsite, and you want to use the third version (3) of the registered container image, then you should specify:container-service-1.mystaticsite.3. To use the latest version of a container image, specifylatestinstead of a version number (for example,:container-service-1.mystaticsite.latest). Your container service will automatically use the highest numbered version of the registered container image. Container images that are sourced from a public registry like Docker Hub don’t start with a colon. For example,nginx:latestornginx.ports (
Union[IResolvable,Sequence[Union[IResolvable,PortInfoProperty,Dict[str,Any]]],None]) – An object that describes the open firewall ports and protocols of 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_lightsail import mixins as lightsail_mixins container_property = lightsail_mixins.CfnContainerPropsMixin.ContainerProperty( command=["command"], container_name="containerName", environment=[lightsail_mixins.CfnContainerPropsMixin.EnvironmentVariableProperty( value="value", variable="variable" )], image="image", ports=[lightsail_mixins.CfnContainerPropsMixin.PortInfoProperty( port="port", protocol="protocol" )] )
Attributes
- command
The launch command for the container.
- container_name
The name of the container.
- environment
The environment variables of the container.
- image
The name of the image used for the container.
Container images that are sourced from (registered and stored on) your container service start with a colon (
:). For example, if your container service name iscontainer-service-1, the container image label ismystaticsite, and you want to use the third version (3) of the registered container image, then you should specify:container-service-1.mystaticsite.3. To use the latest version of a container image, specifylatestinstead of a version number (for example,:container-service-1.mystaticsite.latest). Your container service will automatically use the highest numbered version of the registered container image.Container images that are sourced from a public registry like Docker Hub don’t start with a colon. For example,
nginx:latestornginx.
- ports
An object that describes the open firewall ports and protocols of the container.
ContainerServiceDeploymentProperty
- class CfnContainerPropsMixin.ContainerServiceDeploymentProperty(*, containers=None, public_endpoint=None)
Bases:
objectContainerServiceDeploymentis a property of the AWS::Lightsail::Container resource. It describes a container deployment configuration of a container service.A deployment specifies the settings, such as the ports and launch command, of containers that are deployed to your container service.
- Parameters:
containers (
Union[IResolvable,Sequence[Union[IResolvable,ContainerProperty,Dict[str,Any]]],None]) – An object that describes the configuration for the containers of the deployment.public_endpoint (
Union[IResolvable,PublicEndpointProperty,Dict[str,Any],None]) – An object that describes the endpoint of the deployment.
- 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_lightsail import mixins as lightsail_mixins container_service_deployment_property = lightsail_mixins.CfnContainerPropsMixin.ContainerServiceDeploymentProperty( containers=[lightsail_mixins.CfnContainerPropsMixin.ContainerProperty( command=["command"], container_name="containerName", environment=[lightsail_mixins.CfnContainerPropsMixin.EnvironmentVariableProperty( value="value", variable="variable" )], image="image", ports=[lightsail_mixins.CfnContainerPropsMixin.PortInfoProperty( port="port", protocol="protocol" )] )], public_endpoint=lightsail_mixins.CfnContainerPropsMixin.PublicEndpointProperty( container_name="containerName", container_port=123, health_check_config=lightsail_mixins.CfnContainerPropsMixin.HealthCheckConfigProperty( healthy_threshold=123, interval_seconds=123, path="path", success_codes="successCodes", timeout_seconds=123, unhealthy_threshold=123 ) ) )
Attributes
- containers
An object that describes the configuration for the containers of the deployment.
- public_endpoint
An object that describes the endpoint of the deployment.
EcrImagePullerRoleProperty
- class CfnContainerPropsMixin.EcrImagePullerRoleProperty(*, is_active=None, principal_arn=None)
Bases:
objectDescribes the IAM role that you can use to grant a Lightsail container service access to Amazon ECR private repositories.
- Parameters:
is_active (
Union[bool,IResolvable,None]) – A boolean value that indicates whether theECRImagePullerRoleis active.principal_arn (
Optional[str]) – The principle Amazon Resource Name (ARN) of the role. This property is read-only.
- 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_lightsail import mixins as lightsail_mixins ecr_image_puller_role_property = lightsail_mixins.CfnContainerPropsMixin.EcrImagePullerRoleProperty( is_active=False, principal_arn="principalArn" )
Attributes
- is_active
A boolean value that indicates whether the
ECRImagePullerRoleis active.
- principal_arn
The principle Amazon Resource Name (ARN) of the role.
This property is read-only.
EnvironmentVariableProperty
- class CfnContainerPropsMixin.EnvironmentVariableProperty(*, value=None, variable=None)
Bases:
objectEnvironmentVariableis a property of the Container property. It describes the environment variables of a container on a container service which are key-value parameters that provide dynamic configuration of the application or script run by the container.- Parameters:
value (
Optional[str]) – The environment variable value.variable (
Optional[str]) – The environment variable 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_lightsail import mixins as lightsail_mixins environment_variable_property = lightsail_mixins.CfnContainerPropsMixin.EnvironmentVariableProperty( value="value", variable="variable" )
Attributes
- value
The environment variable value.
- variable
The environment variable key.
HealthCheckConfigProperty
- class CfnContainerPropsMixin.HealthCheckConfigProperty(*, healthy_threshold=None, interval_seconds=None, path=None, success_codes=None, timeout_seconds=None, unhealthy_threshold=None)
Bases:
objectHealthCheckConfigis a property of the PublicEndpoint property. It describes the healthcheck configuration of a container deployment on a container service.- Parameters:
healthy_threshold (
Union[int,float,None]) – The number of consecutive health check successes required before moving the container to theHealthystate. The default value is2.interval_seconds (
Union[int,float,None]) – The approximate interval, in seconds, between health checks of an individual container. You can specify between5and300seconds. The default value is5.path (
Optional[str]) – The path on the container on which to perform the health check. The default value is/.success_codes (
Optional[str]) – The HTTP codes to use when checking for a successful response from a container. You can specify values between200and499. You can specify multiple values (for example,200,202) or a range of values (for example,200-299).timeout_seconds (
Union[int,float,None]) – The amount of time, in seconds, during which no response means a failed health check. You can specify between2and60seconds. The default value is2.unhealthy_threshold (
Union[int,float,None]) – The number of consecutive health check failures required before moving the container to theUnhealthystate. The default value is2.
- 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_lightsail import mixins as lightsail_mixins health_check_config_property = lightsail_mixins.CfnContainerPropsMixin.HealthCheckConfigProperty( healthy_threshold=123, interval_seconds=123, path="path", success_codes="successCodes", timeout_seconds=123, unhealthy_threshold=123 )
Attributes
- healthy_threshold
The number of consecutive health check successes required before moving the container to the
Healthystate.The default value is
2.
- interval_seconds
The approximate interval, in seconds, between health checks of an individual container.
You can specify between
5and300seconds. The default value is5.
- path
The path on the container on which to perform the health check.
The default value is
/.
- success_codes
The HTTP codes to use when checking for a successful response from a container.
You can specify values between
200and499. You can specify multiple values (for example,200,202) or a range of values (for example,200-299).
- timeout_seconds
The amount of time, in seconds, during which no response means a failed health check.
You can specify between
2and60seconds. The default value is2.
- unhealthy_threshold
The number of consecutive health check failures required before moving the container to the
Unhealthystate.The default value is
2.
PortInfoProperty
- class CfnContainerPropsMixin.PortInfoProperty(*, port=None, protocol=None)
Bases:
objectPortInfois a property of the Container property. It describes the ports to open and the protocols to use for a container on a Amazon Lightsail container service.- Parameters:
port (
Optional[str]) – The open firewall ports of the container.protocol (
Optional[str]) – The protocol name for the open ports. Allowed values :HTTP|HTTPS|TCP|UDP
- 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_lightsail import mixins as lightsail_mixins port_info_property = lightsail_mixins.CfnContainerPropsMixin.PortInfoProperty( port="port", protocol="protocol" )
Attributes
- port
The open firewall ports of the container.
- protocol
The protocol name for the open ports.
Allowed values :
HTTP|HTTPS|TCP|UDP
PrivateRegistryAccessProperty
- class CfnContainerPropsMixin.PrivateRegistryAccessProperty(*, ecr_image_puller_role=None)
Bases:
objectDescribes the configuration for an Amazon Lightsail container service to access private container image repositories, such as ( Amazon ECR ) private repositories.
For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide .
- Parameters:
ecr_image_puller_role (
Union[IResolvable,EcrImagePullerRoleProperty,Dict[str,Any],None]) – An object that describes the activation status of the role that you can use to grant a Lightsail container service access to Amazon ECR private repositories. If the role is activated, the Amazon Resource Name (ARN) of the role is also listed.- 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_lightsail import mixins as lightsail_mixins private_registry_access_property = lightsail_mixins.CfnContainerPropsMixin.PrivateRegistryAccessProperty( ecr_image_puller_role=lightsail_mixins.CfnContainerPropsMixin.EcrImagePullerRoleProperty( is_active=False, principal_arn="principalArn" ) )
Attributes
- ecr_image_puller_role
An object that describes the activation status of the role that you can use to grant a Lightsail container service access to Amazon ECR private repositories.
If the role is activated, the Amazon Resource Name (ARN) of the role is also listed.
PublicDomainNameProperty
- class CfnContainerPropsMixin.PublicDomainNameProperty(*, certificate_name=None, domain_names=None)
Bases:
objectPublicDomainNameis a property of the AWS::Lightsail::Container resource. It describes the public domain names to use with a container service, such asexample.comandwww.example.com. It also describes the certificates to use with a container service.- Parameters:
certificate_name (
Optional[str]) – The name of the certificate for the public domains.domain_names (
Optional[Sequence[str]]) – The public domain names to use with the container 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_lightsail import mixins as lightsail_mixins public_domain_name_property = lightsail_mixins.CfnContainerPropsMixin.PublicDomainNameProperty( certificate_name="certificateName", domain_names=["domainNames"] )
Attributes
- certificate_name
The name of the certificate for the public domains.
- domain_names
The public domain names to use with the container service.
PublicEndpointProperty
- class CfnContainerPropsMixin.PublicEndpointProperty(*, container_name=None, container_port=None, health_check_config=None)
Bases:
objectPublicEndpointis a property of the ContainerServiceDeployment property. It describes describes the settings of the public endpoint of a container on a container service.- Parameters:
container_name (
Optional[str]) – The name of the container entry of the deployment that the endpoint configuration applies to.container_port (
Union[int,float,None]) – The port of the specified container to which traffic is forwarded to.health_check_config (
Union[IResolvable,HealthCheckConfigProperty,Dict[str,Any],None]) – An object that describes the health check configuration of 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_lightsail import mixins as lightsail_mixins public_endpoint_property = lightsail_mixins.CfnContainerPropsMixin.PublicEndpointProperty( container_name="containerName", container_port=123, health_check_config=lightsail_mixins.CfnContainerPropsMixin.HealthCheckConfigProperty( healthy_threshold=123, interval_seconds=123, path="path", success_codes="successCodes", timeout_seconds=123, unhealthy_threshold=123 ) )
Attributes
- container_name
The name of the container entry of the deployment that the endpoint configuration applies to.
- container_port
The port of the specified container to which traffic is forwarded to.
- health_check_config
An object that describes the health check configuration of the container.