CfnContainerProps Struct
Properties for defining a CfnContainer.
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lightsail as lightsail } from 'aws-cdk-lib';
const cfnContainerProps: lightsail.CfnContainerProps = {
power: 'power',
scale: 123,
serviceName: 'serviceName',
// the properties below are optional
containerServiceDeployment: {
containers: [{
command: ['command'],
containerName: 'containerName',
environment: [{
value: 'value',
variable: 'variable',
}],
image: 'image',
ports: [{
port: 'port',
protocol: 'protocol',
}],
}],
publicEndpoint: {
containerName: 'containerName',
containerPort: 123,
healthCheckConfig: {
healthyThreshold: 123,
intervalSeconds: 123,
path: 'path',
successCodes: 'successCodes',
timeoutSeconds: 123,
unhealthyThreshold: 123,
},
},
},
isDisabled: false,
privateRegistryAccess: {
ecrImagePullerRole: {
isActive: false,
principalArn: 'principalArn',
},
},
publicDomainNames: [{
certificateName: 'certificateName',
domainNames: ['domainNames'],
}],
tags: [{
key: 'key',
value: 'value',
}],
};
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lightsail as lightsail
cfn_container_props = lightsail.CfnContainerProps(
power="power",
scale=123,
service_name="serviceName",
# the properties below are optional
container_service_deployment=lightsail.CfnContainer.ContainerServiceDeploymentProperty(
containers=[lightsail.CfnContainer.ContainerProperty(
command=["command"],
container_name="containerName",
environment=[lightsail.CfnContainer.EnvironmentVariableProperty(
value="value",
variable="variable"
)],
image="image",
ports=[lightsail.CfnContainer.PortInfoProperty(
port="port",
protocol="protocol"
)]
)],
public_endpoint=lightsail.CfnContainer.PublicEndpointProperty(
container_name="containerName",
container_port=123,
health_check_config=lightsail.CfnContainer.HealthCheckConfigProperty(
healthy_threshold=123,
interval_seconds=123,
path="path",
success_codes="successCodes",
timeout_seconds=123,
unhealthy_threshold=123
)
)
),
is_disabled=False,
private_registry_access=lightsail.CfnContainer.PrivateRegistryAccessProperty(
ecr_image_puller_role=lightsail.CfnContainer.EcrImagePullerRoleProperty(
is_active=False,
principal_arn="principalArn"
)
),
public_domain_names=[lightsail.CfnContainer.PublicDomainNameProperty(
certificate_name="certificateName",
domain_names=["domainNames"]
)],
tags=[CfnTag(
key="key",
value="value"
)]
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lightsail.*;
CfnContainerProps cfnContainerProps = CfnContainerProps.builder()
.power("power")
.scale(123)
.serviceName("serviceName")
// the properties below are optional
.containerServiceDeployment(ContainerServiceDeploymentProperty.builder()
.containers(List.of(ContainerProperty.builder()
.command(List.of("command"))
.containerName("containerName")
.environment(List.of(EnvironmentVariableProperty.builder()
.value("value")
.variable("variable")
.build()))
.image("image")
.ports(List.of(PortInfoProperty.builder()
.port("port")
.protocol("protocol")
.build()))
.build()))
.publicEndpoint(PublicEndpointProperty.builder()
.containerName("containerName")
.containerPort(123)
.healthCheckConfig(HealthCheckConfigProperty.builder()
.healthyThreshold(123)
.intervalSeconds(123)
.path("path")
.successCodes("successCodes")
.timeoutSeconds(123)
.unhealthyThreshold(123)
.build())
.build())
.build())
.isDisabled(false)
.privateRegistryAccess(PrivateRegistryAccessProperty.builder()
.ecrImagePullerRole(EcrImagePullerRoleProperty.builder()
.isActive(false)
.principalArn("principalArn")
.build())
.build())
.publicDomainNames(List.of(PublicDomainNameProperty.builder()
.certificateName("certificateName")
.domainNames(List.of("domainNames"))
.build()))
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lightsail;
var cfnContainerProps = new CfnContainerProps {
Power = "power",
Scale = 123,
ServiceName = "serviceName",
// the properties below are optional
ContainerServiceDeployment = new ContainerServiceDeploymentProperty {
Containers = new [] { new ContainerProperty {
Command = new [] { "command" },
ContainerName = "containerName",
Environment = new [] { new EnvironmentVariableProperty {
Value = "value",
Variable = "variable"
} },
Image = "image",
Ports = new [] { new PortInfoProperty {
Port = "port",
Protocol = "protocol"
} }
} },
PublicEndpoint = new PublicEndpointProperty {
ContainerName = "containerName",
ContainerPort = 123,
HealthCheckConfig = new HealthCheckConfigProperty {
HealthyThreshold = 123,
IntervalSeconds = 123,
Path = "path",
SuccessCodes = "successCodes",
TimeoutSeconds = 123,
UnhealthyThreshold = 123
}
}
},
IsDisabled = false,
PrivateRegistryAccess = new PrivateRegistryAccessProperty {
EcrImagePullerRole = new EcrImagePullerRoleProperty {
IsActive = false,
PrincipalArn = "principalArn"
}
},
PublicDomainNames = new [] { new PublicDomainNameProperty {
CertificateName = "certificateName",
DomainNames = new [] { "domainNames" }
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnContainerProps := &CfnContainerProps{
Power: jsii.String("power"),
Scale: jsii.Number(123),
ServiceName: jsii.String("serviceName"),
// the properties below are optional
ContainerServiceDeployment: &ContainerServiceDeploymentProperty{
Containers: []interface{}{
&ContainerProperty{
Command: []*string{
jsii.String("command"),
},
ContainerName: jsii.String("containerName"),
Environment: []interface{}{
&EnvironmentVariableProperty{
Value: jsii.String("value"),
Variable: jsii.String("variable"),
},
},
Image: jsii.String("image"),
Ports: []interface{}{
&PortInfoProperty{
Port: jsii.String("port"),
Protocol: jsii.String("protocol"),
},
},
},
},
PublicEndpoint: &PublicEndpointProperty{
ContainerName: jsii.String("containerName"),
ContainerPort: jsii.Number(123),
HealthCheckConfig: &HealthCheckConfigProperty{
HealthyThreshold: jsii.Number(123),
IntervalSeconds: jsii.Number(123),
Path: jsii.String("path"),
SuccessCodes: jsii.String("successCodes"),
TimeoutSeconds: jsii.Number(123),
UnhealthyThreshold: jsii.Number(123),
},
},
},
IsDisabled: jsii.Boolean(false),
PrivateRegistryAccess: &PrivateRegistryAccessProperty{
EcrImagePullerRole: &EcrImagePullerRoleProperty{
IsActive: jsii.Boolean(false),
PrincipalArn: jsii.String("principalArn"),
},
},
PublicDomainNames: []interface{}{
&PublicDomainNameProperty{
CertificateName: jsii.String("certificateName"),
DomainNames: []*string{
jsii.String("domainNames"),
},
},
},
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
containerServiceDeploymentoptionalIResolvable | CfnContainer.container_service_deploymentoptionaltyping.Union[IResolvable, ContainerServiceDeploymentProperty]containerServiceDeploymentoptionalIResolvableContainerServiceDeploymentoptionalIResolvableContainerServiceDeploymentoptionalinterface{} #isDisabledoptionalboolean | IResolvableis_disabledoptionaltyping.Union[bool, IResolvable]isDisabledoptionalBooleanIsDisabledoptionalboolIsDisabledoptionalinterface{} #The power specifies the amount of RAM, the number of vCPUs, and the base price of the container service.
privateRegistryAccessoptionalIResolvable | CfnContainer.private_registry_accessoptionaltyping.Union[IResolvable, PrivateRegistryAccessProperty]privateRegistryAccessoptionalIResolvablePrivateRegistryAccessoptionalIResolvablePrivateRegistryAccessoptionalinterface{} #notes
For more information, see Configuring access to an Amazon ECR private repository for an Amazon Lightsail container service in the Amazon Lightsail Developer Guide .
publicDomainNamesoptionalIResolvable | IResolvable | CfnContainer.public_domain_namesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PublicDomainNameProperty]]]publicDomainNamesoptionalIResolvablePublicDomainNamesoptionalIResolvablePublicDomainNamesoptionalinterface{} #notes
You can specify up to four public domain names for a container service. The domain names that you specify are used when you create a deployment with a container that is configured as the public endpoint of your container service.
If you don't specify public domain names, then you can use the default domain of the container service.
You must create and validate an SSL/TLS certificate before you can use public domain names with your container service. Use the AWS::Lightsail::Certificate resource to create a certificate for the public domain names that you want to use with your container service.
The scale specifies the allocated compute nodes of the container service.