热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

DeletionPolicyAttributeRetain

Hithere,TerraformVersionallAffectedResource(s)Please

Hi there,

Terraform Version

all

Affected Resource(s)

Please list the resources as a list, for example:
- aws_s3_bucket, s3 is a sample, this feature should be applied to most resources.
- meta-parameters: lifecycle

Terraform lifecycle has three attributes: create_before_destroy, prevent_destroy, ignore_changes, but doesn't support attribute

1
retain

which AWS CFN supported.

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

Terraform Configuration Files

1
2
3
4
5
6
7
hcl

resource "aws_s3_bucket" {

   ...

   lifecycle {

     retain = true|false

   }

}


Expected Behavior

Need

1
retain

option works as in AWS Cloudformation. Related document is at http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html

To keep a resource when its stack is deleted, specify

1
Retain

for that resource.

1
You can use retain for any resource

. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

Actual Behavior

No this option

该提问来源于开源项目:hashicorp/terraform-provider-aws

This would be useful for our deployment process. It mostly uses terraform, but it also uploads our Javascript bundles to S3 with immutable filenames, which are eventually cleaned up by S3 lifecycle policies. We tried using terraform for this, but it deletes previous versions which are gone from the local filesystem, so we're currently using aws-cli instead.





   



推荐阅读
author-avatar
mobiledu2502905213
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有