@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
133 lines • 5.53 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 CodeBuild Fleet Resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.codebuild.Fleet("test", {
* baseCapacity: 2,
* computeType: "BUILD_GENERAL1_SMALL",
* environmentType: "LINUX_CONTAINER",
* name: "full-example-codebuild-fleet",
* overflowBehavior: "QUEUE",
* scalingConfiguration: {
* maxCapacity: 5,
* scalingType: "TARGET_TRACKING_SCALING",
* targetTrackingScalingConfigs: [{
* metricType: "FLEET_UTILIZATION_RATE",
* targetValue: 97.5,
* }],
* },
* });
* ```
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.codebuild.Fleet("example", {name: "example-codebuild-fleet"});
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeBuild Fleet using the `name`. For example:
*
* ```sh
* $ pulumi import aws:codebuild/fleet:Fleet name fleet-name
* ```
*/
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["baseCapacity"] = state?.baseCapacity;
resourceInputs["computeConfiguration"] = state?.computeConfiguration;
resourceInputs["computeType"] = state?.computeType;
resourceInputs["created"] = state?.created;
resourceInputs["environmentType"] = state?.environmentType;
resourceInputs["fleetServiceRole"] = state?.fleetServiceRole;
resourceInputs["imageId"] = state?.imageId;
resourceInputs["lastModified"] = state?.lastModified;
resourceInputs["name"] = state?.name;
resourceInputs["overflowBehavior"] = state?.overflowBehavior;
resourceInputs["region"] = state?.region;
resourceInputs["scalingConfiguration"] = state?.scalingConfiguration;
resourceInputs["statuses"] = state?.statuses;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcConfigs"] = state?.vpcConfigs;
}
else {
const args = argsOrState;
if (args?.baseCapacity === undefined && !opts.urn) {
throw new Error("Missing required property 'baseCapacity'");
}
if (args?.computeType === undefined && !opts.urn) {
throw new Error("Missing required property 'computeType'");
}
if (args?.environmentType === undefined && !opts.urn) {
throw new Error("Missing required property 'environmentType'");
}
resourceInputs["baseCapacity"] = args?.baseCapacity;
resourceInputs["computeConfiguration"] = args?.computeConfiguration;
resourceInputs["computeType"] = args?.computeType;
resourceInputs["environmentType"] = args?.environmentType;
resourceInputs["fleetServiceRole"] = args?.fleetServiceRole;
resourceInputs["imageId"] = args?.imageId;
resourceInputs["name"] = args?.name;
resourceInputs["overflowBehavior"] = args?.overflowBehavior;
resourceInputs["region"] = args?.region;
resourceInputs["scalingConfiguration"] = args?.scalingConfiguration;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcConfigs"] = args?.vpcConfigs;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["lastModified"] = undefined /*out*/;
resourceInputs["statuses"] = 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:codebuild/fleet:Fleet';
//# sourceMappingURL=fleet.js.map
;