Class CfnContainer.ContainerProperty.Builder
java.lang.Object
software.amazon.awscdk.services.lightsail.CfnContainer.ContainerProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnContainer.ContainerProperty>
- Enclosing interface:
CfnContainer.ContainerProperty
@Stability(Stable)
public static final class CfnContainer.ContainerProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnContainer.ContainerProperty>
A builder for
CfnContainer.ContainerProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnContainer.ContainerProperty.getCommand()
containerName
(String containerName) Sets the value ofCfnContainer.ContainerProperty.getContainerName()
environment
(List<? extends Object> environment) Sets the value ofCfnContainer.ContainerProperty.getEnvironment()
environment
(IResolvable environment) Sets the value ofCfnContainer.ContainerProperty.getEnvironment()
Sets the value ofCfnContainer.ContainerProperty.getImage()
Sets the value ofCfnContainer.ContainerProperty.getPorts()
ports
(IResolvable ports) Sets the value ofCfnContainer.ContainerProperty.getPorts()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
command
Sets the value ofCfnContainer.ContainerProperty.getCommand()
- Parameters:
command
- The launch command for the container.- Returns:
this
-
containerName
@Stability(Stable) public CfnContainer.ContainerProperty.Builder containerName(String containerName) Sets the value ofCfnContainer.ContainerProperty.getContainerName()
- Parameters:
containerName
- The name of the container.- Returns:
this
-
environment
@Stability(Stable) public CfnContainer.ContainerProperty.Builder environment(IResolvable environment) Sets the value ofCfnContainer.ContainerProperty.getEnvironment()
- Parameters:
environment
- The environment variables of the container.- Returns:
this
-
environment
@Stability(Stable) public CfnContainer.ContainerProperty.Builder environment(List<? extends Object> environment) Sets the value ofCfnContainer.ContainerProperty.getEnvironment()
- Parameters:
environment
- The environment variables of the container.- Returns:
this
-
image
Sets the value ofCfnContainer.ContainerProperty.getImage()
- Parameters:
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, specifylatest
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
ornginx
.- Returns:
this
-
ports
Sets the value ofCfnContainer.ContainerProperty.getPorts()
- Parameters:
ports
- An object that describes the open firewall ports and protocols of the container.- Returns:
this
-
ports
@Stability(Stable) public CfnContainer.ContainerProperty.Builder ports(List<? extends Object> ports) Sets the value ofCfnContainer.ContainerProperty.getPorts()
- Parameters:
ports
- An object that describes the open firewall ports and protocols of the container.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnContainer.ContainerProperty>
- Returns:
- a new instance of
CfnContainer.ContainerProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-