@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
97 lines • 4.45 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.IntegrationResponse = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an Amazon API Gateway Version 2 integration response.
* More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api.html).
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.apigatewayv2.IntegrationResponse("example", {
* apiId: exampleAwsApigatewayv2Api.id,
* integrationId: exampleAwsApigatewayv2Integration.id,
* integrationResponseKey: "/200/",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_apigatewayv2_integration_response` using the API identifier, integration identifier and integration response identifier. For example:
*
* ```sh
* $ pulumi import aws:apigatewayv2/integrationResponse:IntegrationResponse example aabbccddee/1122334/998877
* ```
*/
class IntegrationResponse extends pulumi.CustomResource {
/**
* Get an existing IntegrationResponse 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 IntegrationResponse(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of IntegrationResponse. 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'] === IntegrationResponse.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["apiId"] = state?.apiId;
resourceInputs["contentHandlingStrategy"] = state?.contentHandlingStrategy;
resourceInputs["integrationId"] = state?.integrationId;
resourceInputs["integrationResponseKey"] = state?.integrationResponseKey;
resourceInputs["region"] = state?.region;
resourceInputs["responseTemplates"] = state?.responseTemplates;
resourceInputs["templateSelectionExpression"] = state?.templateSelectionExpression;
}
else {
const args = argsOrState;
if (args?.apiId === undefined && !opts.urn) {
throw new Error("Missing required property 'apiId'");
}
if (args?.integrationId === undefined && !opts.urn) {
throw new Error("Missing required property 'integrationId'");
}
if (args?.integrationResponseKey === undefined && !opts.urn) {
throw new Error("Missing required property 'integrationResponseKey'");
}
resourceInputs["apiId"] = args?.apiId;
resourceInputs["contentHandlingStrategy"] = args?.contentHandlingStrategy;
resourceInputs["integrationId"] = args?.integrationId;
resourceInputs["integrationResponseKey"] = args?.integrationResponseKey;
resourceInputs["region"] = args?.region;
resourceInputs["responseTemplates"] = args?.responseTemplates;
resourceInputs["templateSelectionExpression"] = args?.templateSelectionExpression;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IntegrationResponse.__pulumiType, name, resourceInputs, opts);
}
}
exports.IntegrationResponse = IntegrationResponse;
/** @internal */
IntegrationResponse.__pulumiType = 'aws:apigatewayv2/integrationResponse:IntegrationResponse';
//# sourceMappingURL=integrationResponse.js.map
;