ContainerServiceArgs

data class ContainerServiceArgs(val isDisabled: Output<Boolean>? = null, val name: Output<String>? = null, val power: Output<String>? = null, val privateRegistryAccess: Output<ContainerServicePrivateRegistryAccessArgs>? = null, val publicDomainNames: Output<ContainerServicePublicDomainNamesArgs>? = null, val scale: Output<Int>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ContainerServiceArgs>

An Amazon Lightsail container service is a highly scalable compute and networking resource on which you can deploy, run, and manage containers. For more information, see Container services in Amazon Lightsail.

Note: For more information about the AWS Regions in which you can create Amazon Lightsail container services, see "Regions and Availability Zones in Amazon Lightsail".

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.ContainerService;
import com.pulumi.aws.lightsail.ContainerServiceArgs;
import java.util.List;
import java.util.ArrayList;
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 myContainerService = new ContainerService("myContainerService", ContainerServiceArgs.builder()
.isDisabled(false)
.power("nano")
.scale(1)
.tags(Map.ofEntries(
Map.entry("foo1", "bar1"),
Map.entry("foo2", "")
))
.build());
}
}

Public Domain Names

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.ContainerService;
import com.pulumi.aws.lightsail.ContainerServiceArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServicePublicDomainNamesArgs;
import java.util.List;
import java.util.ArrayList;
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 myContainerService = new ContainerService("myContainerService", ContainerServiceArgs.builder()
.publicDomainNames(ContainerServicePublicDomainNamesArgs.builder()
.certificates(ContainerServicePublicDomainNamesCertificateArgs.builder()
.certificateName("example-certificate")
.domainNames("www.example.com")
.build())
.build())
.build());
}
}

Private Registry Access

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.lightsail.ContainerService;
import com.pulumi.aws.lightsail.ContainerServiceArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServicePrivateRegistryAccessArgs;
import com.pulumi.aws.lightsail.inputs.ContainerServicePrivateRegistryAccessEcrImagePullerRoleArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.ecr.RepositoryPolicy;
import com.pulumi.aws.ecr.RepositoryPolicyArgs;
import java.util.List;
import java.util.ArrayList;
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 defaultContainerService = new ContainerService("defaultContainerService", ContainerServiceArgs.builder()
.privateRegistryAccess(ContainerServicePrivateRegistryAccessArgs.builder()
.ecrImagePullerRole(ContainerServicePrivateRegistryAccessEcrImagePullerRoleArgs.builder()
.isActive(true)
.build())
.build())
.build());
final var defaultPolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("AWS")
.identifiers(defaultContainerService.privateRegistryAccess().applyValue(privateRegistryAccess -> privateRegistryAccess.ecrImagePullerRole().principalArn()))
.build())
.actions(
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer")
.build())
.build());
var defaultRepositoryPolicy = new RepositoryPolicy("defaultRepositoryPolicy", RepositoryPolicyArgs.builder()
.repository(aws_ecr_repository.default().name())
.policy(defaultPolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(defaultPolicyDocument -> defaultPolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
.build());
}
}

Import

Lightsail Container Service can be imported using the name, e.g.,

$ pulumi import aws:lightsail/containerService:ContainerService my_container_service container-service-1

Constructors

Link copied to clipboard
constructor(isDisabled: Output<Boolean>? = null, name: Output<String>? = null, power: Output<String>? = null, privateRegistryAccess: Output<ContainerServicePrivateRegistryAccessArgs>? = null, publicDomainNames: Output<ContainerServicePublicDomainNamesArgs>? = null, scale: Output<Int>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val isDisabled: Output<Boolean>? = null

A Boolean value indicating whether the container service is disabled. Defaults to false.

Link copied to clipboard
val name: Output<String>? = null

The name for the container service. Names must be of length 1 to 63, and be unique within each AWS Region in your Lightsail account.

Link copied to clipboard
val power: Output<String>? = null

The power specification for the container service. The power specifies the amount of memory, the number of vCPUs, and the monthly price of each node of the container service. Possible values: nano, micro, small, medium, large, xlarge.

Link copied to clipboard

An object to describe the configuration for the container service to access private container image repositories, such as Amazon Elastic Container Registry (Amazon ECR) private repositories. See Private Registry Access below for more details.

Link copied to clipboard

The public domain names to use with the container service, such as example.com and www.example.com. 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 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. Defined below.

Link copied to clipboard
val scale: Output<Int>? = null

The scale specification for the container service. The scale specifies the allocated compute nodes of the container service.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Map of container service tags. To tag at launch, specify the tags in the Launch Template. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Functions

Link copied to clipboard
open override fun toJava(): ContainerServiceArgs