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

DXE-3681 SECKSD-25367 Terraform import match_target - Error : Value not found: match_target #546

Open
benbrd opened this issue Apr 23, 2024 · 2 comments

Comments

@benbrd
Copy link

benbrd commented Apr 23, 2024

terraform import match_target issue causing duplicate match_target resources created in security configuration as the previous one is not sync with the tfstate file.
This is a blocker for our customers trying to manage their security configuration as code.

Terraform Version

$ terraform -v Terraform v1.8.1 on linux_amd64

Affected Resource(s)

terraform import akamai_appsec_match_target

Debug Output

module.security.akamai_appsec_match_target.website_7863884: Importing from ID "101079:7863884"...
module.security.akamai_appsec_match_target.website_7863884: Import prepared!
  Prepared akamai_appsec_match_target for import
module.security.akamai_appsec_match_target.website_7863884: Refreshing state... [id=101079:7863884]
╷
│ Error: value not found: match_target
│
│
╵

Expected Behavior

Import successful!

Actual Behavior

Error: value not found: match_target

Steps to Reproduce

  1. Use Akamai CLI to export an existing security configuration with command akamai terraform export-appsec <config_name>
  2. Run sh ./appsec-import.sh to start importing the configuration into the local Terraform state.
@benbrd
Copy link
Author

benbrd commented Apr 23, 2024

After some testing on my side it appears that when forcing with v5.5.0 of the provider, the import is successful :

$ terraform import module.security.akamai_appsec_match_target.website_7863884 101079:7863884
module.security.data.akamai_group.group: Reading...
module.security.data.akamai_group.group: Read complete after 1s [id=grp_215942]
module.security.akamai_appsec_match_target.website_7863884: Importing from ID "101079:7863884"...
module.security.akamai_appsec_match_target.website_7863884: Import prepared!
  Prepared akamai_appsec_match_target for import
module.security.akamai_appsec_match_target.website_7863884: Refreshing state... [id=101079:7863884]

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.

@lsadlon
Copy link

lsadlon commented Apr 23, 2024

Hi @benbrd

So it works for you with v5.5.0 version of provider, but is still failing with newer ones?

BR,
Lukasz

@lsadlon lsadlon changed the title Terraform import match_target - Error : Value not found: match_target DXE-3681 Terraform import match_target - Error : Value not found: match_target Apr 23, 2024
@lsadlon lsadlon changed the title DXE-3681 Terraform import match_target - Error : Value not found: match_target DXE-3681 SECKSD-25367 Terraform import match_target - Error : Value not found: match_target Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants