0

I am using AWS CDK (Python) to manage infrastructure, including Amazon Timestream databases and tables.

Suppose i have an existing Timestream table that i want to set permissions on using CDK.

The only way i have seen to get a hold of a Timestream table is to use the CfnTable construct, a so called level 1 construct. This is because Timestream does not expose level 2 constructs yet. However, using this construct, i am creating a table as part of my stack, I am not referencing an existing resource.

For level 2 constructs, such as Function for Lambda, it is possible to reference an existing resource, for example by using the Function.from_function_name() method. I have not found any way of doing something similar for level 1 constructs.

Is it possible? If so, how?

1 Answers1

0

Just use the table's ARN directly as a resource in an IAM identity-based policy. Then add the policy to the appropriate Role, e.g. a Lambda Role.

fedonev
  • 20,327
  • 2
  • 25
  • 34