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

aws_acm_certificate - Tagging is not permitted on re-import. #15055

Closed
frimik opened this issue Sep 7, 2020 · 4 comments · Fixed by #15060
Closed

aws_acm_certificate - Tagging is not permitted on re-import. #15055

frimik opened this issue Sep 7, 2020 · 4 comments · Fixed by #15060
Assignees
Labels
bug Addresses a defect in current functionality. service/acm Issues and PRs that pertain to the acm service.
Milestone

Comments

@frimik
Copy link

frimik commented Sep 7, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.13.2
+ provider registry.terraform.io/-/aws v3.5.0
+ provider registry.terraform.io/-/local v1.4.0
+ provider registry.terraform.io/hashicorp/aws v3.5.0
+ provider registry.terraform.io/hashicorp/local v1.4.0
+ provider registry.terraform.io/hashicorp/null v2.1.2
+ provider registry.terraform.io/hashicorp/template v2.1.2
+ provider registry.terraform.io/hashicorp/tls v2.2.0

Affected Resource(s)

  • aws_acm_certificate

Terraform Configuration Files

resource aws_acm_certificate imported {
  provider = aws.regional

  private_key       = data.local_file.key.content
  certificate_body  = data.local_file.crt.content
  certificate_chain = data.local_file.chain.content

  lifecycle {
    create_before_destroy = true
  }

  tags = {
    Name            = "domain_name"
    Terraform       = "some-infra"
    TerraformModule = "some-modules/aws-acm-certificate-import"
  }

}

Expected Behavior

Update certificate contents but retain tags as-is or perform two API requests separately.

Actual Behavior

Certificate failed to update in place. Error message:

Error: Error updating certificate: ValidationException: Tagging is not permitted on re-import.

Steps to Reproduce

  1. terraform apply
  2. update certificate file contents (from disk or strings)
  3. terraform apply again
  4. observe the error message "Tagging is not permitted on re-import."

References

https://docs.aws.amazon.com/acm/latest/userguide/import-reimport.html states that:

You cannot apply resource tags when reimporting a certificate.

@ghost ghost added the service/acm Issues and PRs that pertain to the acm service. label Sep 7, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 7, 2020
@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 8, 2020
bflad added a commit that referenced this issue Sep 8, 2020
…import error

Reference: #15055

Previously:

```
=== CONT  TestAccAWSAcmCertificate_PrivateKey_Tags
    resource_aws_acm_certificate_test.go:701: Step 3/3 error: terraform failed: exit status 1

        stderr:

        Error: Error updating certificate: ValidationException: Tagging is not permitted on re-import.
```

Output from acceptance testing:

```
--- PASS: TestAccAWSAcmCertificate_disableCTLogging (24.02s)
--- PASS: TestAccAWSAcmCertificate_dnsValidation (24.15s)
--- PASS: TestAccAWSAcmCertificate_emailValidation (25.89s)
--- PASS: TestAccAWSAcmCertificate_imported_DomainName (41.51s)
--- PASS: TestAccAWSAcmCertificate_imported_IpAddress (19.16s)
--- PASS: TestAccAWSAcmCertificate_privateCert (26.40s)
--- PASS: TestAccAWSAcmCertificate_PrivateKey_Tags (30.19s)
--- PASS: TestAccAWSAcmCertificate_root (24.82s)
--- PASS: TestAccAWSAcmCertificate_root_TrailingPeriod (2.41s)
--- PASS: TestAccAWSAcmCertificate_rootAndWildcardSan (23.98s)
--- PASS: TestAccAWSAcmCertificate_san_multiple (24.25s)
--- PASS: TestAccAWSAcmCertificate_san_single (24.21s)
--- PASS: TestAccAWSAcmCertificate_san_TrailingPeriod (26.33s)
--- PASS: TestAccAWSAcmCertificate_SubjectAlternativeNames_EmptyString (2.40s)
--- PASS: TestAccAWSAcmCertificate_tags (53.81s)
--- PASS: TestAccAWSAcmCertificate_wildcard (22.73s)
--- PASS: TestAccAWSAcmCertificate_wildcardAndRootSan (23.47s)
```
@bflad bflad self-assigned this Sep 8, 2020
@bflad
Copy link
Member

bflad commented Sep 8, 2020

Fix submitted: #15060

@bflad bflad added this to the v3.7.0 milestone Sep 14, 2020
bflad added a commit that referenced this issue Sep 14, 2020
…import error (#15060)

Reference: #15055

Previously:

```
=== CONT  TestAccAWSAcmCertificate_PrivateKey_Tags
    resource_aws_acm_certificate_test.go:701: Step 3/3 error: terraform failed: exit status 1

        stderr:

        Error: Error updating certificate: ValidationException: Tagging is not permitted on re-import.
```

Output from acceptance testing:

```
--- PASS: TestAccAWSAcmCertificate_disableCTLogging (24.02s)
--- PASS: TestAccAWSAcmCertificate_dnsValidation (24.15s)
--- PASS: TestAccAWSAcmCertificate_emailValidation (25.89s)
--- PASS: TestAccAWSAcmCertificate_imported_DomainName (41.51s)
--- PASS: TestAccAWSAcmCertificate_imported_IpAddress (19.16s)
--- PASS: TestAccAWSAcmCertificate_privateCert (26.40s)
--- PASS: TestAccAWSAcmCertificate_PrivateKey_Tags (30.19s)
--- PASS: TestAccAWSAcmCertificate_root (24.82s)
--- PASS: TestAccAWSAcmCertificate_root_TrailingPeriod (2.41s)
--- PASS: TestAccAWSAcmCertificate_rootAndWildcardSan (23.98s)
--- PASS: TestAccAWSAcmCertificate_san_multiple (24.25s)
--- PASS: TestAccAWSAcmCertificate_san_single (24.21s)
--- PASS: TestAccAWSAcmCertificate_san_TrailingPeriod (26.33s)
--- PASS: TestAccAWSAcmCertificate_SubjectAlternativeNames_EmptyString (2.40s)
--- PASS: TestAccAWSAcmCertificate_tags (53.81s)
--- PASS: TestAccAWSAcmCertificate_wildcard (22.73s)
--- PASS: TestAccAWSAcmCertificate_wildcardAndRootSan (23.47s)
```
@bflad
Copy link
Member

bflad commented Sep 14, 2020

The fix for this has been merged and will release with version 3.7.0 of the Terraform AWS Provider, later this week. 👍

@ghost
Copy link

ghost commented Sep 17, 2020

This has been released in version 3.7.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Oct 15, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/acm Issues and PRs that pertain to the acm service.
Projects
None yet
2 participants