ContainerProperty Struct
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.
| 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 containerProperty: lightsail.CfnContainer.ContainerProperty = {
command: ['command'],
containerName: 'containerName',
environment: [{
value: 'value',
variable: 'variable',
}],
image: 'image',
ports: [{
port: 'port',
protocol: 'protocol',
}],
};
# 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
container_property = 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"
)]
)
// 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.*;
ContainerProperty containerProperty = 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();
// 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 containerProperty = 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"
} }
};
// 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"
containerProperty := &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"),
},
},
}
Properties
commandoptionalstring[]commandoptionaltyping.List[str]commandoptionalList<String>Commandoptionalstring[]Commandoptional*[]*string #containerNameoptionalstringcontainer_nameoptionalstrcontainerNameoptionalStringContainerNameoptionalstringContainerNameoptional*string #environmentoptionalIResolvable | IResolvable | CfnContainer.environmentoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, EnvironmentVariableProperty]]]environmentoptionalIResolvableEnvironmentoptionalIResolvableEnvironmentoptionalinterface{} #notes
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 .
portsoptionalIResolvable | IResolvable | CfnContainer.PortInfoProperty[]portsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, PortInfoProperty]]]portsoptionalIResolvablePortsoptionalIResolvablePortsoptionalinterface{} #