@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
168 lines • 7.27 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContainerService = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Lightsail container service. Use this resource to create and manage a scalable compute and networking platform for deploying, running, and managing containerized applications in 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"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail).
*
* > **NOTE:** You must create and validate an SSL/TLS certificate before you can use `publicDomainNames` with your container service. For more information, see [Enabling and managing custom domains for your Amazon Lightsail container services](https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-creating-container-services-certificates).
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lightsail.ContainerService("example", {
* name: "container-service-1",
* power: "nano",
* scale: 1,
* isDisabled: false,
* tags: {
* foo1: "bar1",
* foo2: "",
* },
* });
* ```
*
* ### Public Domain Names
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lightsail.ContainerService("example", {publicDomainNames: {
* certificates: [{
* certificateName: "example-certificate",
* domainNames: ["www.example.com"],
* }],
* }});
* ```
*
* ### Private Registry Access
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleContainerService = new aws.lightsail.ContainerService("example", {privateRegistryAccess: {
* ecrImagePullerRole: {
* isActive: true,
* },
* }});
* const example = exampleContainerService.privateRegistryAccess.apply(privateRegistryAccess => aws.iam.getPolicyDocumentOutput({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "AWS",
* identifiers: [privateRegistryAccess.ecrImagePullerRole?.principalArn],
* }],
* actions: [
* "ecr:BatchGetImage",
* "ecr:GetDownloadUrlForLayer",
* ],
* }],
* }));
* const exampleRepositoryPolicy = new aws.ecr.RepositoryPolicy("example", {
* repository: exampleAwsEcrRepository.name,
* policy: example.apply(example => example.json),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Lightsail Container Service using the `name`. For example:
*
* ```sh
* $ pulumi import aws:lightsail/containerService:ContainerService example container-service-1
* ```
*/
class ContainerService extends pulumi.CustomResource {
/**
* Get an existing ContainerService resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ContainerService(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ContainerService. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ContainerService.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["availabilityZone"] = state?.availabilityZone;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["isDisabled"] = state?.isDisabled;
resourceInputs["name"] = state?.name;
resourceInputs["power"] = state?.power;
resourceInputs["powerId"] = state?.powerId;
resourceInputs["principalArn"] = state?.principalArn;
resourceInputs["privateDomainName"] = state?.privateDomainName;
resourceInputs["privateRegistryAccess"] = state?.privateRegistryAccess;
resourceInputs["publicDomainNames"] = state?.publicDomainNames;
resourceInputs["region"] = state?.region;
resourceInputs["resourceType"] = state?.resourceType;
resourceInputs["scale"] = state?.scale;
resourceInputs["state"] = state?.state;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["url"] = state?.url;
}
else {
const args = argsOrState;
if (args?.power === undefined && !opts.urn) {
throw new Error("Missing required property 'power'");
}
if (args?.scale === undefined && !opts.urn) {
throw new Error("Missing required property 'scale'");
}
resourceInputs["isDisabled"] = args?.isDisabled;
resourceInputs["name"] = args?.name;
resourceInputs["power"] = args?.power;
resourceInputs["privateRegistryAccess"] = args?.privateRegistryAccess;
resourceInputs["publicDomainNames"] = args?.publicDomainNames;
resourceInputs["region"] = args?.region;
resourceInputs["scale"] = args?.scale;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["availabilityZone"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["powerId"] = undefined /*out*/;
resourceInputs["principalArn"] = undefined /*out*/;
resourceInputs["privateDomainName"] = undefined /*out*/;
resourceInputs["resourceType"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ContainerService.__pulumiType, name, resourceInputs, opts);
}
}
exports.ContainerService = ContainerService;
/** @internal */
ContainerService.__pulumiType = 'aws:lightsail/containerService:ContainerService';
//# sourceMappingURL=containerService.js.map