@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
83 lines • 4.7 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 API Gateway REST Deployment. A deployment is a snapshot of the REST API configuration. The deployment can then be published to callable endpoints via the `aws.apigateway.Stage` resource and optionally managed further with the `aws.apigateway.BasePathMapping` resource, `aws.apigateway.DomainName` resource, and `awsApiMethodSettings` resource. For more information, see the [API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-deploy-api.html).
*
* To properly capture all REST API configuration in a deployment, this resource must have dependencies on all prior resources that manage resources/paths, methods, integrations, etc.
*
* * For REST APIs that are configured via OpenAPI specification (`aws.apigateway.RestApi` resource `body` argument), no special dependency setup is needed beyond referencing the `id` attribute of that resource unless additional resources have further customized the REST API.
* * When the REST API configuration involves other resources (`aws.apigateway.Integration` resource), the dependency setup can be done with implicit resource references in the `triggers` argument or explicit resource references using the [resource `dependsOn` custom option](https://www.pulumi.com/docs/intro/concepts/resources/#dependson). The `triggers` argument should be preferred over `dependsOn`, since `dependsOn` can only capture dependency ordering and will not cause the resource to recreate (redeploy the REST API) with upstream configuration changes.
*
* ## Example Usage
*
* ## Import
*
* Using `pulumi import`, import `aws_api_gateway_deployment` using `REST-API-ID/DEPLOYMENT-ID`. For example:
*
* ```sh
* $ pulumi import aws:apigateway/deployment:Deployment example aabbccddee/1122334
* ```
* The `variables` arguments cannot be imported. Use the `aws_api_gateway_stage` resource to import and manage stages.
*
* 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["createdDate"] = state?.createdDate;
resourceInputs["description"] = state?.description;
resourceInputs["region"] = state?.region;
resourceInputs["restApi"] = state?.restApi;
resourceInputs["triggers"] = state?.triggers;
resourceInputs["variables"] = state?.variables;
}
else {
const args = argsOrState;
if (args?.restApi === undefined && !opts.urn) {
throw new Error("Missing required property 'restApi'");
}
resourceInputs["description"] = args?.description;
resourceInputs["region"] = args?.region;
resourceInputs["restApi"] = args?.restApi;
resourceInputs["triggers"] = args?.triggers;
resourceInputs["variables"] = args?.variables;
resourceInputs["createdDate"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Deployment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Deployment = Deployment;
/** @internal */
Deployment.__pulumiType = 'aws:apigateway/deployment:Deployment';
//# sourceMappingURL=deployment.js.map