@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
133 lines • 6.13 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, 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["baseCapacity"] = state ? state.baseCapacity : undefined;
resourceInputs["computeConfiguration"] = state ? state.computeConfiguration : undefined;
resourceInputs["computeType"] = state ? state.computeType : undefined;
resourceInputs["created"] = state ? state.created : undefined;
resourceInputs["environmentType"] = state ? state.environmentType : undefined;
resourceInputs["fleetServiceRole"] = state ? state.fleetServiceRole : undefined;
resourceInputs["imageId"] = state ? state.imageId : undefined;
resourceInputs["lastModified"] = state ? state.lastModified : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["overflowBehavior"] = state ? state.overflowBehavior : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["scalingConfiguration"] = state ? state.scalingConfiguration : undefined;
resourceInputs["statuses"] = state ? state.statuses : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["vpcConfigs"] = state ? state.vpcConfigs : undefined;
}
else {
const args = argsOrState;
if ((!args || args.baseCapacity === undefined) && !opts.urn) {
throw new Error("Missing required property 'baseCapacity'");
}
if ((!args || args.computeType === undefined) && !opts.urn) {
throw new Error("Missing required property 'computeType'");
}
if ((!args || args.environmentType === undefined) && !opts.urn) {
throw new Error("Missing required property 'environmentType'");
}
resourceInputs["baseCapacity"] = args ? args.baseCapacity : undefined;
resourceInputs["computeConfiguration"] = args ? args.computeConfiguration : undefined;
resourceInputs["computeType"] = args ? args.computeType : undefined;
resourceInputs["environmentType"] = args ? args.environmentType : undefined;
resourceInputs["fleetServiceRole"] = args ? args.fleetServiceRole : undefined;
resourceInputs["imageId"] = args ? args.imageId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["overflowBehavior"] = args ? args.overflowBehavior : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["scalingConfiguration"] = args ? args.scalingConfiguration : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcConfigs"] = args ? args.vpcConfigs : undefined;
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