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

(aws-timestream): (Add property for modifying Schema / Partition Key) #26577

Open
2 tasks
wz2b opened this issue Jul 30, 2023 · 2 comments
Open
2 tasks

(aws-timestream): (Add property for modifying Schema / Partition Key) #26577

wz2b opened this issue Jul 30, 2023 · 2 comments
Labels
@aws-cdk/aws-timestream Related to the @aws-cdk/aws-timestream package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p3

Comments

@wz2b
Copy link

wz2b commented Jul 30, 2023

Describe the feature

I need a way from CDK to set the Schema element of CfnTableProps to allow the custom partitioning to work the way I want. Currently, this isn't supported anywhere throughout the stack, including Cloud Formation Cfn* libraries meaning I have no clear options, not even by using L1 constructs. I am unsure how to work around this.

See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-timestream-table-schema.html for a description of what I mean.

Use Case

There is not a clear way to work around this. The table property cannot be modified once the table is created, so you have to be able to do it here. The only workaround I can think of is to remove the tables from CDK entirely and create them by some external means.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.89.0

Environment details (OS name and version, etc.)

Windows and Linux

@wz2b wz2b added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jul 30, 2023
@github-actions github-actions bot added the @aws-cdk/aws-timestream Related to the @aws-cdk/aws-timestream package label Jul 30, 2023
@pahud
Copy link
Contributor

pahud commented Jul 31, 2023

Looks like cloudformation only allows you to set a list of partition keys in the table schema. Does this satisfy your schema requirement?

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jul 31, 2023
@wz2b
Copy link
Author

wz2b commented Jul 31, 2023

Oddly enough I had to submit some doc update requests on the documentation for that, because what you describe is what the object model says its wants but in reality you have to specify a list of exactly length 1.

I was able to find a workaround for this. The workaround is to create the table using the CfnTable L1 construct, then do this:

    table.addPropertyOverride("Schema", {
        "CompositePartitionKey": [
            {"Name": "pk", "Type": "DIMENSION", EnforcementInRecord: "REQUIRED"}
        ]
    });

I described that here

This is all pretty frustrating but it seems to stem from changes made to the API on June 23 and the cloudformation libraries and documentation just haven't caught up yet. I think if the current API is long-lived then it still makes sense to add this to the L1 constructs as proper, typed objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-timestream Related to the @aws-cdk/aws-timestream package effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p3
Projects
None yet
Development

No branches or pull requests

2 participants