Skip to content

terraform import on bigip_waf_policy is broken on 1.22.9 (but works on 1.22.8) #1072

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

Open
marcosdiez opened this issue Apr 23, 2025 · 3 comments

Comments

@marcosdiez
Copy link

Environment

  • TMOS/Bigip Version: BIG-IP 17.1.2.1 Build 0.0.2 Point Release 1
  • Terraform Version: v1.7.4
  • Terraform bigip provider Version: v1.22.9

Summary

Using the provider version 1.22.8, I can do something like
terraform import module.lvf_auth.bigip_waf_policy.this 6s3AxJsLGy6QBSLazRvL5w;

On version 1.22.9 it fails with something like

╷
│ Error: error Exporting waf policy `` with : [ERROR] WafPolicy import failed with :{File: Message:Could not export the Policy '/Common/Base_ASM_Policy'.  Entity Type/Kind '' has no matching entity type}
│
│

The same error also happens with the data resource

Steps To Reproduce

data "bigip_waf_policy" "existpolicy" {
  policy_id = "6s3AxJsLGy6QBSLazRvL5w" ### PUT YOUR POLICY ID HERE
}

output "existpolicy" {
  value = data.bigip_waf_policy.existpolicy
}

terraform init
terraform plan

Expected Behavior

Import should work

Actual Behavior

it fails with the error I pasted above

@marcosdiez marcosdiez added the bug label Apr 23, 2025
@pgouband
Copy link
Collaborator

Hi @marcosdiez,

I tested the following with success.

main.tf file

resource "bigip_waf_policy" "this" {
  partition            = "Common"
  name                 = "scenario2"
  template_name        = "POLICY_TEMPLATE_RAPID_DEPLOYMENT"
}
$ terraform import bigip_waf_policy.this EdchwjSqo9cFtYP-iWUJmw
bigip_waf_policy.this: Importing from ID "EdchwjSqo9cFtYP-iWUJmw"...
bigip_waf_policy.this: Import prepared!
  Prepared bigip_waf_policy for import
bigip_waf_policy.this: Refreshing state... [id=EdchwjSqo9cFtYP-iWUJmw]

Import successful!

The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.

You are using a module lvf_auth and I think what you shared is the main.tf of the module.
Could you confirm?
Also could you share your main.tf calling the module?

@marcosdiez
Copy link
Author

Hi. The problem is not my terraform module, but my WAF policy.

So I have to provide you the export of my waf json and you try to import that one.

Because of my job, I can't upload to a public place. Can I do it though a normal F5 support ticket ? If not, how else do you suggest we do it ?

@pgouband
Copy link
Collaborator

Hi @marcosdiez,

I understand and I'm not asking you to share the policy here.
If the issue is on WAF, this is not the right place.
Yes, you can open a support case and they will help to understand where is the issue.
If the issue is on WAF, WAF engineer will help you.
If the issue is on Terraform provider, you need to ask support engineer to escalate to ecosystem team (like any Ansible case).

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

No branches or pull requests

2 participants