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

After importing cloudflare_zero_trust_access_application into state it shows drift for domain and self_hosted_domains attributes #4659

Open
3 tasks done
justinas-b opened this issue Nov 25, 2024 · 1 comment · May be fixed by #4708
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced

Comments

@justinas-b
Copy link

justinas-b commented Nov 25, 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 -v
Terraform v1.9.8
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v4.46.0

Affected resource(s)

  • cloudflare_zero_trust_access_application
  • cloudflare_access_application

Terraform configuration files

import {
  to = cloudflare_zero_trust_access_application.grafana_production
  id = "${var.cloudflare_account_id}/${local.app_grafana_id}"
}

resource cloudflare_zero_trust_access_application grafana_production {
  account_id                 = var.cloudflare_account_id
  type                       = "self_hosted"
  name                       = "Production Grafana"
  domain                     = "monitoring.mydomain.com"
  self_hosted_domains        = [ "monitoring.mydomain.com" ]
  app_launcher_visible       = true
  allowed_idps               = [local.okta_idp_id]
  tags                       = []
  auto_redirect_to_identity  = false
  session_duration           = "24h"
  enable_binding_cookie      = false
  http_only_cookie_attribute = true
  options_preflight_bypass   = false
}

Link to debug output

https://gist.github.com/justinas-b/3e8fdcd793f09644c3c4ea475d381ec3

Panic output

No response

Expected output

When importing existing application to terraform, i see the drift for self_hosted_domains and domain fields, while I would expect it should not show any drift at all.

Actual output

Account ID, App ID and IdP ID are redacted

  # cloudflare_access_application.grafana_production will be updated in-place
  # (imported from "00000000000000000000000000000000/11111111-2222-3333-4444-555555555555")
  ~ resource "cloudflare_access_application" "grafana_production" {
        account_id                   = "00000000000000000000000000000000"
        allow_authenticate_via_warp  = false
        allowed_idps                 = [
            "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        ]
        app_launcher_logo_url        = null
        app_launcher_visible         = true
        aud                          = "........"
        auto_redirect_to_identity    = false
        bg_color                     = null
        custom_deny_message          = null
        custom_deny_url              = null
        custom_non_identity_deny_url = null
        custom_pages                 = []
      + domain                       = "monitoring.mydomain.com"
        enable_binding_cookie        = false
        header_bg_color              = null
        http_only_cookie_attribute   = true
        id                           = "11111111-2222-3333-4444-555555555555"
        logo_url                     = null
        name                         = "Production Grafana"
        options_preflight_bypass     = false
        same_site_cookie_attribute   = null
      + self_hosted_domains          = [
          + "monitoring.mydomain.com",
        ]
        service_auth_401_redirect    = false
        session_duration             = "24h"
        skip_app_launcher_login_page = false
        skip_interstitial            = false
        tags                         = []
        type                         = "self_hosted"
    }

Steps to reproduce

terraform plan -target cloudflare_zero_trust_access_application.grafana_production to import existing application to the state

Additional factoids

No response

References

No response

@justinas-b justinas-b 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 25, 2024
Copy link
Contributor

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 the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Nov 25, 2024
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/access Categorizes issue or PR as related to the Access service. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. service/access Categorizes issue or PR as related to the Access service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants