Skip to content

Commit 46c4fe6

Browse files
authored
Merge pull request #627 from rust-lang/chore-rename-bastion2-to-bastion
chore: rename `bastion2` to `bastion`
2 parents 47be7ce + a5b3dcc commit 46c4fe6

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

terraform/bastion/instance.tf

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,21 @@
22

33
// Associate an elastic IP to the instance.
44

5-
// Some resources are named as "bastion2" because when we updated from ubuntu 20 to ubuntu 24
6-
// we created a new instance (bastion2) and kept the old one (bastion) around for a while.
7-
// When you migrate to a new bastion instance (e.g. to update to ubuntu 26),
8-
// you can name the new resources as "bastion" (instead of "bastion3"), to go back to the original name.
9-
10-
resource "aws_eip" "bastion2" {
5+
resource "aws_eip" "bastion" {
116
domain = "vpc"
127
tags = {
13-
Name = "bastion2"
8+
Name = "bastion"
149
}
1510
}
1611

17-
resource "aws_network_interface" "bastion2" {
12+
resource "aws_network_interface" "bastion" {
1813
subnet_id = data.terraform_remote_state.shared.outputs.prod_vpc.public_subnets[0]
1914
security_groups = [aws_security_group.bastion.id]
2015
}
2116

22-
resource "aws_eip_association" "bastion2" {
23-
network_interface_id = aws_network_interface.bastion2.id
24-
allocation_id = aws_eip.bastion2.id
17+
resource "aws_eip_association" "bastion" {
18+
network_interface_id = aws_network_interface.bastion.id
19+
allocation_id = aws_eip.bastion.id
2520
}
2621

2722
// Create the bastion.infra.rust-lang.org DNS record.
@@ -30,11 +25,11 @@ data "aws_route53_zone" "rust_lang_org" {
3025
name = "rust-lang.org"
3126
}
3227

33-
resource "aws_route53_record" "bastion2" {
28+
resource "aws_route53_record" "bastion" {
3429
zone_id = data.aws_route53_zone.rust_lang_org.id
3530
name = "bastion.infra.rust-lang.org"
3631
type = "A"
37-
records = [aws_eip.bastion2.public_ip]
32+
records = [aws_eip.bastion.public_ip]
3833
ttl = 300
3934
}
4035

@@ -55,7 +50,7 @@ data "aws_ami" "ubuntu24" {
5550
}
5651
}
5752

58-
resource "aws_instance" "bastion2" {
53+
resource "aws_instance" "bastion" {
5954
ami = data.aws_ami.ubuntu24.id
6055
instance_type = "t3a.micro"
6156
key_name = data.terraform_remote_state.shared.outputs.master_ec2_key_pair
@@ -70,12 +65,12 @@ resource "aws_instance" "bastion2" {
7065
}
7166

7267
network_interface {
73-
network_interface_id = aws_network_interface.bastion2.id
68+
network_interface_id = aws_network_interface.bastion.id
7469
device_index = 0
7570
}
7671

7772
tags = {
78-
Name = "bastion2"
73+
Name = "bastion"
7974
Service = "bastion"
8075
}
8176

0 commit comments

Comments
 (0)