Skip to content
Merged
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
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resource "aws_eip" "this" {
}

resource "aws_security_group" "this" {
name = var.bastion_name
name = var.name
description = "Security group for bastion"
vpc_id = var.vpc_id

Expand Down Expand Up @@ -45,7 +45,7 @@ resource "aws_instance" "this" {
monitoring = true

tags = merge(var.tags, {
Name = var.bastion_name
Name = var.name
})
user_data_replace_on_change = var.user_data_replace_on_change
user_data = data.cloudinit_config.config.rendered
Expand All @@ -57,7 +57,7 @@ resource "aws_instance" "this" {
}

resource "aws_cloudwatch_metric_alarm" "aws_bastion_cpu_threshold" {
alarm_name = "${var.bastion_name}-cpu-alarm"
alarm_name = "${var.name}-cpu-alarm"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "ami_id" {
description = "The AMI ID of the bastion host"
}

variable "bastion_name" {
variable "name" {
description = "The name of the bastion host"
type = string
}
Expand Down