gpt4 book ai didi

amazon-web-services - AWS 云信息 : How do I check if a bucket exists from within the Cloudformation template?

转载 作者:行者123 更新时间:2023-12-03 07:23:30 30 4
gpt4 key购买 nike

在我的 CloudFormation 模板中,仅当 S3 尚无名称中包含特定关键字的存储桶时,我才会尝试创建 S3 存储桶。例如,如果我的关键字是“图片”,则仅当 S3 中的存储桶名称中不包含“图片”一词时,我才希望创建此 S3 存储桶。

    "Resources": {
"myBucket": {
"Condition" : "<NO_S3_BUCKET_WITH_'picture'_IN_ITS_NAME_IN_THIS_ACCOUNT>",
"Type": "AWS::S3::Bucket",
"Properties": {
<SOME_PROPERTIES>
}
},
<OTHER_RESOURCES>
}

这可能吗?如果是,是否可以使用其他 AWS 资源(CloudFront Distribution 等)来完成?

最佳答案

Is this possible?

不适用于普通的 CloudFormation。您必须开发一个 custom resource来做到这一点。

关于amazon-web-services - AWS 云信息 : How do I check if a bucket exists from within the Cloudformation template?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67591615/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com