Skip to content

Add lifecycle create_before_destroy #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# AWS EC2 Instance Terraform module

## Grouper fork
Forked from
[terraform-aws-modules/terraform-aws-ec2-instance](https://github.com/Element3Health/terraform-aws-ec2-instance)

Only to add lifecycle hoook of create_before_destroy to the instance resource.


Terraform module which creates an EC2 instance on AWS.

[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
Expand Down
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ resource "aws_instance" "this" {

tags = merge({ "Name" = var.name }, var.instance_tags, var.tags)
volume_tags = var.enable_volume_tags ? merge({ "Name" = var.name }, var.volume_tags) : null

lifecycle {
create_before_destroy = true
}
}

################################################################################
Expand Down
Loading