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

CertificatePack Import Issue #4543

Closed
3 tasks done
miladibra10 opened this issue Nov 9, 2024 · 2 comments · Fixed by #4544
Closed
3 tasks done

CertificatePack Import Issue #4543

miladibra10 opened this issue Nov 9, 2024 · 2 comments · Fixed by #4544
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Milestone

Comments

@miladibra10
Copy link
Contributor

miladibra10 commented Nov 9, 2024

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform: 1.8.1
Provider: v4.45.0

Affected resource(s)

  • cloudflare_certificate_pack

Terraform configuration files

terraform {
  required_version = "~> 1.8.0"

  required_providers {
    cloudflare = {
      source  = "cloudflare/cloudflare"
      version = ">= 4.45.0"
    }
  }
}



provider "cloudflare" {
  api_token = "[redacted]"
}


resource "cloudflare_certificate_pack" "example" {
  certificate_authority  = "digicert"
  cloudflare_branding    = null
  hosts                  = ["*.example.com", "example.com", "*.monitoring.example.com"]
  type                   = "advanced"
  validation_method      = "txt"
  validity_days          = 30
  wait_for_active_status = null
  zone_id                = "[redacted]"
}

import {
  id = "[redacted]/[redacted]"
  to = cloudflare_certificate_pack.example
}

Link to debug output

https://gist.github.com/miladibra10/10201ff1294e037565c533b0d174f3b7

Panic output

Expected output

I expect an import without any destroy and re-creation.

Actual output

Output:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # cloudflare_certificate_pack.example must be replaced
  # (imported from "[redacted]/[redacted]")
  # Warning: this will destroy the imported resource
-/+ resource "cloudflare_certificate_pack" "example" {
      + certificate_authority  = "digicert" # forces replacement
        hosts                  = [
            "*.example.com",
            "*.monitoring.example.com",
            "example.com",
        ]
      ~ id                     = "[redacted]" -> (known after apply)
        type                   = "advanced"
      + validation_method      = "txt" # forces replacement
      + validity_days          = 30 # forces replacement
      + wait_for_active_status = false # forces replacement
        zone_id                = "[redacted]"
    }

Plan: 1 to import, 1 to add, 0 to change, 1 to destroy.

Steps to reproduce

  1. Create an advanced certificate in Cloudflare Dashboard
  2. Write Terraform resource and Import Block corresponding to it like the expamle provided.
  3. Try to import it.

Additional factoids

As I took a look on provider implementation, It seems the code does not read the value of these three required fields:

  • certificate_authority
  • validation_method
  • validity_days

References

No response

@miladibra10 miladibra10 added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 9, 2024
Copy link
Contributor

github-actions bot commented Nov 9, 2024

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. labels Nov 9, 2024
@github-actions github-actions bot added this to the v4.47.0 milestone Nov 13, 2024
Copy link
Contributor

This functionality has been released in v4.47.0 of the Terraform Cloudflare 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. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant