简体   繁体   English

我们应该如何使用 Cloud Formation 模板更新 S3 存储桶上的默认加密?

[英]How should we Update default encryption on S3 buckets using Cloud Formation Template?

we have pre-existing Cloudformation Stack which created few ec2 Instances and couple of s3 buckets with its policies stuff.我们有预先存在的 Cloudformation Stack,它创建了几个 ec2 实例和几个带有策略内容的 s3 存储桶。 But the default encryption was not set.但未设置默认加密。

All i was trying do is to up update the existing stack to set Default Encryption to AES-256 using below code.我试图做的就是使用以下代码更新现有堆栈以将默认加密设置为AES-256 But it is failing stating "test-encryption-sbox4 already exists in stack".但它没有说明“test-encryption-sbox4 已经存在于堆栈中”。 Im not trying to create s3 but just trying update existing buckets policy.我不是在尝试创建 s3,而是在尝试更新现有的存储桶策略。

Is it valid to update the S3 encryption via stack after it got created ?创建后通过堆栈更新 S3 加密是否有效? or do we need to take care of it which its creation time ?还是我们需要照顾它的创建时间? Can anyone please suggest how to updates existing bucket policy via CF.任何人都可以建议如何通过 CF 更新现有的存储桶策略。

Code which i used.我使用的代码。 How do you set SSE-S3 or SSE-KMS encryption on S3 buckets using Cloud Formation Template? 如何使用 Cloud Formation 模板在 S3 存储桶上设置 SSE-S3 或 SSE-KMS 加密?

You are getting this error because your bucket is not under control of CFN.您收到此错误是因为您的存储桶不受 CFN 的控制。 Thus, CFN tries to re-create this bucket.因此,CFN 尝试重新创建此存储桶。

If the bucket has been created outside of CFN, eg manually in console, then you have to import it into CloudFormation stack first.如果桶已经创建CFN以外,如手动控制台,那么你必须导入它首先进入CloudFormation堆栈。 Only, after that you can updated it from CFN.只有在此之后,您才能从 CFN 更新它。

Without that, CFN will try to create the same bucket, which obviously results in your error.否则,CFN 将尝试创建相同的存储桶,这显然会导致您的错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用云编队模板在S3存储桶上设置SSE-S3或SSE-KMS加密? - How do you set SSE-S3 or SSE-KMS encryption on S3 buckets using Cloud Formation Template? 现有 VPC 中 s3 的云形成模板 - cloud formation template for s3 in existing VPC 如何在不使用云形成模板中的互联网访问的情况下将 ec2 连接到 s3 - how to connect ec2 to s3 without using internet access in cloud formation template 使用 Python boto3 对大量存储桶进行 S3 默认服务器端加密 - S3 Default server side encryption on large number of buckets using Python boto3 如何通过Javascript SDK获取Amazon S3存储桶的默认加密设置 - How to get the default encryption settings of amazon S3 buckets via Javascript SDK Cloud Formation:S3 bucket和Lambda的单独cloudformation模板 - Cloud Formation: separate cloudformation template of S3 bucket and Lambda 具有Cloud Formation的Api Gateway S3代理将不接受存储桶ARN,但将接受所有存储桶 - Api Gateway S3 Proxy with Cloud Formation wont accept Bucket ARN but will accept all buckets 在现有 s3 存储桶上启用默认加密是否需要对存储桶用户进行任何 IAM 更改? - Does enabling default encryption on the existing s3 buckets requires any IAM change for the buckets users? 如何使用 AWS CLI 为多个 S3 存储桶启用服务器端加密? - How to enable server side encryption for multiple S3 buckets using AWS CLI? 我们如何使用 AWS 云形成模板创建跨区域 RDS 只读副本? - How can we create cross region RDS read replica using AWS cloud formation template?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM