1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
0
【以下的回答经过翻译处理】 你好,
希望你一切顺利!
你是正确的。当SSEAlgorithm
是AES256
类型时,KMSMasterKeyID
不应存在。因此,你应该检查SSEAlgorithm
类型,而不是KMSKeysProvided
。请检查以下更新后的示例。
# 版本: 1.0
AWSTemplateFormatVersion: "2010-09-09"
Description: 使用CloudFormation模板创建标准化的S3存储桶
Parameters:
BucketName:
Type: String
Description: "S3存储桶的名称"
KMSKeyArn:
Type: String
Description: "用于加密S3存储桶的KMS密钥ARN"
Default: ""
SSEAlgorithm:
Type: String
Description: "KMS加密算法"
AllowedValues:
- aws:kms
- AES256
Conditions:
KMSKeysProvided: !Not [!Equals [!Ref KMSKeyArn, ""]]
Conditions:
AES256: !Equals [!Ref SSEAlgorithm, "AES256"]
Resources:
S3Bucket:
Type: 'AWS::S3::Bucket'
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
BucketName: !Ref BucketName
PublicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
BucketEncryption:
ServerSideEncryptionConfiguration:
- !If
- AES256
- ServerSideEncryptionByDefault:
SSEAlgorithm: !Ref SSEAlgorithm
BucketKeyEnabled: true
- ServerSideEncryptionByDefault:
SSEAlgorithm: !Ref SSEAlgorithm
KMSMasterKeyID: !Ref KMSKeyArn
BucketKeyEnabled: true
希望这对你有帮助。
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren