Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulumi up --refresh detects spurious diff for wildcard CNAME #160

Open
anentropic opened this issue Nov 15, 2020 · 0 comments
Open

pulumi up --refresh detects spurious diff for wildcard CNAME #160

anentropic opened this issue Nov 15, 2020 · 0 comments
Labels
kind/question Questions about existing features

Comments

@anentropic
Copy link

anentropic commented Nov 15, 2020

I have the following directive:

domain = do.Domain(
    "my-domain",
    name=APPS_DOMAIN,
    ip_address=droplet.ipv4_address,  # will also create an A record
)
do.DnsRecord(
    "my-domain-cname-*",
    domain=domain.name,
    type="CNAME",
    name="*.",
    value=f"{APPS_DOMAIN}.",
)

This successfully creates a wildcard CNAME I can see in DO control panel as:

CNAME | *.mydomain.com | is an alias of mydomain.com.

When I run pulumi up --refresh I see:

~   ├─ digitalocean:index:DnsRecord         my-domain-cname-*           updated     [diff: ~name]

If I select details option I see:

  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:mystack::myproject::pulumi:pulumi:Stack::myproject-mystack]
    ~ digitalocean:index/dnsRecord:DnsRecord: (update)
        [id=121524987]
        [urn=urn:pulumi:mystack::myproject::digitalocean:index/dnsRecord:DnsRecord::my-domain-cname-*]
        [provider=urn:pulumi:mystack::myproject::pulumi:providers:digitalocean::default_3_0_2::45056d4d-7a06-4baa-98bd-2fec03269898]
      ~ name: "*" => "*."

If I go ahead with the update and check the DO control panel afterwards then nothing has changed (which is good, I think it was fine already)

But if I run pulumi up --refresh again it finds the same diff

I believe this is probably due to asymmetry between GET and POST values of the CNAME name in DigitalOcean API... it seems they strip the trailing . in the GET response:

    {
      "id": 121524987,
      "type": "CNAME",
      "name": "*",
      "data": "@",
      "priority": null,
      "port": null,
      "ttl": 1800,
      "weight": null,
      "flags": null,
      "tag": null
    },

but require it in the POST body when adding the record

@infin8x infin8x added kind/question Questions about existing features and removed question labels Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions about existing features
Projects
None yet
Development

No branches or pull requests

4 participants