From a5b3dccb03a78c29a8c9dd5c3772f4a39d33b986 Mon Sep 17 00:00:00 2001 From: MarcoIeni <11428655+MarcoIeni@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:44:57 +0100 Subject: [PATCH] chore: rename `bastion2` to `bastion` --- terraform/bastion/instance.tf | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/terraform/bastion/instance.tf b/terraform/bastion/instance.tf index 2ae2668a3..de1db2310 100644 --- a/terraform/bastion/instance.tf +++ b/terraform/bastion/instance.tf @@ -2,26 +2,21 @@ // Associate an elastic IP to the instance. -// Some resources are named as "bastion2" because when we updated from ubuntu 20 to ubuntu 24 -// we created a new instance (bastion2) and kept the old one (bastion) around for a while. -// When you migrate to a new bastion instance (e.g. to update to ubuntu 26), -// you can name the new resources as "bastion" (instead of "bastion3"), to go back to the original name. - -resource "aws_eip" "bastion2" { +resource "aws_eip" "bastion" { domain = "vpc" tags = { - Name = "bastion2" + Name = "bastion" } } -resource "aws_network_interface" "bastion2" { +resource "aws_network_interface" "bastion" { subnet_id = data.terraform_remote_state.shared.outputs.prod_vpc.public_subnets[0] security_groups = [aws_security_group.bastion.id] } -resource "aws_eip_association" "bastion2" { - network_interface_id = aws_network_interface.bastion2.id - allocation_id = aws_eip.bastion2.id +resource "aws_eip_association" "bastion" { + network_interface_id = aws_network_interface.bastion.id + allocation_id = aws_eip.bastion.id } // Create the bastion.infra.rust-lang.org DNS record. @@ -30,11 +25,11 @@ data "aws_route53_zone" "rust_lang_org" { name = "rust-lang.org" } -resource "aws_route53_record" "bastion2" { +resource "aws_route53_record" "bastion" { zone_id = data.aws_route53_zone.rust_lang_org.id name = "bastion.infra.rust-lang.org" type = "A" - records = [aws_eip.bastion2.public_ip] + records = [aws_eip.bastion.public_ip] ttl = 300 } @@ -55,7 +50,7 @@ data "aws_ami" "ubuntu24" { } } -resource "aws_instance" "bastion2" { +resource "aws_instance" "bastion" { ami = data.aws_ami.ubuntu24.id instance_type = "t3a.micro" key_name = data.terraform_remote_state.shared.outputs.master_ec2_key_pair @@ -70,12 +65,12 @@ resource "aws_instance" "bastion2" { } network_interface { - network_interface_id = aws_network_interface.bastion2.id + network_interface_id = aws_network_interface.bastion.id device_index = 0 } tags = { - Name = "bastion2" + Name = "bastion" Service = "bastion" }