【发布时间】:2021-10-08 14:38:48
【问题描述】:
我正在使用 AWS CLI 和 CloudFormation 创建一个新的 S3 存储桶。 这是我的 yaml 文件:
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an S3 bucket
Parameters:
BucketName:
Description: Name of the Bucket
Type: String
Resources:
ArtifactBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Outputs:
ArtifactBucket:
Value: !Sub ${BucketName}
BucketArn:
Value: !GetAtt ArtifactBucket.Arn
Description: Arn of the new bucket
我在终端窗口中使用以下 cli 命令运行它:
aws cloudformation deploy --stack-name brendan-s3 \
--template-file ComposeEveryApp/create-s3-bucket.yaml \
--profile compose-staging \
--parameter-overrides BucketName=brendan
【问题讨论】:
标签: amazon-web-services yaml command-line-interface amazon-cloudformation