pulumi-aws: Questions about Naming & Possible Resource Replacement Bug

Code Example:

const myDNSZone = new aws.route53.Zone(‘redactedDomain.me’, { comment: ‘My primary DNS Zone’, });

What it builds:

{
  "comment": "My primary DNS Zone",
  "delegationSetId": "",
  "forceDestroy": false,
  "id": "REDACTED",
  "name": "redactedDomain.me-5fff4ae.",
  "nameServers": [
    "REDACTED.awsdns-24.org",
    "REDACTED.awsdns-41.co.uk",
    "REDACTED.awsdns-37.com",
    "REDACTED.awsdns-48.net"
  ],
  "tags": {},
  "vpcs": [],
  "zoneId": "REDACTED"
}

My Question:

What’s with the -5fff4ae?

Will this actually break DNS, or is it okay to have strings like this in the name, anyway? Couldn’t find an answer so I figured I’s ask.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Hi @armenr

Glad this is working better for you. I understand the frustration here - I will raise it internally and see what we need to do to be better here.

So for the MX records, you still need to provide a name to the struct otherwise pulumi won’t be able to store the resource. So you app could look as follows:

const myDNSZone = new aws.route53.Zone('myDomain.me', {
  comment: 'redactedDomain primary DNS Zone',
});

export const dnsZoneName = myDNSZone.name;

const MX = new aws.route53.Record('google-mx', {
  records: ['1 ASPMX.L.GOOGLE.COM'],
  ttl: 300,
  type: 'MX',
  zoneId: myDNSZone.zoneId,
});

That will create the correct r53 request to AWS for you

Hi @armenr

So, by default, Pulumi actually randomizes the resource that you are trying to use. What you can do in this case, is to actually specify a real name as follows:

const myDNSZone = new aws.route53.Zone('my-primary-domain', {
  name: 'redactedDomain.me',
  comment: 'My primary DNS Zone',
});

That should give you the behaviour you are expecting - please try this and see how you do

Paul