2
votes

I am trying to import a few AWS WAF ACLs into an existing terraform deployment. I have tried both variations of the code.

#version 1:

resource "aws_waf_web_acl" "mywaf" {
  # (resource arguments)
}

$ terraform import aws_waf_web_acl.mywaf id-xxxx-xxx

Error: aws_waf_web_acl.mywaf (import id: xxxx-xxx): 1 error(s) occurred Terraform detected a resource with this ID doesn't exist. Please verify the ID is correct.

#version 2:

resource "aws_wafregional_web_acl" "mywaf" {
  # (resource arguments)
}

$ terraform import aws_wafregional_web_acl.mywaf id-xxxx-xxx

Error: aws_wafregional_web_acl doesn't support import

I have verified that the ID is correct. Is this possible with AWS provider 1.45? Thanks.

1
It turns out you were right regarding incorrect ID. I was able to get that by using the command: aws waf --region us-east-1 list-web-aclsuser2518691

1 Answers

1
votes

Seems the id is wrong.

From the sample

terraform import aws_waf_web_acl.main 0c8e583e-18f3-4c13-9e2a-67c4805d2f94

it is uuid, not id-xxx

And for second resource, it clearly claims that this resource doesn't support import feature currently

reference: https://www.terraform.io/docs/providers/aws/r/wafregional_web_acl.html