Skip to content

Commit

Permalink
Removed option
Browse files Browse the repository at this point in the history
nuginy committed Apr 27, 2024
1 parent f4e0030 commit cc4fd14
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion learn-terraform-aws-instance/main.tf
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ resource "aws_instance" "app_server" {
})
user_data_replace_on_change = true
lifecycle {
create_before_destroy = var.create_new_before_terminate_old
create_before_destroy = true
}
tags = {
Name = var.instance_name
2 changes: 1 addition & 1 deletion learn-terraform-aws-instance/user-data.sh.tpl
Original file line number Diff line number Diff line change
@@ -2,6 +2,6 @@

apt -y update && apt -y upgrade

echo "Creating file /home/ubuntu/${f_name} with content ${f_content}."
echo "Creating file /home/ubuntu/${f_name} with content ${f_content}"
echo "${f_content}" > /home/ubuntu/${f_name}
cat /home/ubuntu/${f_name}
6 changes: 0 additions & 6 deletions learn-terraform-aws-instance/variables.tf
Original file line number Diff line number Diff line change
@@ -39,9 +39,3 @@ variable "aws_region" {
type = string
default = "eu-west-1"
}

variable "create_new_before_terminate_old" {
description = "Allowing selection if you want to create a new instance before terminating the old one"
type = bool
default = true
}

0 comments on commit cc4fd14

Please sign in to comment.