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

SECKSD-28884 akamai_appsec_configuration unable to reference data.akamai_group.group.id #551

Open
alexkunde opened this issue May 3, 2024 · 2 comments

Comments

@alexkunde
Copy link

Terraform and Akamai Terraform Provider Versions

terraform -v                                                                                            1 х │ took 1m 11s │ azr-ed-efs_lmiv_kernanwendung-dev az │ at 13:27:24 
Terraform v1.8.2
on darwin_arm64
+ provider registry.terraform.io/akamai/akamai v6.1.0
+ provider registry.terraform.io/hashicorp/azurerm v3.100.0
+ provider registry.terraform.io/hashicorp/random v3.6.1
+ provider registry.terraform.io/hashicorp/time v0.11.1

Affected Resource(s)

Please list the resources as a list, for example:

  • akamai_appsec_configuration
  • data.akamai_group.group.id

Expected Behavior

When using akamai_appsec_configuration we need the group_id, which should be possible to get from data.akamai_group.group.id

Actual Behavior

akamai_appsec_configuration only expects the group id to be the numerical part whereas data.akamai_group.group.id will provide the number plus prefix

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Incorrect attribute value type
│ 
│   on akamai-property.tf line 63, in resource "akamai_appsec_configuration" "abc":
│   63:  group_id    = data.akamai_group.group.id
│     ├────────────────
│     │ data.akamai_group.group.id is "grp_123456"
│ 
│ Inappropriate value for attribute "group_id": a number is required.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. create a new data source data.akamai_group.group.id
  2. create a new akamai_appsec_configuration
  3. set group_id = data.akamai_group.group.id
  4. terraform plan
@ckulinsk
Copy link
Contributor

ckulinsk commented May 9, 2024

Hello @alexkunde ,

Appsec documentation suggests obtaining of the group id from data.akamai_appsec_contracts_groups.contracts_groups datasource:
https://techdocs.akamai.com/terraform/docs/as-ds-contracts-groups

If you would like to use data.akamai_group.group.id I would suggest parsing it:
parseint(replace(data.akamai_group.group.id, "grp_", ""), 10)

Best regards,
Cyryl

@alexkunde
Copy link
Author

Hi @ckulinsk, thank you for the workaround, but wouldn't it be preferable to not have to use additional functions to implement this with the data field?

Best,
Alexander

@lkowalsk-akamai-com lkowalsk-akamai-com changed the title akamai_appsec_configuration unable to reference data.akamai_group.group.id SECKSD-28884 akamai_appsec_configuration unable to reference data.akamai_group.group.id Oct 4, 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

4 participants