UNPKG

@pulumi/aws

Version:

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

70 lines 2.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.getHostedZoneIdOutput = exports.getHostedZoneId = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this data source to get the HostedZoneId of the AWS Elastic Load Balancing (ELB) in a given region for the purpose of using in an AWS Route53 Alias. Specify the ELB type (`network` or `application`) to return the relevant the associated HostedZoneId. Ref: [ELB service endpoints](https://docs.aws.amazon.com/general/latest/gr/elb.html#elb_region) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = aws.lb.getHostedZoneId({}); * const www = new aws.route53.Record("www", { * zoneId: primary.zoneId, * name: "example.com", * type: aws.route53.RecordType.A, * aliases: [{ * name: mainAwsLb.dnsName, * zoneId: main.then(main => main.id), * evaluateTargetHealth: true, * }], * }); * ``` */ function getHostedZoneId(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:lb/getHostedZoneId:getHostedZoneId", { "loadBalancerType": args.loadBalancerType, "region": args.region, }, opts); } exports.getHostedZoneId = getHostedZoneId; /** * Use this data source to get the HostedZoneId of the AWS Elastic Load Balancing (ELB) in a given region for the purpose of using in an AWS Route53 Alias. Specify the ELB type (`network` or `application`) to return the relevant the associated HostedZoneId. Ref: [ELB service endpoints](https://docs.aws.amazon.com/general/latest/gr/elb.html#elb_region) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = aws.lb.getHostedZoneId({}); * const www = new aws.route53.Record("www", { * zoneId: primary.zoneId, * name: "example.com", * type: aws.route53.RecordType.A, * aliases: [{ * name: mainAwsLb.dnsName, * zoneId: main.then(main => main.id), * evaluateTargetHealth: true, * }], * }); * ``` */ function getHostedZoneIdOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:lb/getHostedZoneId:getHostedZoneId", { "loadBalancerType": args.loadBalancerType, "region": args.region, }, opts); } exports.getHostedZoneIdOutput = getHostedZoneIdOutput; //# sourceMappingURL=getHostedZoneId.js.map