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

Incorrect terraform plan Output for tencentcloud_cdn_domain #413

Closed
jianzhiteh opened this issue May 19, 2020 · 1 comment
Closed

Incorrect terraform plan Output for tencentcloud_cdn_domain #413

jianzhiteh opened this issue May 19, 2020 · 1 comment
Assignees

Comments

@jianzhiteh
Copy link

Description

  • Resource tencentcloud_cdn_domain always return changes when terraform plan or terraform apply
  • server_certificate_config.certificate_content, server_certificate_config.private_key` will always display "Add".
  • server_certificate_config.certificate_name will always display "Changed".
  • I've checked from the terraform.tfstate file, it seems that the information in No 2, 3 aren't recorded.

Terraform Version

Terraform v0.12.24
+ provider.tencentcloud v1.33.0

Affected Resource(s)

  • tencentcloud_cdn_domain

Terraform Configuration Files

resource "tencentcloud_cdn_domain" "webserver_cdn" {
  domain         = local.my_domain_here
  service_type   = "web"
  area           = "mainland"
  full_url_cache = false

  origin {
    origin_type          = "ip"
    origin_list          = [local.my_origin_ip_here]
    origin_pull_protocol = "http"
  }

  https_config {
    https_switch         = "on"
    http2_switch         = "on"
    ocsp_stapling_switch = "on"
    spdy_switch          = "on"
    verify_client        = "off"

    server_certificate_config {
      certificate_name    = "web-server-ssl"
      certificate_content = local.ssl_fullchain_here
      private_key         = local.ssl_private_key_here
    }
  }
}

Debug Output

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.web_server.tencentcloud_cdn_domain.webserver_cdn["my_domain_here"] will be updated in-place
  ~ resource "tencentcloud_cdn_domain" "webserver_cdn" {
        area           = "mainland"
        cname          = "my_cname_here"
        create_time    = "2020-05-19 16:42:08"
        domain         = "my_domain_here"
        full_url_cache = false
        id             = "my_domain_here"
        service_type   = "web"
        status         = "online"
        tags           = {}

      ~ https_config {
            http2_switch         = "on"
            https_switch         = "on"
            ocsp_stapling_switch = "on"
            spdy_switch          = "on"
            verify_client        = "off"

          - client_certificate_config {}

          ~ server_certificate_config {
              + certificate_content = <<~EOT
                    -----BEGIN CERTIFICATE-----
                    key_content_here
                    -----END CERTIFICATE-----
                    -----BEGIN CERTIFICATE-----
                    key_content_here
                    -----END CERTIFICATE-----
                EOT
              ~ certificate_name    = "my_domain_name" -> "basic-web-server"
              + private_key         = <<~EOT
                    -----BEGIN PRIVATE KEY-----
                    key_content_here
                    -----END PRIVATE KEY-----
                EOT
            }
        }

        origin {
            backup_origin_list   = []
            cos_private_access   = "off"
            origin_list          = [
                "xx.xx.xx.xx",
                "xx.xx.xx.xx",
            ]
            origin_pull_protocol = "http"
            origin_type          = "ip"
        }
    }

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

Steps to Reproduce

  1. terraform apply
  2. After done with the terraform apply, run terraform apply once again.

Expected Behavior

  1. Second terraform apply / terraform plan should returns / display no resource changes as no source code has been updated since the last creation of resource.
@oliverpei oliverpei self-assigned this May 19, 2020
@oliverpei
Copy link
Contributor

Hi @jianzhiteh , sorry for the trouble.
The problem has been fixed and released in v1.33.1, please have a try.
In addition, the certificate name does not support customization, the default value is the domain name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants