CfnContainerPropsMixin

class aws_cdk.mixins_preview.aws_lightsail.mixins.CfnContainerPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::Lightsail::Container resource 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:

IConstruct

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 x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

ContainerProperty

class CfnContainerPropsMixin.ContainerProperty(*, command=None, container_name=None, environment=None, image=None, ports=None)

Bases: object

Container is 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 is container-service-1 , the container image label is mystaticsite , 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, specify latest instead 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:latest or nginx .

  • 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html#cfn-lightsail-container-container-command

container_name

The name of the container.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html#cfn-lightsail-container-container-containername

environment

The environment variables of the container.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html#cfn-lightsail-container-container-environment

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 is container-service-1 , the container image label is mystaticsite , 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, specify latest instead 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:latest or nginx .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html#cfn-lightsail-container-container-image

ports

An object that describes the open firewall ports and protocols of the container.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-container.html#cfn-lightsail-container-container-ports

ContainerServiceDeploymentProperty

class CfnContainerPropsMixin.ContainerServiceDeploymentProperty(*, containers=None, public_endpoint=None)

Bases: object

ContainerServiceDeployment is 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:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-containerservicedeployment.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-containerservicedeployment.html#cfn-lightsail-container-containerservicedeployment-containers

public_endpoint

An object that describes the endpoint of the deployment.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-containerservicedeployment.html#cfn-lightsail-container-containerservicedeployment-publicendpoint

EcrImagePullerRoleProperty

class CfnContainerPropsMixin.EcrImagePullerRoleProperty(*, is_active=None, principal_arn=None)

Bases: object

Describes 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 the ECRImagePullerRole is active.

  • principal_arn (Optional[str]) – The principle Amazon Resource Name (ARN) of the role. This property is read-only.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-ecrimagepullerrole.html

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 ECRImagePullerRole is active.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-ecrimagepullerrole.html#cfn-lightsail-container-ecrimagepullerrole-isactive

principal_arn

The principle Amazon Resource Name (ARN) of the role.

This property is read-only.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-ecrimagepullerrole.html#cfn-lightsail-container-ecrimagepullerrole-principalarn

EnvironmentVariableProperty

class CfnContainerPropsMixin.EnvironmentVariableProperty(*, value=None, variable=None)

Bases: object

EnvironmentVariable is 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-environmentvariable.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-environmentvariable.html#cfn-lightsail-container-environmentvariable-value

variable

The environment variable key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-environmentvariable.html#cfn-lightsail-container-environmentvariable-variable

HealthCheckConfigProperty

class CfnContainerPropsMixin.HealthCheckConfigProperty(*, healthy_threshold=None, interval_seconds=None, path=None, success_codes=None, timeout_seconds=None, unhealthy_threshold=None)

Bases: object

HealthCheckConfig is 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 the Healthy state. The default value is 2 .

  • interval_seconds (Union[int, float, None]) – The approximate interval, in seconds, between health checks of an individual container. You can specify between 5 and 300 seconds. The default value is 5 .

  • 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 between 200 and 499 . 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 between 2 and 60 seconds. The default value is 2 .

  • unhealthy_threshold (Union[int, float, None]) – The number of consecutive health check failures required before moving the container to the Unhealthy state. The default value is 2 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html

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 Healthy state.

The default value is 2 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-healthythreshold

interval_seconds

The approximate interval, in seconds, between health checks of an individual container.

You can specify between 5 and 300 seconds. The default value is 5 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-intervalseconds

path

The path on the container on which to perform the health check.

The default value is / .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-path

success_codes

The HTTP codes to use when checking for a successful response from a container.

You can specify values between 200 and 499 . You can specify multiple values (for example, 200,202 ) or a range of values (for example, 200-299 ).

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-successcodes

timeout_seconds

The amount of time, in seconds, during which no response means a failed health check.

You can specify between 2 and 60 seconds. The default value is 2 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-timeoutseconds

unhealthy_threshold

The number of consecutive health check failures required before moving the container to the Unhealthy state.

The default value is 2 .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-healthcheckconfig.html#cfn-lightsail-container-healthcheckconfig-unhealthythreshold

PortInfoProperty

class CfnContainerPropsMixin.PortInfoProperty(*, port=None, protocol=None)

Bases: object

PortInfo is 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-portinfo.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-portinfo.html#cfn-lightsail-container-portinfo-port

protocol

The protocol name for the open ports.

Allowed values : HTTP | HTTPS | TCP | UDP

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-portinfo.html#cfn-lightsail-container-portinfo-protocol

PrivateRegistryAccessProperty

class CfnContainerPropsMixin.PrivateRegistryAccessProperty(*, ecr_image_puller_role=None)

Bases: object

Describes 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-privateregistryaccess.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-privateregistryaccess.html#cfn-lightsail-container-privateregistryaccess-ecrimagepullerrole

PublicDomainNameProperty

class CfnContainerPropsMixin.PublicDomainNameProperty(*, certificate_name=None, domain_names=None)

Bases: object

PublicDomainName is a property of the AWS::Lightsail::Container resource. It describes the public domain names to use with a container service, such as example.com and www.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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicdomainname.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicdomainname.html#cfn-lightsail-container-publicdomainname-certificatename

domain_names

The public domain names to use with the container service.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicdomainname.html#cfn-lightsail-container-publicdomainname-domainnames

PublicEndpointProperty

class CfnContainerPropsMixin.PublicEndpointProperty(*, container_name=None, container_port=None, health_check_config=None)

Bases: object

PublicEndpoint is 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:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicendpoint.html

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicendpoint.html#cfn-lightsail-container-publicendpoint-containername

container_port

The port of the specified container to which traffic is forwarded to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicendpoint.html#cfn-lightsail-container-publicendpoint-containerport

health_check_config

An object that describes the health check configuration of the container.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lightsail-container-publicendpoint.html#cfn-lightsail-container-publicendpoint-healthcheckconfig