在使用 aws cloudformatiohn deploy 部署时,有没有办法在 S3 Bucket 中指向 cloudformation 模板

Is there a way to point cloudformation template in S3 Bucket while deploying using aws cloudformatiohn deploy

我知道我可以将 aws cloudformation create-stackaws cloudformation update-stack--template-url 开关一起使用,以指向放置在 S3 存储桶中的现有模板。

我想使用 aws cloudformation deploy,用于创建和更新 CloudFormation 堆栈的相同命令,我已将其模板放置在我的 S3 存储桶中。是否可以使用这些选项的任意组合?

以下语法有效,但它首先将模板上传到 S3 存储桶:

aws cloudformation deploy \
    --stack-name my-stack \
    --template-file my-stack-template.yaml \
    --s3-bucket my-bucket \
    --s3-prefix templates \
    --profile my-profile \
    --region us-east-1

它首先将模板 my-stack-template.yaml 上传为类似 my-bucket/templates 中的 1a381d4c65d9a3233450e92588a708b38.template 的内容,我不想要。我希望能够使用已放置在 S3 存储桶中的模板通过此方法部署堆栈,而不需要它位于我的本地计算机上。

遗憾的是没有这样的方法。模板不重新上传的唯一方法是在没有要部署的更改时。如果您想在 S3 中使用预先存在的模板,则必须使用 create-stack