Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c227866

Browse files
fix: Avoid setting Name tag when a value has not been provided for name (#452)
1 parent 1e7fbd0 commit c227866

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module "ec2_instance" {
1414
1515
name = "single-instance"
1616
17-
instance_type = "t2.micro"
17+
instance_type = "t3.micro"
1818
key_name = "user1"
1919
monitoring = true
2020
subnet_id = "subnet-eddcdzz4"
@@ -36,7 +36,7 @@ module "ec2_instance" {
3636
3737
name = "instance-${each.key}"
3838
39-
instance_type = "t2.micro"
39+
instance_type = "t3.micro"
4040
key_name = "user1"
4141
monitoring = true
4242
subnet_id = "subnet-eddcdzz4"
@@ -60,7 +60,7 @@ module "ec2_instance" {
6060
spot_price = "0.60"
6161
spot_type = "persistent"
6262
63-
instance_type = "t2.micro"
63+
instance_type = "t3.micro"
6464
key_name = "user1"
6565
monitoring = true
6666
subnet_id = "subnet-eddcdzz4"

‎main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010
instance_tags = merge(
1111
var.tags,
1212
var.instance_tags,
13-
{ "Name" = var.name },
13+
var.name!=""?{ "Name" = var.name }: {}
1414
)
1515

1616
instance_id = try(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /