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

ACM Certificate Replace subjectAlternativeNames #1384

Closed
mark-bixler opened this issue Mar 9, 2021 · 6 comments
Closed

ACM Certificate Replace subjectAlternativeNames #1384

mark-bixler opened this issue Mar 9, 2021 · 6 comments
Assignees
Labels
bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. kind/bug Some behavior is incorrect or out of spec resolution/no-repro This issue wasn't able to be reproduced

Comments

@mark-bixler
Copy link

Running a new pulumi preview against my 2 SAN's results in Pulumi wanting to replace my Certificate.

I've noticed a past issue #1022 but that was closed and resolved.

I'm on the latest versions:

v2.22.0
@pulumi/aws@3.32.0

Expected behavior

Expected behavior is to not detect any changes. List has stayed static. No changes between up / preview

Current behavior

Pulumi tries to replace resource.

@mark-bixler mark-bixler added the kind/bug Some behavior is incorrect or out of spec label Mar 9, 2021
@lukehoban
Copy link
Member

What property does the update say has changed, and from what to what? Can you share the preview --diff output?

@mark-bixler
Copy link
Author

For sure!...some names have been replaced with generic.

╰─❯ pulumi preview --diff
Previewing update (dev)

View Live: https://app.pulumi.com/mark-bixler/example.io/dev/previews/88331707-f555-441f-860a-aa709eb8cf20

  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::example.io::pulumi:pulumi:Stack::example.io-dev]
    +-aws:acm/certificate:Certificate: (replace)
        [id=arn:aws:acm:us-east-1:208123456789:certificate/678536c4-2b68-4dc4-a74c-5239ef541758]
        [urn=urn:pulumi:dev::example.io::aws:acm/certificate:Certificate::example.io-cert]
        [provider=urn:pulumi:dev::example.io::pulumi:providers:aws::secondary::9ce33a40-5ee3-4c1c-afa4-36bcec07fe0e]
      ~ subjectAlternativeNames: [
          + [0]: "example.io"
        ]
    --outputs:--        
  ~ certArn            : "arn:aws:acm:us-east-1:208123456789:certificate/678536c4-2b68-4dc4-a74c-5239ef541758" => output<string>
    + aws:s3/bucketPolicy:BucketPolicy: (create)
        [urn=urn:pulumi:dev::example.io::aws:s3/bucketPolicy:BucketPolicy::bucketPolicy]
        [provider=urn:pulumi:dev::example.io::pulumi:providers:aws::default_3_32_0::948060e5-ede3-4862-bf87-e2bfbc26d127]
        bucket    : "example.io"
        policy    : "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::example.io/*\"]}]}"
    ~ aws:cloudfront/distribution:Distribution: (update)
        [id=EBBYHAD0APXL8]
        [urn=urn:pulumi:dev::example.io::aws:cloudfront/distribution:Distribution::example.io-cf-distro]
        [provider=urn:pulumi:dev::example.io::pulumi:providers:aws::primary::ac20fd92-9f83-422c-8c3c-c947763de93b]
      ~ viewerCertificate: {
          ~ acmCertificateArn           : "arn:aws:acm:us-east-1:208123456789:certificate/678536c4-2b68-4dc4-a74c-5239ef541758" => output<string>
          ~ cloudfrontDefaultCertificate: false => true
        }
    - aws:acm/certificateValidation:CertificateValidation: (delete)
        [id=2021-03-09 00:33:06 +0000 UTC]
        [urn=urn:pulumi:dev::example.io::aws:acm/certificateValidation:CertificateValidation::example.io-cert-validation]
        [provider=urn:pulumi:dev::example.io::pulumi:providers:aws::secondary::9ce33a40-5ee3-4c1c-afa4-36bcec07fe0e]
        certificateArn       : "arn:aws:acm:us-east-1:208123456789:certificate/678536c4-2b68-4dc4-a74c-5239ef541758"
        validationRecordFqdns: [
            [0]: "_9ca52926eee1c50c11627e3f8f6a2746.example.io"
        ]
    - aws:route53/record:Record: (delete)
        [id=Z065202617WF6N3Z5GA22__9ca52926eee1c50c11627e3f8f6a2746.example.io._CNAME]
        [urn=urn:pulumi:dev::example.io::aws:route53/record:Record::example.io-validation-record]
        [provider=urn:pulumi:dev::example.io::pulumi:providers:aws::secondary::9ce33a40-5ee3-4c1c-afa4-36bcec07fe0e]
        name                      : "_9ca52926eee1c50c11627e3f8f6a2746.example.io."
        records                   : [
            [0]: "_8b6c64a336a9f5a2b9770f3b007f0a0c.nfyddsqlcy.acm-validations.aws."
        ]
        ttl                       : 60
        type                      : "CNAME"
        zoneId                    : "Z065202617WF6N3Z5GA22"
Resources:
    + 1 to create
    ~ 1 to update
    - 2 to delete
    +-1 to replace
    5 changes. 6 unchanged 

The code block for cert (did not change..was just adding a new bucket policy)..

const cert = new aws.acm.Certificate(
	  `${bucketName}-cert`,
	  {
	    domainName: bucketName,
	    subjectAlternativeNames: [
	      bucketName, `*.${bucketName}`
	    ],
	    tags,
	    validationMethod: 'DNS',
	  },
	  {
	    provider: secondary,
	  },
	);

@flo-kn
Copy link

flo-kn commented Jul 20, 2022

Experiencing the same. Issues still seems to exist on pulumi version v3.36.0. Any updates on a solution / workaround?


     Type                              Name                                 Plan        Info
     pulumi:pulumi:Stack               whatever                   2 messages
 +-  ├─ aws:acm:Certificate            myservice-certificate                    replace     [diff: ~subjectAlternativeNames]
 +-  ├─ aws:acm:CertificateValidation  myservice-certificate-validation         replace     [diff: ~certificateArn]
 +-  └─ aws:route53:Record             myservice-certificate-validation-record  replace     [diff: ~name,records]

Even get it when just feeding in one value into the subjectAlternativeNames array.

@t0yv0 t0yv0 added the bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. label Dec 13, 2023
@t0yv0 t0yv0 added the needs-repro Needs repro steps before it can be triaged or fixed label Mar 28, 2024
@t0yv0
Copy link
Member

t0yv0 commented Mar 28, 2024

If anyone has an example program here to reproduce, that would make it much easier. Thank you!

@flo-kn
Copy link

flo-kn commented Apr 18, 2024

Not 100% sure anymore. Would have a hard time to repro the scenario again today. But don't want to leave it unanswered:

It must have been in the broader context of providing certs to pulumi-helm (very vague, I know). As said not sure but hope that it helps, must have been something similar to this that produced the issue:

const cert = new aws.acm.Certificate(`myservice-certificate`, {
    domainName: `myService.myDomainName`,
    validationMethod: "DNS",
    subjectAlternativeNames: [`${config.targetDomain}`]
});

const validationRecord = new aws.route53.Record(
    `myservice-certificate-validation-record`,
    {
      type: aws.route53.RecordType.CNAME,
      name: recordName,
      records: [recordValue],
      zoneId,
      ttl: 1800,
});

const configCertValidation = new aws.acm.CertificateValidation(
    `myservice-certificate-validation`,
    {
      certificateArn: cert.arn,
    }
);

@t0yv0 t0yv0 added needs-triage Needs attention from the triage team and removed needs-repro Needs repro steps before it can be triaged or fixed labels Apr 18, 2024
@t0yv0 t0yv0 added this to the 0.104 milestone Apr 19, 2024
@t0yv0 t0yv0 removed the needs-triage Needs attention from the triage team label Apr 19, 2024
@mikhailshilkov mikhailshilkov removed this from the 0.104 milestone Jun 5, 2024
@t0yv0 t0yv0 added the resolution/no-repro This issue wasn't able to be reproduced label Sep 13, 2024
@t0yv0
Copy link
Member

t0yv0 commented Sep 13, 2024

Closing this as stale as we still couldn't quite reproduce. If you're experiencing something similar, opening a new issue with a self-contained repro would be very helpful!

@t0yv0 t0yv0 closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/diff kind/bug related to Pulumi generating wrong diffs on preview or up. kind/bug Some behavior is incorrect or out of spec resolution/no-repro This issue wasn't able to be reproduced
Projects
None yet
Development

No branches or pull requests

5 participants