UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

103 lines 5.86 kB
"use strict"; // *** 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.RestApi = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an API Gateway REST API. The REST API can be configured via [importing an OpenAPI specification](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-import-api.html) in the `body` argument (with other arguments serving as overrides) or via other provider resources to manage the resources (`aws.apigateway.Resource` resource), methods (`aws.apigateway.Method` resource), integrations (`aws.apigateway.Integration` resource), etc. of the REST API. Once the REST API is configured, the `aws.apigateway.Deployment` resource can be used along with the `aws.apigateway.Stage` resource to publish the REST API. * * > **Note:** Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 resources. * * !> **WARN:** When importing Open API Specifications with the `body` argument, by default the API Gateway REST API will be replaced with the Open API Specification thus removing any existing methods, resources, integrations, or endpoints. Endpoint mutations are asynchronous operations, and race conditions with DNS are possible. To overcome this limitation, use the `putRestApiMode` attribute and set it to `merge`. * * ## Example Usage * * ## Import * * Using `pulumi import`, import `aws_api_gateway_rest_api` using the REST API ID. For example: * * ```sh * $ pulumi import aws:apigateway/restApi:RestApi example 12345abcde * ``` * ~> __NOTE:__ Resource import does not currently support the `body` attribute. */ class RestApi extends pulumi.CustomResource { /** * Get an existing RestApi 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 RestApi(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RestApi. 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'] === RestApi.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiKeySource"] = state?.apiKeySource; resourceInputs["arn"] = state?.arn; resourceInputs["binaryMediaTypes"] = state?.binaryMediaTypes; resourceInputs["body"] = state?.body; resourceInputs["createdDate"] = state?.createdDate; resourceInputs["description"] = state?.description; resourceInputs["disableExecuteApiEndpoint"] = state?.disableExecuteApiEndpoint; resourceInputs["endpointConfiguration"] = state?.endpointConfiguration; resourceInputs["executionArn"] = state?.executionArn; resourceInputs["failOnWarnings"] = state?.failOnWarnings; resourceInputs["minimumCompressionSize"] = state?.minimumCompressionSize; resourceInputs["name"] = state?.name; resourceInputs["parameters"] = state?.parameters; resourceInputs["policy"] = state?.policy; resourceInputs["putRestApiMode"] = state?.putRestApiMode; resourceInputs["region"] = state?.region; resourceInputs["rootResourceId"] = state?.rootResourceId; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; resourceInputs["apiKeySource"] = args?.apiKeySource; resourceInputs["binaryMediaTypes"] = args?.binaryMediaTypes; resourceInputs["body"] = args?.body; resourceInputs["description"] = args?.description; resourceInputs["disableExecuteApiEndpoint"] = args?.disableExecuteApiEndpoint; resourceInputs["endpointConfiguration"] = args?.endpointConfiguration; resourceInputs["failOnWarnings"] = args?.failOnWarnings; resourceInputs["minimumCompressionSize"] = args?.minimumCompressionSize; resourceInputs["name"] = args?.name; resourceInputs["parameters"] = args?.parameters; resourceInputs["policy"] = args?.policy; resourceInputs["putRestApiMode"] = args?.putRestApiMode; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createdDate"] = undefined /*out*/; resourceInputs["executionArn"] = undefined /*out*/; resourceInputs["rootResourceId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RestApi.__pulumiType, name, resourceInputs, opts); } } exports.RestApi = RestApi; /** @internal */ RestApi.__pulumiType = 'aws:apigateway/restApi:RestApi'; //# sourceMappingURL=restApi.js.map