Terraform-provider-cloudflare: 2.18.0: Plan fails with panic in a workspace with no changes

Created on 11 Feb 2021  路  1Comment  路  Source: cloudflare/terraform-provider-cloudflare

Terraform version

v0.14.6

Affected resource(s)

There is no clear indication of an error with a particular resource, but there are multiple errors of the following type - vertex "cloudflare_access_policy.policy": dynamic subgraph encountered errors that relate to these resources:

  • cloudflare_access_application
  • cloudflare_access_policy

    Terraform configuration files

    locals {
      cloudflare_account_id = "test_id"
    
      session_duration = "6h"
    
      envs = toset([
        "env1",
        "env2",
      ])
    }
    
    data "terraform_remote_state" "test_state" {
      backend = "atlas"
    
      config = {
        name = "test_org/test_state"
      }
    }
    
    resource "cloudflare_access_application" "test_app" {
      for_each = local.envs
    
      account_id       = local.cloudflare_account_id
      name             = "test-app-${each.value}"
      domain           = "test-app-${each.value}.test-org.com"
      session_duration = local.session_duration
      allowed_idps     = [data.terraform_remote_state.test_state.outputs.gsuite_identity_provider_id]
    }
    
    resource "cloudflare_access_policy" "test_app_gsuite" {
      for_each = local.envs
    
      application_id = cloudflare_access_application.test_app[each.value].id
      account_id     = local.cloudflare_account_id
      name           = "test-app-${each.value} gsuite policy"
      precedence     = 1
      decision       = "allow"
    
      include {
        gsuite {
          identity_provider_id = data.terraform_remote_state.test_state.outputs.gsuite_identity_provider_id
          email                = [
            "[email protected]",
          ]
        }
      }
    }
    

    Debug output

    Panic output

    gist link

    Expected behavior

    Plan should have finished successfully with "no changes" result.

    Actual behavior

    Plan crashes with panic.

    Steps to reproduce

    1. terraform init
    2. terraform apply
    3. terraform plan

  • Important factoids

    References

Community note

  • Please vote on this issue by adding a 馃憤 reaction
    to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull
    request, please leave a comment

kinbug needs-triage

Most helpful comment

thanks for the issue; by the looks of things, this should already be addressed by #940 as it's failing on the GSuite access group.

if you'd like to test that fix works for you, checkout the README on building the provider (https://github.com/cloudflare/terraform-provider-cloudflare#building-the-provider) and you can retry the steps above.

>All comments

thanks for the issue; by the looks of things, this should already be addressed by #940 as it's failing on the GSuite access group.

if you'd like to test that fix works for you, checkout the README on building the provider (https://github.com/cloudflare/terraform-provider-cloudflare#building-the-provider) and you can retry the steps above.

Was this page helpful?
0 / 5 - 0 ratings