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

标签 amazon-web-services amazon-s3 aws-cloudformation

在我的 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/

相关文章:

python - 使用持续交付构建 AWS Lambda 的扩展

java - Amazon S3 Java SDK 多文件上传

apache-spark - SparkSQL - 一些分区出现在 HiveServer2 但不是 SparkSQL

amazon-s3 - Amazon S3 的端点有哪些?

amazon-web-services - 云信息 AWS : choose between Security Groups

aws-cloudformation - 如何使用辅助构建规范文件

amazon-web-services - 如何仅在创建 AWS::Cloudformation::Stack 时调用 AWS::Lambda::Function?

amazon-web-services - Terraform - 策略中的每条语句都应该只有一个资源

java - 收到致命警报 : handshake_failure even after disabling SSL

android - 从移动应用程序使用 AWS(特别是 S3)的首选方式是什么?