@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
77 lines • 3.59 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.Deployment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an Amazon API Gateway Version 2 deployment.
* More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
*
* > **Note:** Creating a deployment for an API requires at least one `aws.apigatewayv2.Route` resource associated with that API. To avoid race conditions when all resources are being created together, you need to add implicit resource references via the `triggers` argument or explicit resource references using the [resource `dependsOn` meta-argument](https://www.pulumi.com/docs/intro/concepts/programming-model/#dependson).
*
* ## Example Usage
*
* ## Import
*
* Using `pulumi import`, import `aws_apigatewayv2_deployment` using the API identifier and deployment identifier. For example:
*
* ```sh
* $ pulumi import aws:apigatewayv2/deployment:Deployment example aabbccddee/1122334
* ```
* The `triggers` argument cannot be imported.
*/
class Deployment extends pulumi.CustomResource {
/**
* Get an existing Deployment 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 Deployment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Deployment. 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'] === Deployment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiId"] = state?.apiId;
resourceInputs["autoDeployed"] = state?.autoDeployed;
resourceInputs["description"] = state?.description;
resourceInputs["region"] = state?.region;
resourceInputs["triggers"] = state?.triggers;
}
else {
const args = argsOrState;
if (args?.apiId === undefined && !opts.urn) {
throw new Error("Missing required property 'apiId'");
}
resourceInputs["apiId"] = args?.apiId;
resourceInputs["description"] = args?.description;
resourceInputs["region"] = args?.region;
resourceInputs["triggers"] = args?.triggers;
resourceInputs["autoDeployed"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Deployment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Deployment = Deployment;
/** @internal */
Deployment.__pulumiType = 'aws:apigatewayv2/deployment:Deployment';
//# sourceMappingURL=deployment.js.map