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

invalid UUID length with list reference #3943

Closed
3 tasks done
FideliusFalcon opened this issue Sep 10, 2024 · 3 comments
Closed
3 tasks done

invalid UUID length with list reference #3943

FideliusFalcon opened this issue Sep 10, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. service/gateway Categorizes issue or PR as related to the Zero Trust Gateway 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

@FideliusFalcon
Copy link

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 v1.9.5
on darwin_arm64

  • provider registry.terraform.io/cloudflare/cloudflare v4.41.0

Affected resource(s)

  • cloudflare_zero_trust_list
  • cloudflare_zero_trust_gateway_policy

Terraform configuration files

resource "cloudflare_zero_trust_list" "allow_test" {
  account_id  = var.cloudflare_account_id
  name        = "allow_test"
  type        = "IP"
  description = "allow_test"
  items       = ["1.1.1.1"]
}

resource "cloudflare_zero_trust_gateway_policy" "test_list_reference" {
  name        = "Test List Reference"
  account_id  = var.cloudflare_account_id
  description = "Test List Reference"
  precedence  = 998
  enabled     = true
  action      = "allow"
  filters     = ["l4"]
  traffic     = "net.dst.ip in $allow_test"
  depends_on  = [cloudflare_zero_trust_list.allow_test]
}

Link to debug output

https://gist.github.com/FideliusFalcon/97029bb34b541144f1821fae309fdafe

Panic output

No response

Expected output

That I could do a reference to the zero trust list

Actual output

error creating Teams rule for account "[redacted]": invalid UUID length: 10
│ with cloudflare_zero_trust_gateway_policy.test_list_reference,
│ on gateway_policies.tf line 23, in resource "cloudflare_zero_trust_gateway_policy" "test_list_reference":
│ 23: resource "cloudflare_zero_trust_gateway_policy" "test_list_reference" {

Steps to reproduce

  1. Try to reference to a zero trust list

Additional factoids

I have tried to reference to the UUID as well, but then it says:

expected literal "{"

I think I have tried everything, but this area is really poorly documented. Either something is wrong or I think it should be documented better.

References

No response

@FideliusFalcon FideliusFalcon 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 Sep 10, 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.

@FideliusFalcon FideliusFalcon changed the title invalid UUID length invalid UUID length with list reference Sep 10, 2024
@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Sep 10, 2024
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/gateway Categorizes issue or PR as related to the Zero Trust Gateway service. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Sep 10, 2024
@s-orodeji
Copy link

Hi there, it seems like the variable isn't being replaced in the traffic string. A format string should replace it for you, ie

traffic = format("net.dst.ip in $%s", cloudflare_teams_list.allow_test.id)

https://developer.hashicorp.com/terraform/language/functions/format

@FideliusFalcon
Copy link
Author

Hi @s-orodeji
I can confirm that the format works. Thank you

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/gateway Categorizes issue or PR as related to the Zero Trust Gateway 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

No branches or pull requests

3 participants