Skip to content

Commit

Permalink
Merge pull request #8 from hazelops/CORE-634-ubuntu-version-not-found…
Browse files Browse the repository at this point in the history
…-terraform-aws-ec-2-openvpn-connector

CORE-634 ubuntu-version-not-found-terraform-aws-ec-2-openvpn-connector
  • Loading branch information
kobrikx authored Dec 3, 2023
2 parents 33f7663 + 5cf1bec commit 0835492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ data "template_file" "ec2_user_data" {
}
}

data "aws_ami" "ubuntu_20_04" {
data "aws_ami" "ubuntu_22_04" {
most_recent = true
filter {
name = "name"
# Ubuntu 20.04 LTS amd64 image in us-east-1. If upgrade is needed, you would need to re-connect to openvpn.
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20211118"]

}
filter {
name = "virtualization-type"
values = ["hvm"]
# Ubuntu 22.04 LTS amd64 image in us-east-1. If upgrade is needed, you would need to re-connect to openvpn.
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20230601"]
}
owners = ["099720109477"] # Canonical
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "aws_security_group" "this" {

# EC2
resource "aws_instance" "this" {
ami = join("", data.aws_ami.ubuntu_20_04.*.id)
ami = join("", data.aws_ami.ubuntu_22_04.*.id)
instance_type = var.instance_type
iam_instance_profile = aws_iam_instance_profile.this.name
subnet_id = var.private_subnets[0]
Expand Down

0 comments on commit 0835492

Please sign in to comment.