Skip to content

Commit db52945

Browse files
committed
Force lowercase or instance and name
1 parent 8e841b3 commit db52945

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

workshop/aws/ec2/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ provider "aws" {
55

66
locals {
77
common_tags = {
8-
Component = "o11y-for-${var.slug}"
8+
Component = "o11y-for-${lower(var.slug)}"
99
Environment = "production"
1010
}
1111
}
@@ -158,7 +158,7 @@ resource "aws_instance" "observability-instance" {
158158
vpc_security_group_ids = [aws_security_group.o11y-ws-sg.id]
159159
user_data = templatefile("${path.module}/templates/userdata.yaml", merge(local.template_vars,
160160
{
161-
instance_name = "${var.slug}-${count.index + 1}"
161+
instance_name = "${lower(var.slug)}-${count.index + 1}"
162162
}))
163163

164164
root_block_device {
@@ -169,8 +169,8 @@ resource "aws_instance" "observability-instance" {
169169
local.common_tags,
170170
{
171171
#Name = "observability-${count.index + 1}"
172-
Instance = "${var.slug}-${format("%02d", count.index + 1)}"
173-
Name = "${var.slug}-${format("%02d", count.index + 1)}"
172+
Instance = "${lower(var.slug)}-${format("%02d", count.index + 1)}"
173+
Name = "${lower(var.slug)}-${format("%02d", count.index + 1)}"
174174
}
175175
)
176176

0 commit comments

Comments
 (0)