如何在CDK中引用现有的时间播放表?
我正在使用AWS CDK(Python)来管理基础架构,包括Amazon Timestream数据库和表。
假设我有一个现有的时间播放表,我想在使用CDK时设置权限。
我看到的持有时间播放表的唯一方法是使用cfntable
构造,一种所谓的级别1构造。这是因为时间流尚未公开2级构造。但是,使用此构造,我创建一个表作为堆栈的一部分,我没有引用现有资源。
对于级别2构造,例如lambda的函数
,可以使用function.from_function_name()
方法来引用现有资源。我还没有找到任何对1级结构类似的方式。
是否可以?如果是这样,怎么样?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将表的ARN直接用作IAM 基于身份的策略。然后将策略添加到适当的 a>,例如lambda的角色。
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.