How to use the @pulumi/aws.route53 function in @pulumi/aws

To help you get started, we’ve selected a few @pulumi/aws examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jen20 / pulumi-aws-vpc / src / index.ts View on Github external
// VPC
        const vpcTags = Object.assign({
            Name: `${inputs.description} VPC`,
        }, inputs.baseTags);
        const vpc = new aws.ec2.Vpc(`${baseName}-vpc`, {
            cidrBlock: inputs.baseCidr,
            enableDnsSupport: true,
            enableDnsHostnames: true,
            tags: vpcTags,
        }, instanceParent);
        instance.vpcId = vpc.id;
        const vpcParent = {parent: vpc};

        // Private Hosted Zone
        if (inputs.zoneName !== "") {
            const privateZone = new aws.route53.Zone(`${baseName}-private-hosted-zone`, {
                vpcId: vpc.id,
                name: inputs.zoneName,
                comment: `Private zone for ${inputs.zoneName}. Managed by Pulumi.`,
            }, vpcParent);
            instance.privateHostedZoneId = privateZone.id;

            const dhcpOptionSetTags = Object.assign({
                Name: `${inputs.description} DHCP Options`,
            }, inputs.baseTags);
            const dhcpOptionSet = new aws.ec2.VpcDhcpOptions(`${baseName}-dhcp-options`, {
                domainName: "",
                domainNameServers: ["AmazonProvidedDNS"],
                tags: dhcpOptionSetTags,
            }, vpcParent);
            const dhcpOptionSetParent = {parent: dhcpOptionSet};
github jen20 / pulumi-aws-vpc / nodejs / dist / index.js View on Github external
enableDnsSupport: true,
            enableDnsHostnames: true,
            tags: this.resourceTags({
                Name: `${args.description} VPC`,
            }),
        }, { parent: this });
        // Internet Gateway
        this.internetGateway = new aws.ec2.InternetGateway(`${name}-igw`, {
            vpcId: this.vpc.id,
            tags: this.resourceTags({
                Name: `${args.description} VPC Internet Gateway`,
            }),
        }, { parent: this.vpc });
        // Private Hosted Zone and DHCP Options
        if (args.zoneName) {
            this.privateZone = new aws.route53.Zone(`${name}-private-zone`, {
                vpcs: [{
                        vpcId: this.vpc.id,
                    }],
                name: args.zoneName,
                comment: `Private zone for ${args.zoneName}. Managed by Pulumi.`,
            }, { parent: this });
            this.dhcpOptionSet = new aws.ec2.VpcDhcpOptions(`${name}-dhcp-options`, {
                domainName: this.privateZone.name,
                domainNameServers: ["AmazonProvidedDNS"],
                tags: this.resourceTags({
                    Name: `${args.description} DHCP Options`,
                }),
            }, { parent: this.vpc });
            new aws.ec2.VpcDhcpOptionsAssociation(`${name}-dhcp-options-assoc`, {
                vpcId: this.vpc.id,
                dhcpOptionsId: this.dhcpOptionSet.id,
github pulumi / pulumi-cloud / aws / examples / customDomain / index.ts View on Github external
// Create an HTTP Endpoint.
let endpoint = new awscloud.API("endpoint");
endpoint.get("/", async (req, res) => {
    res.json(req);
});

// Attach our custom domain using the AWS-specific ACM certificate.
endpoint.attachCustomDomain({
    domainName: subdomain + "." + domainName,
    certificateArn: certficateArn,
});
let deployment = endpoint.publish();

// Add a DNS CNAME record for the subdomain pointing to the API custom domain.
let recordSet = new aws.route53.Record(subdomain, {
    name: subdomain,
    zoneId: hostedZoneId,
    type: "A",
    aliases: [{
        name: deployment.customDomains[0].cloudfrontDomainName,
        zoneId: deployment.customDomains[0].cloudfrontZoneId,
        evaluateTargetHealth: false,
    }]
});

// Export the custom domain URL for the HTTP Endpoint.
export let url = pulumi.interpolate `https://${recordSet.fqdn}/`;
github jen20 / pulumi-aws-vpc / dist / index.js View on Github external
const baseName = name.toLowerCase();
            // VPC
            const vpcTags = Object.assign({
                Name: `${inputs.description} VPC`,
            }, inputs.baseTags);
            const vpc = new aws.ec2.Vpc(`${baseName}-vpc`, {
                cidrBlock: inputs.baseCidr,
                enableDnsSupport: true,
                enableDnsHostnames: true,
                tags: vpcTags,
            }, instanceParent);
            instance.vpcId = vpc.id;
            const vpcParent = { parent: vpc };
            // Private Hosted Zone
            if (inputs.zoneName !== "") {
                const privateZone = new aws.route53.Zone(`${baseName}-private-hosted-zone`, {
                    vpcId: vpc.id,
                    name: inputs.zoneName,
                    comment: `Private zone for ${inputs.zoneName}. Managed by Pulumi.`,
                }, vpcParent);
                instance.privateHostedZoneId = privateZone.id;
                const dhcpOptionSetTags = Object.assign({
                    Name: `${inputs.description} DHCP Options`,
                }, inputs.baseTags);
                const dhcpOptionSet = new aws.ec2.VpcDhcpOptions(`${baseName}-dhcp-options`, {
                    domainName: "",
                    domainNameServers: ["AmazonProvidedDNS"],
                    tags: dhcpOptionSetTags,
                }, vpcParent);
                const dhcpOptionSetParent = { parent: dhcpOptionSet };
                new aws.ec2.VpcDhcpOptionsAssociation(`${baseName}-dhcp-options-assoc`, {
                    vpcId: vpc.id,
github pulumi / examples / aws-ts-static-website / index.ts View on Github external
function createAliasRecord(
    targetDomain: string, distribution: aws.cloudfront.Distribution): aws.route53.Record {
    const domainParts = getDomainAndSubdomain(targetDomain);
    const hostedZoneId = aws.route53.getZone({ name: domainParts.parentDomain }, { async: true }).then(zone => zone.zoneId);
    return new aws.route53.Record(
        targetDomain,
        {
            name: domainParts.subdomain,
            zoneId: hostedZoneId,
            type: "A",
            aliases: [
                {
                    name: distribution.domainName,
                    zoneId: distribution.hostedZoneId,
                    evaluateTargetHealth: true,
                },
            ],
        });
}
github pulumi / docs / infrastructure / index.ts View on Github external
async function createAliasRecord(
        targetDomain: string, distribution: aws.cloudfront.Distribution): Promise {
    const domainParts = getDomainAndSubdomain(targetDomain);
    const hostedZone = await aws.route53.getZone({ name: domainParts.parentDomain });
    return new aws.route53.Record(
        targetDomain,
        {
            name: domainParts.subdomain,
            zoneId: hostedZone.zoneId,
            type: "A",
            aliases: [
                {
                    name: distribution.domainName,
                    zoneId: distribution.hostedZoneId,
                    evaluateTargetHealth: true,
                },
            ],
        });
}
const aRecord = createAliasRecord(config.targetDomain, cdn);
github pulumi / examples / aws-ts-full-stack-web-app / dns.ts View on Github external
async function aliasToCloudFront(
        domain: string, subdomain: string,
        cdn: aws.cloudfront.Distribution): Promise {
    const targetDomain = cdn.domainName;
    const cdnZoneId = cdn.hostedZoneId;

    const hostedZone = await aws.route53.getZone({ name: domain });
    const aRecord: aws.route53.Record = new aws.route53.Record(
        `A-record-${subdomain}.${domain}`,
        {
            name: subdomain,
            zoneId: hostedZone.zoneId,
            type: "A",
            aliases: [
                {
                    name: targetDomain,
                    zoneId: cdnZoneId,
                    evaluateTargetHealth: true,
                },
            ],
        });

    return aRecord;
github pulumi / examples / aws-ts-static-website / index.ts View on Github external
function createAliasRecord(
    targetDomain: string, distribution: aws.cloudfront.Distribution): aws.route53.Record {
    const domainParts = getDomainAndSubdomain(targetDomain);
    const hostedZoneId = aws.route53.getZone({ name: domainParts.parentDomain }, { async: true }).then(zone => zone.zoneId);
    return new aws.route53.Record(
        targetDomain,
        {
            name: domainParts.subdomain,
            zoneId: hostedZoneId,
            type: "A",
            aliases: [
                {
                    name: distribution.domainName,
                    zoneId: distribution.hostedZoneId,
                    evaluateTargetHealth: true,
                },
            ],
        });
}
github pulumi / docs / infrastructure / index.ts View on Github external
async function createAliasRecord(
        targetDomain: string, distribution: aws.cloudfront.Distribution): Promise {
    const domainParts = getDomainAndSubdomain(targetDomain);
    const hostedZone = await aws.route53.getZone({ name: domainParts.parentDomain });
    return new aws.route53.Record(
        targetDomain,
        {
            name: domainParts.subdomain,
            zoneId: hostedZone.zoneId,
            type: "A",
            aliases: [
                {
                    name: distribution.domainName,
                    zoneId: distribution.hostedZoneId,
                    evaluateTargetHealth: true,
                },
            ],
        });
}
const aRecord = createAliasRecord(config.targetDomain, cdn);