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

ID as name issue on example #74

Open
andre-lx opened this issue May 6, 2024 · 2 comments
Open

ID as name issue on example #74

andre-lx opened this issue May 6, 2024 · 2 comments
Labels
bug 🐛 An issue with the system

Comments

@andre-lx
Copy link

andre-lx commented May 6, 2024

Describe the Bug

I'm trying to run the examples/complete scripts but facing the following error:

Terraform planned the following actions, but then encountered a problem:

  # module.waf.aws_wafv2_ip_set.default["rule-110-ip-set"] will be created
  + resource "aws_wafv2_ip_set" "default" {
      + addresses          = [
          + "17.0.0.0/8",
        ]
      + arn                = (known after apply)
      + id                 = (known after apply)
      + ip_address_version = "IPV4"
      + lock_token         = (known after apply)
      + name               = "rule-110-ip-set"
      + scope              = "REGIONAL"
      + tags_all           = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Error: expected length of name to be in the range (1 - 128), got 
│
│   with module.waf.aws_wafv2_web_acl.default[0],
│   on ../../rules.tf line 96, in resource "aws_wafv2_web_acl" "default":96:   name          = module.this.id
│
╵
╷
│ Error: invalid value for name (must contain only alphanumeric hyphen and underscore characters)
│
│   with module.waf.aws_wafv2_web_acl.default[0],
│   on ../../rules.tf line 96, in resource "aws_wafv2_web_acl" "default":96:   name          = module.this.id
│
╵

Adding the name variable no issues occur:

module "waf" {
  source = "../.."

  name = "test-waf"

Expected Behavior

The example should run without issues.

Steps to Reproduce

git clone git@github.com:terraform-aws-modules/terraform-aws-alb.git
cd terraform-aws-waf/examples/complete
terraform init
terraform apply

Screenshots

No response

Environment

No response

Additional Context

No response

@andre-lx andre-lx added the bug 🐛 An issue with the system label May 6, 2024
@andre-lx andre-lx changed the title ID as name is to big on example ID as name issue on example May 6, 2024
@dbazhal
Copy link

dbazhal commented Jun 25, 2024

same here

source = "cloudposse/waf/aws"
version = "1.6.0"

@oleksandrsv
Copy link

same in 1.8.0:

│ Error: expected length of name to be in the range (1 - 128), got 
│ 
│   with module.waf.aws_wafv2_web_acl.default[0],
│   on .terraform/modules/waf/rules.tf line 98, in resource "aws_wafv2_web_acl" "default":
│   98:   name          = module.this.id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

3 participants