Resource: aws_lightsail_container_service_deployment_version

Provides a resource to manage a deployment version for your Amazon Lightsail container service.

Example Usage

Basic Usage

resource "aws_lightsail_container_service_deployment_version" "example" {
  container {
    container_name = "hello-world"
    image          = "amazon/amazon-lightsail:hello-world"

    command = []

    environment = {
      MY_ENVIRONMENT_VARIABLE = "my_value"
    }

    ports = {
      80 = "HTTP"
    }
  }

  public_endpoint {
    container_name = "hello-world"
    container_port = 80

    health_check {
      healthy_threshold   = 2
      unhealthy_threshold = 2
      timeout_seconds     = 2
      interval_seconds    = 5
      path                = "/"
      success_codes       = "200-499"
    }
  }

  service_name = aws_lightsail_container_service.example.name
}

Argument Reference

This resource supports the following arguments:

container

The container configuration block supports the following arguments:

public_endpoint

The public_endpoint configuration block supports the following arguments:

health_check

The health_check configuration block supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Lightsail Container Service Deployment Version using the service_name and version separated by a slash (/). For example:

import {
  to = aws_lightsail_container_service_deployment_version.example
  id = "container-service-1/1"
}

Using terraform import, import Lightsail Container Service Deployment Version using the service_name and version separated by a slash (/). For example:

% terraform import aws_lightsail_container_service_deployment_version.example container-service-1/1