@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
124 lines • 5.86 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.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, { ...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?.arn;
resourceInputs["context"] = state?.context;
resourceInputs["excessCapacityTerminationPolicy"] = state?.excessCapacityTerminationPolicy;
resourceInputs["fleetInstanceSets"] = state?.fleetInstanceSets;
resourceInputs["fleetState"] = state?.fleetState;
resourceInputs["fulfilledCapacity"] = state?.fulfilledCapacity;
resourceInputs["fulfilledOnDemandCapacity"] = state?.fulfilledOnDemandCapacity;
resourceInputs["launchTemplateConfigs"] = state?.launchTemplateConfigs;
resourceInputs["onDemandOptions"] = state?.onDemandOptions;
resourceInputs["region"] = state?.region;
resourceInputs["replaceUnhealthyInstances"] = state?.replaceUnhealthyInstances;
resourceInputs["spotOptions"] = state?.spotOptions;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["targetCapacitySpecification"] = state?.targetCapacitySpecification;
resourceInputs["terminateInstances"] = state?.terminateInstances;
resourceInputs["terminateInstancesWithExpiration"] = state?.terminateInstancesWithExpiration;
resourceInputs["type"] = state?.type;
resourceInputs["validFrom"] = state?.validFrom;
resourceInputs["validUntil"] = state?.validUntil;
}
else {
const args = argsOrState;
if (args?.launchTemplateConfigs === undefined && !opts.urn) {
throw new Error("Missing required property 'launchTemplateConfigs'");
}
if (args?.targetCapacitySpecification === undefined && !opts.urn) {
throw new Error("Missing required property 'targetCapacitySpecification'");
}
resourceInputs["context"] = args?.context;
resourceInputs["excessCapacityTerminationPolicy"] = args?.excessCapacityTerminationPolicy;
resourceInputs["fleetInstanceSets"] = args?.fleetInstanceSets;
resourceInputs["fleetState"] = args?.fleetState;
resourceInputs["fulfilledCapacity"] = args?.fulfilledCapacity;
resourceInputs["fulfilledOnDemandCapacity"] = args?.fulfilledOnDemandCapacity;
resourceInputs["launchTemplateConfigs"] = args?.launchTemplateConfigs;
resourceInputs["onDemandOptions"] = args?.onDemandOptions;
resourceInputs["region"] = args?.region;
resourceInputs["replaceUnhealthyInstances"] = args?.replaceUnhealthyInstances;
resourceInputs["spotOptions"] = args?.spotOptions;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetCapacitySpecification"] = args?.targetCapacitySpecification;
resourceInputs["terminateInstances"] = args?.terminateInstances;
resourceInputs["terminateInstancesWithExpiration"] = args?.terminateInstancesWithExpiration;
resourceInputs["type"] = args?.type;
resourceInputs["validFrom"] = args?.validFrom;
resourceInputs["validUntil"] = args?.validUntil;
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