UNPKG

@pulumi/aws

Version:

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

124 lines 6.61 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.Fleet = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage EC2 Fleets. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.Fleet("example", { * launchTemplateConfigs: [{ * launchTemplateSpecification: { * launchTemplateId: exampleAwsLaunchTemplate.id, * version: exampleAwsLaunchTemplate.latestVersion, * }, * }], * targetCapacitySpecification: { * defaultTargetCapacityType: "spot", * totalTargetCapacity: 5, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_ec2_fleet` using the Fleet identifier. For example: * * ```sh * $ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c * ``` */ class Fleet extends pulumi.CustomResource { /** * Get an existing Fleet 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 Fleet(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Fleet. 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'] === Fleet.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["context"] = state ? state.context : undefined; resourceInputs["excessCapacityTerminationPolicy"] = state ? state.excessCapacityTerminationPolicy : undefined; resourceInputs["fleetInstanceSets"] = state ? state.fleetInstanceSets : undefined; resourceInputs["fleetState"] = state ? state.fleetState : undefined; resourceInputs["fulfilledCapacity"] = state ? state.fulfilledCapacity : undefined; resourceInputs["fulfilledOnDemandCapacity"] = state ? state.fulfilledOnDemandCapacity : undefined; resourceInputs["launchTemplateConfigs"] = state ? state.launchTemplateConfigs : undefined; resourceInputs["onDemandOptions"] = state ? state.onDemandOptions : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["replaceUnhealthyInstances"] = state ? state.replaceUnhealthyInstances : undefined; resourceInputs["spotOptions"] = state ? state.spotOptions : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["targetCapacitySpecification"] = state ? state.targetCapacitySpecification : undefined; resourceInputs["terminateInstances"] = state ? state.terminateInstances : undefined; resourceInputs["terminateInstancesWithExpiration"] = state ? state.terminateInstancesWithExpiration : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["validFrom"] = state ? state.validFrom : undefined; resourceInputs["validUntil"] = state ? state.validUntil : undefined; } else { const args = argsOrState; if ((!args || args.launchTemplateConfigs === undefined) && !opts.urn) { throw new Error("Missing required property 'launchTemplateConfigs'"); } if ((!args || args.targetCapacitySpecification === undefined) && !opts.urn) { throw new Error("Missing required property 'targetCapacitySpecification'"); } resourceInputs["context"] = args ? args.context : undefined; resourceInputs["excessCapacityTerminationPolicy"] = args ? args.excessCapacityTerminationPolicy : undefined; resourceInputs["fleetInstanceSets"] = args ? args.fleetInstanceSets : undefined; resourceInputs["fleetState"] = args ? args.fleetState : undefined; resourceInputs["fulfilledCapacity"] = args ? args.fulfilledCapacity : undefined; resourceInputs["fulfilledOnDemandCapacity"] = args ? args.fulfilledOnDemandCapacity : undefined; resourceInputs["launchTemplateConfigs"] = args ? args.launchTemplateConfigs : undefined; resourceInputs["onDemandOptions"] = args ? args.onDemandOptions : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["replaceUnhealthyInstances"] = args ? args.replaceUnhealthyInstances : undefined; resourceInputs["spotOptions"] = args ? args.spotOptions : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["targetCapacitySpecification"] = args ? args.targetCapacitySpecification : undefined; resourceInputs["terminateInstances"] = args ? args.terminateInstances : undefined; resourceInputs["terminateInstancesWithExpiration"] = args ? args.terminateInstancesWithExpiration : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["validFrom"] = args ? args.validFrom : undefined; resourceInputs["validUntil"] = args ? args.validUntil : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Fleet.__pulumiType, name, resourceInputs, opts); } } exports.Fleet = Fleet; /** @internal */ Fleet.__pulumiType = 'aws:ec2/fleet:Fleet'; //# sourceMappingURL=fleet.js.map