ContainerServiceDeploymentVersion class
Manages a Lightsail container service deployment version. Use this resource to deploy containerized applications to your Lightsail container service with specific container configurations and settings.
> NOTE: The Amazon Lightsail container service must be enabled to create a deployment.
> NOTE: This resource allows you to manage an Amazon Lightsail container service deployment version but the provider cannot destroy it. Removing this resource from your configuration will remove it from your statefile.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.lightsail.ContainerServiceDeploymentVersion("example", {
publicEndpoint: {
healthCheck: {
healthyThreshold: 2,
unhealthyThreshold: 2,
timeoutSeconds: 2,
intervalSeconds: 5,
path: "/",
successCodes: "200-499",
},
containerName: "hello-world",
containerPort: 80,
},
containers: [{
containerName: "hello-world",
image: "amazon/amazon-lightsail:hello-world",
commands: [],
environment: {
MY_ENVIRONMENT_VARIABLE: "my_value",
},
ports: {
"80": "HTTP",
},
}],
serviceName: exampleAwsLightsailContainerService.name,
});
import pulumi
import pulumi_aws as aws
example = aws.lightsail.ContainerServiceDeploymentVersion("example",
public_endpoint={
"health_check": {
"healthy_threshold": 2,
"unhealthy_threshold": 2,
"timeout_seconds": 2,
"interval_seconds": 5,
"path": "/",
"success_codes": "200-499",
},
"container_name": "hello-world",
"container_port": 80,
},
containers=[{
"container_name": "hello-world",
"image": "amazon/amazon-lightsail:hello-world",
"commands": [],
"environment": {
"MY_ENVIRONMENT_VARIABLE": "my_value",
},
"ports": {
"80": "HTTP",
},
}],
service_name=example_aws_lightsail_container_service["name"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.LightSail.ContainerServiceDeploymentVersion("example", new()
{
PublicEndpoint = new Aws.LightSail.Inputs.ContainerServiceDeploymentVersionPublicEndpointArgs
{
HealthCheck = new Aws.LightSail.Inputs.ContainerServiceDeploymentVersionPublicEndpointHealthCheckArgs
{
HealthyThreshold = 2,
UnhealthyThreshold = 2,
TimeoutSeconds = 2,
IntervalSeconds = 5,
Path = "/",
SuccessCodes = "200-499",
},
ContainerName = "hello-world",
ContainerPort = 80,
},
Containers = new[]
{
new Aws.LightSail.Inputs.ContainerServiceDeploymentVersionContainerArgs
{
ContainerName = "hello-world",
Image = "amazon/amazon-lightsail:hello-world",
Commands = new() { },
Environment =
{
{ "MY_ENVIRONMENT_VARIABLE", "my_value" },
},
Ports =
{
{ "80", "HTTP" },
},
},
},
ServiceName = exampleAwsLightsailContainerService.Name,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/lightsail"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := lightsail.NewContainerServiceDeploymentVersion(ctx, "example", &lightsail.ContainerServiceDeploymentVersionArgs{
PublicEndpoint: &lightsail.ContainerServiceDeploymentVersionPublicEndpointArgs{
HealthCheck: &lightsail.ContainerServiceDeploymentVersionPublicEndpointHealthCheckArgs{
HealthyThreshold: pulumi.Int(2),
UnhealthyThreshold: pulumi.Int(2),
TimeoutSeconds: pulumi.Int(2),
IntervalSeconds: pulumi.Int(5),
Path: pulumi.String("/"),
SuccessCodes: pulumi.String("200-499"),
},
ContainerName: pulumi.String("hello-world"),
ContainerPort: pulumi.Int(80),
},
Containers: lightsail.ContainerServiceDeploymentVersionContainerArray{
&lightsail.ContainerServiceDeploymentVersionContainerArgs{
ContainerName: pulumi.String("hello-world"),
Image: pulumi.String("amazon/amazon-lightsail:hello-world"),
Commands: pulumi.StringArray{},
Environment: pulumi.StringMap{
"MY_ENVIRONMENT_VARIABLE": pulumi.String("my_value"),
},
Ports: pulumi.StringMap{
"80": pulumi.String("HTTP"),
},
},
},
ServiceName: pulumi.Any(exampleAwsLightsailContainerService.Name),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_lightsail_containerservicedeploymentversion" "example" {
public_endpoint = {
health_check = {
healthy_threshold = 2
unhealthy_threshold = 2
timeout_seconds = 2
interval_seconds = 5
path = "/"
success_codes = "200-499"
}
container_name = "hello-world"
container_port = 80
}
containers {
container_name = "hello-world"
image = "amazon/amazon-lightsail:hello-world"
commands = []
environment = {
"MY_ENVIRONMENT_VARIABLE" = "my_value"
}
ports = {
80 = "HTTP"
}
}
service_name = exampleAwsLightsailContainerService.name
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.ContainerServiceDeploymentVersion;
import com.pulumi.aws.lightsail.ContainerServiceDeploymentVersionArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServiceDeploymentVersionPublicEndpointArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServiceDeploymentVersionPublicEndpointHealthCheckArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServiceDeploymentVersionContainerArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ContainerServiceDeploymentVersion("example", ContainerServiceDeploymentVersionArgs.builder()
.publicEndpoint(ContainerServiceDeploymentVersionPublicEndpointArgs.builder()
.healthCheck(ContainerServiceDeploymentVersionPublicEndpointHealthCheckArgs.builder()
.healthyThreshold(2)
.unhealthyThreshold(2)
.timeoutSeconds(2)
.intervalSeconds(5)
.path("/")
.successCodes("200-499")
.build())
.containerName("hello-world")
.containerPort(80)
.build())
.containers(ContainerServiceDeploymentVersionContainerArgs.builder()
.containerName("hello-world")
.image("amazon/amazon-lightsail:hello-world")
.commands()
.environment(Map.of("MY_ENVIRONMENT_VARIABLE", "my_value"))
.ports(Map.of("80", "HTTP"))
.build())
.serviceName(exampleAwsLightsailContainerService.name())
.build());
}
}
resources:
example:
type: aws:lightsail:ContainerServiceDeploymentVersion
properties:
publicEndpoint:
healthCheck:
healthyThreshold: 2
unhealthyThreshold: 2
timeoutSeconds: 2
intervalSeconds: 5
path: /
successCodes: 200-499
containerName: hello-world
containerPort: 80
containers:
- containerName: hello-world
image: amazon/amazon-lightsail:hello-world
commands: []
environment:
MY_ENVIRONMENT_VARIABLE: my_value
ports:
'80': HTTP
serviceName: ${exampleAwsLightsailContainerService.name}
Import
Using pulumi import, import Lightsail Container Service Deployment Version using the serviceName and version separated by a slash (/). For example:
$ pulumi import aws:lightsail/containerServiceDeploymentVersion:ContainerServiceDeploymentVersion example container-service-1/1
Constructors
- ContainerServiceDeploymentVersion(String name, {ContainerServiceDeploymentVersionArgs? args, CustomResourceOptions? options})
-
Creates a new ContainerServiceDeploymentVersion.
nameThe Pulumi resource name.argsArguments used to configure this ContainerServiceDeploymentVersion. The set of arguments for ContainerServiceDeploymentVersion.optionsResource options controlling this resource's behavior. - ContainerServiceDeploymentVersion.reference(String urn)
- Creates a typed reference to an existing ContainerServiceDeploymentVersion resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
containers
↔ Output<
List< ContainerServiceDeploymentVersionContainer> > -
Set of configuration blocks that describe the settings of the containers that will be launched on the container service. Maximum of 53. See below.
latefinal
-
createdAt
↔ Output<
String> -
Date and time when the deployment was created.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
publicEndpoint
↔ Output<
ContainerServiceDeploymentVersionPublicEndpoint?> -
Configuration block that describes the settings of the public endpoint for the container service. See below.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serviceName
↔ Output<
String> -
Name of the container service.
latefinal
-
state
↔ Output<
String> -
Current state of the container service.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
version
↔ Output<
int> -
Version number of the deployment.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ContainerServiceDeploymentVersionState? state, CustomResourceOptions? options}) → ContainerServiceDeploymentVersion -
Gets an existing ContainerServiceDeploymentVersion resource's state with the given
nameandid.