UNPKG

@pulumi/aws

Version:

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

128 lines 5.64 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.DomainName = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages an Amazon API Gateway Version 2 domain name. * 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). * * > **Note:** This resource establishes ownership of and the TLS settings for * a particular domain name. An API stage can be associated with the domain name using the `aws.apigatewayv2.ApiMapping` resource. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.DomainName("example", { * domainName: "ws-api.example.com", * domainNameConfiguration: { * certificateArn: exampleAwsAcmCertificate.arn, * endpointType: "REGIONAL", * securityPolicy: "TLS_1_2", * }, * }); * ``` * * ### Associated Route 53 Resource Record * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.apigatewayv2.DomainName("example", { * domainName: "http-api.example.com", * domainNameConfiguration: { * certificateArn: exampleAwsAcmCertificate.arn, * endpointType: "REGIONAL", * securityPolicy: "TLS_1_2", * }, * }); * const exampleRecord = new aws.route53.Record("example", { * name: example.domainName, * type: aws.route53.RecordType.A, * zoneId: exampleAwsRoute53Zone.zoneId, * aliases: [{ * name: example.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.targetDomainName), * zoneId: example.domainNameConfiguration.apply(domainNameConfiguration => domainNameConfiguration.hostedZoneId), * evaluateTargetHealth: false, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_apigatewayv2_domain_name` using the domain name. For example: * * ```sh * $ pulumi import aws:apigatewayv2/domainName:DomainName example ws-api.example.com * ``` */ class DomainName extends pulumi.CustomResource { /** * Get an existing DomainName 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 DomainName(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DomainName. 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'] === DomainName.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["apiMappingSelectionExpression"] = state ? state.apiMappingSelectionExpression : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["domainName"] = state ? state.domainName : undefined; resourceInputs["domainNameConfiguration"] = state ? state.domainNameConfiguration : undefined; resourceInputs["mutualTlsAuthentication"] = state ? state.mutualTlsAuthentication : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; } else { const args = argsOrState; if ((!args || args.domainName === undefined) && !opts.urn) { throw new Error("Missing required property 'domainName'"); } if ((!args || args.domainNameConfiguration === undefined) && !opts.urn) { throw new Error("Missing required property 'domainNameConfiguration'"); } resourceInputs["domainName"] = args ? args.domainName : undefined; resourceInputs["domainNameConfiguration"] = args ? args.domainNameConfiguration : undefined; resourceInputs["mutualTlsAuthentication"] = args ? args.mutualTlsAuthentication : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["apiMappingSelectionExpression"] = undefined /*out*/; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DomainName.__pulumiType, name, resourceInputs, opts); } } exports.DomainName = DomainName; /** @internal */ DomainName.__pulumiType = 'aws:apigatewayv2/domainName:DomainName'; //# sourceMappingURL=domainName.js.map