Closed benbrd closed 2 months ago
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.
Hi @benbrd
So it works for you with v5.5.0 version of provider, but is still failing with newer ones?
BR, Lukasz
Hi, we are also having the same issue using akamai/akamai 6.2.0 and Terraform 1.8.5. None of the match_target imports are working, we are also trying to run the sh file from the akamai terraform export command.
Forcing 5.5.0 worked for us as a temporary solution as well. Let me know if I can help by providing any more information.
Edit: Forcing 5.5.0 allows the import to work, but running terraform plan
no longer works. I'm assuming that's because the Terraform files created by the export command are not compatible with 5.5.0 since they'd most likely be generated from a newer version.
As a temporary work-around you can still use the latest "akamai terraform" CLI version 1.15.0 and do the following:
appsec-versions.tf
, ./modules/activate-security/versions.tf
and ./modules/security/versions.tf
set version = "= 5.5.0"
appsec-import.sh
comment out all the lines that are NOT imports for the akamai_appsec_match_target
appsec-import.sh
which at this point should initialize the provider 5.5.0 and import only the match targets.version = "= 6.2.0"
. terraform init -upgrade
akamai_appsec_match_target
lines from the appsec-import.sh
file and save it.I tested this with Terraform version 1.7.5, but I don't believe it makes a difference if you use 1.8.5.
Hi @benbrd, this should be fixed in the recent 6.4.0 release.
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
Expected Behavior
Import successful!
Actual Behavior
Error: value not found: match_target
Steps to Reproduce
akamai terraform export-appsec <config_name>
sh ./appsec-import.sh
to start importing the configuration into the local Terraform state.