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

[Bug]: regression in regexp validation #33368

Closed
dim13 opened this issue Sep 8, 2023 · 7 comments · Fixed by #33371
Closed

[Bug]: regression in regexp validation #33368

dim13 opened this issue Sep 8, 2023 · 7 comments · Fixed by #33371
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/servicediscovery Issues and PRs that pertain to the servicediscovery service.
Milestone

Comments

@dim13
Copy link

dim13 commented Sep 8, 2023

Terraform Core Version

1.5.7

AWS Provider Version

5.16.0

Affected Resource(s)

  • aws_service_discovery_instance
  • maybe more

Expected Behavior

Functional as in v5.15.0

Actual Behavior

Broken as in v5.16.0

Relevant Error/Panic Output Snippet

│ Error: Invalid map key
│
│   with module.database.aws_service_discovery_instance.database,
│   on mod/database/main.tf line 45, in resource "aws_service_discovery_instance" "database":
│   45:     AWS_INSTANCE_CNAME = aws_db_instance.database.address
│
│ Map key expected to match regular expression "^[0-9A-Za-z!~-]+$": AWS_INSTANCE_CNAME
╵
╷
│ Error: Invalid map value
│
│   with module.database.aws_service_discovery_instance.database,
│   on mod/database/main.tf line 45, in resource "aws_service_discovery_instance" "database":
│   45:     AWS_INSTANCE_CNAME = aws_db_instance.database.address
│
│ Map value expected to match regular expression "^([0-9A-Za-z!~-][0-9A-Za-z \\t!~-]*){0,1}[0-9A-Za-z!~-]{0,1}$": AWS_INSTANCE_CNAME =>
│ stage.hidden.eu-central-1.rds.amazonaws.com

Terraform Configuration Files

resource "aws_service_discovery_instance" "database" {
  instance_id = aws_db_instance.database.id
  service_id  = aws_service_discovery_service.database.id
  attributes = {
    AWS_INSTANCE_CNAME = aws_db_instance.database.address
  }
}

Steps to Reproduce

Downgrade module to v5.15.0 -- works. Update to v5.16.0 -- broken.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

Possible cause or point of interest: 8963cdd

Would you like to implement a fix?

None

@dim13 dim13 added the bug Addresses a defect in current functionality. label Sep 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 8, 2023
@github-actions github-actions bot added the service/servicediscovery Issues and PRs that pertain to the servicediscovery service. label Sep 8, 2023
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Sep 8, 2023
@ewbankkit
Copy link
Contributor

ewbankkit commented Sep 8, 2023

Relates #33359.

@ewbankkit
Copy link
Contributor

ewbankkit commented Sep 8, 2023

From the AWS Cloud Map API Reference:

Type: String to string map
Key Length Constraints: Maximum length of 255.
Key Pattern: ^[a-zA-Z0-9!-~]+$
Value Length Constraints: Maximum length of 1024.
Value Pattern: ^([a-zA-Z0-9!-~][ \ta-zA-Z0-9!-~]*){0,1}[a-zA-Z0-9!-~]{0,1}$

@ewbankkit ewbankkit added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Sep 8, 2023
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 8, 2023
@ewbankkit
Copy link
Contributor

% make testacc TESTARGS='-run=TestAccServiceDiscoveryInstance_private' PKG=servicediscovery
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/servicediscovery/... -v -count 1 -parallel 20  -run=TestAccServiceDiscoveryInstance_private -timeout 180m
=== RUN   TestAccServiceDiscoveryInstance_private
=== PAUSE TestAccServiceDiscoveryInstance_private
=== CONT  TestAccServiceDiscoveryInstance_private
    instance_test.go:27: Step 1/3 error: Error running pre-apply refresh: exit status 1
        
        Error: Invalid map key
        
          with aws_service_discovery_instance.test,
          on terraform_plugin_test.tf line 40, in resource "aws_service_discovery_instance" "test":
          40:     AWS_INSTANCE_IPV4 = "10.0.0.1" 
        
        Map key expected to match regular expression "^[0-9A-Za-z!~-]+$":
        AWS_INSTANCE_IPV4
        
        Error: Invalid map value
        
          with aws_service_discovery_instance.test,
          on terraform_plugin_test.tf line 40, in resource "aws_service_discovery_instance" "test":
          40:     AWS_INSTANCE_IPV4 = "10.0.0.1" 
        
        Map value expected to match regular expression "^([0-9A-Za-z!~-][0-9A-Za-z
        \\t!~-]*){0,1}[0-9A-Za-z!~-]{0,1}$": AWS_INSTANCE_IPV4 => 10.0.0.1
        
        Error: Invalid map key
        
          with aws_service_discovery_instance.test,
          on terraform_plugin_test.tf line 41, in resource "aws_service_discovery_instance" "test":
          41:     AWS_INSTANCE_IPV6 = "2001:0db8:85a3:0000:0000:abcd:0001:2345"
        
        Map key expected to match regular expression "^[0-9A-Za-z!~-]+$":
        AWS_INSTANCE_IPV6
        
        Error: Invalid map value
        
          with aws_service_discovery_instance.test,
          on terraform_plugin_test.tf line 41, in resource "aws_service_discovery_instance" "test":
          41:     AWS_INSTANCE_IPV6 = "2001:0db8:85a3:0000:0000:abcd:0001:2345"
        
        Map value expected to match regular expression "^([0-9A-Za-z!~-][0-9A-Za-z
        \\t!~-]*){0,1}[0-9A-Za-z!~-]{0,1}$": AWS_INSTANCE_IPV6 =>
        2001:0db8:85a3:0000:0000:abcd:0001:2345
--- FAIL: TestAccServiceDiscoveryInstance_private (2.67s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/servicediscovery	7.723s
FAIL
make: *** [testacc] Error 1

@dim13
Copy link
Author

dim13 commented Sep 8, 2023

Thanks! Works.

@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Sep 11, 2023
@github-actions
Copy link

This functionality has been released in v5.16.1 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/servicediscovery Issues and PRs that pertain to the servicediscovery service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants