英文:
How to dynamically create Deployment s3 bucket using AWS SAM CLI
问题
当我运行sam deploy
时,默认情况下它会创建一个部署S3存储桶来保存构建的构件。您可以在终端上的上述命令输出中看到它:
管理的S3存储桶:aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr
可以通过在samconfig.toml
中设置不同的默认S3存储桶,并通过设置resolve_s3=False
来关闭自动解析存储桶。
但我不知道如何覆盖这个行为,也就是通过samconfig.toml
配置SAM CLI,并告诉它在不存在时创建一个具有指定名称的S3存储桶。我正在使用SAM CLI,版本1.81.0
。
英文:
When I'm running sam deploy
, by default it creates a deployment s3 bucket to save the built artifacts. you see it in the output of the command above in your terminal as:
> Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1a4x26zbcdkqr
A different default S3 bucket can be set in samconfig.toml and auto resolution of buckets turned off by setting resolve_s3=False
but I don't know how to override this behavior. meaning that configuring SAM CLI via samconfig.toml
and tell it that creates a s3 bucket with provided name when it doesn't exist.
Im using SAM CLI, version 1.81.0
答案1
得分: 1
你可以尝试执行以下命令:
sam deploy --s3-bucket "YOUR S3 BUCKET"
更多信息请查看这里:https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html
英文:
You can try
sam deploy --s3-bucket "YOUR S3 BUCKET"
More information here: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论