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

Unable to import cloudflare_ruleset resource into terraform remote state #3482

Closed
3 tasks done
amanlightspeed opened this issue Jul 18, 2024 · 2 comments
Closed
3 tasks done
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.

Comments

@amanlightspeed
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 version - 1.3.7
cloudflare provider version - 3.29.0, 4.1.0, 4.0.0, 4.8.0

Affected resource(s)

cloudflare_ruleset

Terraform configuration files

resource "cloudflare_ruleset" "terraform_managed_resource_<ruleset_id>" {
  kind    = "zone"
  name    = "default"
  phase   = "http_request_firewall_custom"
  zone_id = 
  rules {
   ////
}

Link to debug output

https://gist.github.com/amanlightspeed/bd71d474dd30a5b18dc2ac8965c9d029

Panic output

No response

Expected output

import succesfull and can see the resource imported in state

Actual output

terraform doesnt import the required resource in remote state

Steps to reproduce

  1. terraform import 'cloudflare_ruleset.terraform_managed_resource_' 'zone/'

doesnt import the required resource

Additional factoids

I had used cf-terraforming tool to generate manifest wrt to cloudflare ruleset, now i want to import the resource so that i dont have to reapply the resource config in cloudflare

References

No response

@amanlightspeed amanlightspeed 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 Jul 18, 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 Jul 18, 2024
@amanlightspeed
Copy link
Author

Found the issue, as cloudflare_rulset is a list of rules while importing have to mention

terraform import 'cloudflare_ruleset.terraform_managed_resource_sdsda[0]' 'zone/<zone-id>/ruleset-id'

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. 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

No branches or pull requests

1 participant