@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
133 lines • 7.15 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.ExpressGatewayService = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an ECS Express service. The Express service provides a simplified way to deploy containerized applications with automatic provisioning and management of AWS infrastructure including Application Load Balancers (ALBs), target groups, security groups, and auto-scaling policies. This service offers built-in load balancing, auto-scaling, and networking capabilities with zero-downtime deployments.
*
* Express services automatically handle infrastructure provisioning and updates through rolling deployments, ensuring high availability during service modifications. When you update an Express service, a new service revision is created and deployed with zero downtime.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ecs.ExpressGatewayService("example", {
* executionRoleArn: execution.arn,
* infrastructureRoleArn: infrastructure.arn,
* primaryContainer: {
* image: "nginx:latest",
* },
* });
* ```
*
* ## Service Updates and Deletion
*
* ### Updates
*
* When you update an Express service configuration, a new service revision is created and deployed using a rolling deployment strategy with zero downtime. The service automatically manages the transition from the old configuration to the new one, ensuring continuous availability.
*
* ### Deletion
*
* When an Express service is deleted, it enters a `DRAINING` state where existing tasks are allowed to complete gracefully before termination. The deletion process is irreversible - once initiated, the service and all its associated AWS infrastructure (load balancers, target groups, etc.) will be permanently removed. During the draining process, no new tasks are started, and the service becomes unavailable once all tasks have completed.
*
* ## Import
*
* Using `pulumi import`, import ECS Express Gateway Services using the service ARN. For example:
*
* ```sh
* $ pulumi import aws:ecs/expressGatewayService:ExpressGatewayService example arn:aws:ecs:us-west-2:123456789012:service/my-cluster/my-express-gateway-service
* ```
*/
class ExpressGatewayService extends pulumi.CustomResource {
/**
* Get an existing ExpressGatewayService 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 ExpressGatewayService(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ExpressGatewayService. 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'] === ExpressGatewayService.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cluster"] = state?.cluster;
resourceInputs["cpu"] = state?.cpu;
resourceInputs["currentDeployment"] = state?.currentDeployment;
resourceInputs["executionRoleArn"] = state?.executionRoleArn;
resourceInputs["healthCheckPath"] = state?.healthCheckPath;
resourceInputs["infrastructureRoleArn"] = state?.infrastructureRoleArn;
resourceInputs["ingressPaths"] = state?.ingressPaths;
resourceInputs["memory"] = state?.memory;
resourceInputs["networkConfigurations"] = state?.networkConfigurations;
resourceInputs["primaryContainer"] = state?.primaryContainer;
resourceInputs["region"] = state?.region;
resourceInputs["scalingTargets"] = state?.scalingTargets;
resourceInputs["serviceArn"] = state?.serviceArn;
resourceInputs["serviceName"] = state?.serviceName;
resourceInputs["serviceRevisionArn"] = state?.serviceRevisionArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["taskRoleArn"] = state?.taskRoleArn;
resourceInputs["timeouts"] = state?.timeouts;
resourceInputs["waitForSteadyState"] = state?.waitForSteadyState;
}
else {
const args = argsOrState;
if (args?.executionRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'executionRoleArn'");
}
if (args?.infrastructureRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'infrastructureRoleArn'");
}
resourceInputs["cluster"] = args?.cluster;
resourceInputs["cpu"] = args?.cpu;
resourceInputs["executionRoleArn"] = args?.executionRoleArn;
resourceInputs["healthCheckPath"] = args?.healthCheckPath;
resourceInputs["infrastructureRoleArn"] = args?.infrastructureRoleArn;
resourceInputs["memory"] = args?.memory;
resourceInputs["networkConfigurations"] = args?.networkConfigurations;
resourceInputs["primaryContainer"] = args?.primaryContainer;
resourceInputs["region"] = args?.region;
resourceInputs["scalingTargets"] = args?.scalingTargets;
resourceInputs["serviceName"] = args?.serviceName;
resourceInputs["tags"] = args?.tags;
resourceInputs["taskRoleArn"] = args?.taskRoleArn;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["waitForSteadyState"] = args?.waitForSteadyState;
resourceInputs["currentDeployment"] = undefined /*out*/;
resourceInputs["ingressPaths"] = undefined /*out*/;
resourceInputs["serviceArn"] = undefined /*out*/;
resourceInputs["serviceRevisionArn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ExpressGatewayService.__pulumiType, name, resourceInputs, opts);
}
}
exports.ExpressGatewayService = ExpressGatewayService;
/** @internal */
ExpressGatewayService.__pulumiType = 'aws:ecs/expressGatewayService:ExpressGatewayService';
//# sourceMappingURL=expressGatewayService.js.map