UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

89 lines 3.82 kB
"use strict"; // *** 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.ClusterCapacityProviders = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages the capacity providers of an ECS Cluster. * * More information about capacity providers can be found in the [ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ecs.Cluster("example", {name: "my-cluster"}); * const exampleClusterCapacityProviders = new aws.ecs.ClusterCapacityProviders("example", { * clusterName: example.name, * capacityProviders: ["FARGATE"], * defaultCapacityProviderStrategies: [{ * base: 1, * weight: 100, * capacityProvider: "FARGATE", * }], * }); * ``` * * ## Import * * Using `pulumi import`, import ECS cluster capacity providers using the `cluster_name` attribute. For example: * * ```sh * $ pulumi import aws:ecs/clusterCapacityProviders:ClusterCapacityProviders example my-cluster * ``` */ class ClusterCapacityProviders extends pulumi.CustomResource { /** * Get an existing ClusterCapacityProviders 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 ClusterCapacityProviders(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ClusterCapacityProviders. 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'] === ClusterCapacityProviders.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["capacityProviders"] = state?.capacityProviders; resourceInputs["clusterName"] = state?.clusterName; resourceInputs["defaultCapacityProviderStrategies"] = state?.defaultCapacityProviderStrategies; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.clusterName === undefined && !opts.urn) { throw new Error("Missing required property 'clusterName'"); } resourceInputs["capacityProviders"] = args?.capacityProviders; resourceInputs["clusterName"] = args?.clusterName; resourceInputs["defaultCapacityProviderStrategies"] = args?.defaultCapacityProviderStrategies; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ClusterCapacityProviders.__pulumiType, name, resourceInputs, opts); } } exports.ClusterCapacityProviders = ClusterCapacityProviders; /** @internal */ ClusterCapacityProviders.__pulumiType = 'aws:ecs/clusterCapacityProviders:ClusterCapacityProviders'; //# sourceMappingURL=clusterCapacityProviders.js.map