简体   繁体   English

CDK 仅在不存在时创建新的托管策略

[英]CDK create new managed policy only if doesn't exist

I'm setting up infrastructure using AWS CDK.我正在使用 AWS CDK 设置基础设施。 Is there any way I can check if a Managed Policy already exists?有什么方法可以检查托管策略是否已存在?

I'm setting up infrastructure using AWS CDK.我正在使用AWS CDK设置基础架构。 Is there any way I can check if a Managed Policy already exists?有什么方法可以检查托管策略是否已经存在?

You can import the npm package cdk-constants .您可以导入 npm 包cdk-constants It "aims to be an up to date constants library for all things AWS".它“旨在成为所有 AWS 事物的最新常量库”。

While you can't use cdk-constants to programmatically check if a Managed Policy exists, you can inspect the library to see what Managed Policies are available.虽然您不能使用 cdk-constants 以编程方式检查托管策略是否存在,但您可以检查库以查看哪些托管策略可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM