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]: AWS Timestreamwrite Table resource does not accept multiple composite partition keys #32560

Closed
saratnulu opened this issue Jul 18, 2023 · 7 comments
Labels
bug Addresses a defect in current functionality. service/timestreamwrite Issues and PRs that pertain to the timestreamwrite service.

Comments

@saratnulu
Copy link

Terraform Core Version

1.0

AWS Provider Version

5.8.0

Affected Resource(s)

As per the AWS API reference, we can define a list of composite_partition_keys for a Timestream table
https://docs.aws.amazon.com/ko_kr/timestream/latest/developerguide/API_Schema.html#timestream-Type-Schema-CompositePartitionKey

Expected Behavior

As per AWS API reference composite partition keys is a list of maps. So, should accept the code as in below format

resource "aws_timestreamwrite_table" "example" {
  database_name = aws_timestreamwrite_database.example.database_name
  table_name    = "example"

  schema {
    composite_partition_key = [
    {
      enforcement_in_record = "REQUIRED"
      name                  = "attr1"
      type                  = "DIMENSION"
    },
    {
      enforcement_in_record = "REQUIRED"
      name                  = "attr2"
      type                  = "DIMENSION"
    }
    ]
  }
}

Actual Behavior

Above syntax is not allowed and also when we try to create composite_partition_keys as multiple blocks inside a schema block, i receive below error

No more than 1 "composite_partition_key" blocks are allowed

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/timestreamwrite/table.go#L140

Steps to Reproduce

No way to define multiple composite partition keys for different dimension attributes

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@saratnulu saratnulu added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jul 18, 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.

@github-actions github-actions bot added the service/timestreamwrite Issues and PRs that pertain to the timestreamwrite service. label Jul 18, 2023
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 20, 2023
@ewbankkit
Copy link
Contributor

@saratnulu Thanks for raising this issue 👏.
Although the API schema does allow multiple partition keys in the composite partition key, currently if you try to configure more than 1 there is an error:

ValidationException: You have specified too many partition keys to be used in your composite partition key. Only 1 partition keys can be specified.

@saratnulu
Copy link
Author

saratnulu commented Jul 20, 2023

@saratnulu Thanks for raising this issue 👏. Although the API schema does allow multiple partition keys in the composite partition key, currently if you try to configure more than 1 there is an error:

ValidationException: You have specified too many partition keys to be used in your composite partition key. Only 1 partition keys can be specified.

@ewbankkit , is this because of the restriction in table_test.go file or restriction by AWS ?
When i try to create table with multiple partition kets manually it works.

@ewbankkit
Copy link
Contributor

@saratnulu That was at the API level (have removed the Terraform schema MaxItems: 1).
Can you paste in how you created with multiple partition keys? Thanks.

@ewbankkit ewbankkit reopened this Jul 20, 2023
@saratnulu
Copy link
Author

saratnulu commented Jul 21, 2023

@ewbankkit , I did validation post your message again and looks like i created a table by providing list of partition keys in name field as comma seperated values in aws console. I noticied this doesn't work as the attribute name is taken as "attr1, attr2" instead of 2 keys. So, its my ignorance.
image

I agree with you that it's AWS API limitation. Though schema supports, API doesn't support multiple partition keys.

You can close the bug now

@saratnulu
Copy link
Author

Closing with above comment

@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 Aug 20, 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/timestreamwrite Issues and PRs that pertain to the timestreamwrite service.
Projects
None yet
Development

No branches or pull requests

2 participants