UNPKG

@pulumi/aws

Version:

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

93 lines 3.75 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.ApiMapping = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an Amazon API Gateway Version 2 API mapping. * More information can be found in the [Amazon API Gateway Developer Guide](https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.ApiMapping("example", { * apiId: exampleAwsApigatewayv2Api.id, * domainName: exampleAwsApigatewayv2DomainName.id, * stage: exampleAwsApigatewayv2Stage.id, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_apigatewayv2_api_mapping` using the API mapping identifier and domain name. For example: * * ```sh * $ pulumi import aws:apigatewayv2/apiMapping:ApiMapping example 1122334/ws-api.example.com * ``` */ class ApiMapping extends pulumi.CustomResource { /** * Get an existing ApiMapping 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 ApiMapping(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ApiMapping. 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'] === ApiMapping.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiId"] = state?.apiId; resourceInputs["apiMappingKey"] = state?.apiMappingKey; resourceInputs["domainName"] = state?.domainName; resourceInputs["region"] = state?.region; resourceInputs["stage"] = state?.stage; } else { const args = argsOrState; if (args?.apiId === undefined && !opts.urn) { throw new Error("Missing required property 'apiId'"); } if (args?.domainName === undefined && !opts.urn) { throw new Error("Missing required property 'domainName'"); } if (args?.stage === undefined && !opts.urn) { throw new Error("Missing required property 'stage'"); } resourceInputs["apiId"] = args?.apiId; resourceInputs["apiMappingKey"] = args?.apiMappingKey; resourceInputs["domainName"] = args?.domainName; resourceInputs["region"] = args?.region; resourceInputs["stage"] = args?.stage; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ApiMapping.__pulumiType, name, resourceInputs, opts); } } exports.ApiMapping = ApiMapping; /** @internal */ ApiMapping.__pulumiType = 'aws:apigatewayv2/apiMapping:ApiMapping'; //# sourceMappingURL=apiMapping.js.map