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]: Columns cannot be single charcters #31348

Closed
bsamsom opened this issue May 11, 2023 · 3 comments · Fixed by #31352
Closed

[Bug]: Columns cannot be single charcters #31348

bsamsom opened this issue May 11, 2023 · 3 comments · Fixed by #31352
Labels
bug Addresses a defect in current functionality. service/keyspaces Issues and PRs that pertain to the keyspaces service.
Milestone

Comments

@bsamsom
Copy link
Contributor

bsamsom commented May 11, 2023

Terraform Core Version

1.4.5

AWS Provider Version

4.66.1

Affected Resource(s)

schema_definition.column

Expected Behavior

Columns can be created that are single chars.

Actual Behavior

The code errors out with: (The name must consist of lower case alphanumerics and underscores.)

Relevant Error/Panic Output Snippet

╷
│ Error: invalid value for schema_definition.0.column.0.name (The name must consist of lower case alphanumerics and underscores.)
│ 
│   with aws_keyspaces_table.example_table,
│   on cassandra.tf line 132, in resource "aws_keyspaces_table" "example_table":
│  132:     column {
│ 
╵
╷
│ Error: invalid value for schema_definition.0.partition_key.0.name (The name must consist of lower case alphanumerics and underscores.)
│ 
│   with aws_keyspaces_table.example_table,
│   on cassandra.tf line 137, in resource "aws_keyspaces_table" "example_table":
│  137:       name = "a"

Terraform Configuration Files

resource "aws_keyspaces_keyspace" "example" {
  name     = "example"
  provider = aws
}

resource "aws_keyspaces_table" "example_table" {
  keyspace_name = aws_keyspaces_keyspace.example.name
  table_name = "example_table"

  schema_definition {
    column {
      name = "a"
      type = "text"
    }
    partition_key {
      name = "a"
    }
  }
}

Steps to Reproduce

Try and add a column thats a single character to a table.

Debug Output

No response

Panic Output

No response

Important Factoids

https:/hashicorp/terraform-provider-aws/blob/main/internal/service/keyspaces/table.go#L205-L209

validation.StringLenBetween(1, 48),
	validation.StringMatch(
		regexp.MustCompile(`^[a-z0-9][a-z0-9_]{1,47}$`),
		"The name must consist of lower case alphanumerics and underscores.",
	),

The column verification allows for a one to 48 character string, but the regex has a hard requirement of at least 2 characters.

References

https:/hashicorp/terraform-provider-aws/blob/main/internal/service/keyspaces/table.go#L205-L209

Would you like to implement a fix?

None

@bsamsom bsamsom added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels May 11, 2023
@github-actions github-actions bot added the service/keyspaces Issues and PRs that pertain to the keyspaces service. label May 11, 2023
@github-actions
Copy link

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.

@bsamsom bsamsom changed the title [Bug]: columns thata re single cahs [Bug]: Columns cannot be single charcters May 11, 2023
bsamsom added a commit to bsamsom/terraform-provider-aws that referenced this issue May 11, 2023
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 12, 2023
ewbankkit added a commit to bsamsom/terraform-provider-aws that referenced this issue Jun 9, 2023
ewbankkit added a commit that referenced this issue Jun 9, 2023
Bug #31348 - update regex for single character columns
@github-actions github-actions bot added this to the v5.3.0 milestone Jun 9, 2023
@github-actions
Copy link

This functionality has been released in v5.3.0 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 Jul 14, 2023
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. service/keyspaces Issues and PRs that pertain to the keyspaces service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants