hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.75k stars 9.1k forks source link

[Bug]: terraform doesn't support valid Keyspace table complex data type #35787

Open mkamel93 opened 7 months ago

mkamel93 commented 7 months ago

Terraform Core Version

1.7.3

AWS Provider Version

5.35.0

Affected Resource(s)

Expected Behavior

Actual Behavior

Trying to create an AWS keyspace table with column of type frozen<map<text,text>> or set<frozen<map<text, text>>> fails becuase the validate function is forcing the type to must consist of lower case alphanumerics and an optional list of upto two lower case alphanumerics enclosed in angle brackets '<>'.

Relevant Error/Panic Output Snippet

Error: invalid value for schema_definition.0.column.1.type (The type must consist of lower case alphanumerics and an optional list of up to two lower case alphanumerics enclosed in angle brackets '<>'.)

Terraform Configuration Files

https://gist.github.com/mkamel93/2979b6a23c55ce55aede496918bc1443

Steps to Reproduce

Debug Output

this function regex needs to be updated to support that kinds of supported types

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 7 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

MS26 commented 6 months ago

Getting the same error message when running validate with the following column type list<frozen<tuple<uuid, int>>> is there any update on this?

DiegoFalcon commented 3 months ago

Getting the same error when running terraform plan with the column type frozen<list<TEXT>>. Terraform plan doesn't work when creating any nested structured type.

schema_definition.0.column.29.type (The type must consist of lower case alphanumerics and an optional list of upto two lower case alphanumerics enclosed in angle brackets '<>'.)

thomty commented 1 month ago

Experienced this same issue. Looks like an issue with the regex. It only supports up to 1 nested value, whereas keyspaces supports up to 5 by default.

I took a crack at a modified version of the regex that will accept up to 5 layers and submitted a PR for it.

thomty commented 1 month ago

Getting the same error when running terraform plan with the column type frozen<list<TEXT>>. Terraform plan doesn't work when creating any nested structured type.

schema_definition.0.column.29.type (The type must consist of lower case alphanumerics and an optional list of upto two lower case alphanumerics enclosed in angle brackets '<>'.)

FWIW the frozen<list<TEXT>> example won't work as the regex accepts only lowercase. Might be an AWS limitation, but not 100% sure.

DiegoFalcon commented 1 month ago

Experienced this same issue. Looks like an issue with the regex. It only supports up to 1 nested value, whereas keyspaces supports up to 5 by default.

I took a crack at a modified version of the regex that will accept up to 5 layers and submitted a PR for it.

As you mentioned the issue is with the regex as it only supports 1 nested value. The data type frozen<list<TEXT>> can be easily converted to lower case, but still fails due to the nested limitations.

Could you please share the PR so we can keep track on the progress?

thomty commented 1 month ago

Experienced this same issue. Looks like an issue with the regex. It only supports up to 1 nested value, whereas keyspaces supports up to 5 by default. I took a crack at a modified version of the regex that will accept up to 5 layers and submitted a PR for it.

As you mentioned the issue is with the regex as it only supports 1 nested value. The data type frozen<list<TEXT>> can be easily converted to lower case, but still fails due to the nested limitations.

Could you please share the PR so we can keep track on the progress?

Yep! It should be linked above as well: https://github.com/hashicorp/terraform-provider-aws/pull/38525