File tree 2 files changed +11
-10
lines changed
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ data "aws_ami" "ubuntu_20_04" {
14
14
most_recent = true
15
15
filter {
16
16
name = " name"
17
- values = [" ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" ]
17
+ # Ubuntu 20.04 LTS amd64 image in us-east-1. If upgrade is needed, you would need to re-connect to openvpn.
18
+ values = [" ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20211118" ]
19
+
18
20
}
19
21
filter {
20
22
name = " virtualization-type"
Original file line number Diff line number Diff line change @@ -25,31 +25,30 @@ resource "aws_security_group" "this" {
25
25
Env = var.env
26
26
Name = local.name
27
27
}
28
-
28
+
29
29
lifecycle {
30
30
create_before_destroy = true
31
31
}
32
32
}
33
33
34
34
# EC2
35
35
resource "aws_instance" "this" {
36
- ami = join (" " , data. aws_ami . ubuntu_20_04 . * . id )
37
- instance_type = var. instance_type
38
- iam_instance_profile = aws_iam_instance_profile. this . name
39
- subnet_id = var. private_subnets [0 ]
40
- key_name = var. ec2_key_pair_name
36
+ ami = join (" " , data. aws_ami . ubuntu_20_04 . * . id )
37
+ instance_type = var. instance_type
38
+ iam_instance_profile = aws_iam_instance_profile. this . name
39
+ subnet_id = var. private_subnets [0 ]
40
+ key_name = var. ec2_key_pair_name
41
41
vpc_security_group_ids = concat (var. ext_security_groups , [
42
42
aws_security_group . this . id
43
43
])
44
-
45
- disable_api_termination = var. vpn_enabled ? true : false
44
+
46
45
associate_public_ip_address = false
47
46
48
47
lifecycle {
49
48
ignore_changes = all
50
49
}
51
50
52
- user_data = var. vpn_enabled ? data. template_file . ec2_user_data . rendered : null
51
+ user_data = var. vpn_enabled ? data. template_file . ec2_user_data . rendered : null
53
52
54
53
tags = {
55
54
Terraform = " true"
You can’t perform that action at this time.
0 commit comments