Skip to content

Commit

Permalink
Update AMI ID (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
epicfaace authored Sep 15, 2023
1 parent 10c0419 commit ae75292
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
20 changes: 1 addition & 19 deletions infrastructure/database.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,6 @@ resource "aws_db_instance" "db" {
}
}

data "aws_ami" "ubuntu" {

most_recent = true

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}

# Canonical
owners = ["513442679011"]
}

resource "aws_iam_role" "db_accessor" {
name = "crossfeed-db-accessor-${var.stage}"
assume_role_policy = <<EOF
Expand Down Expand Up @@ -139,7 +121,7 @@ EOF

resource "aws_instance" "db_accessor" {
count = var.create_db_accessor_instance ? 1 : 0
ami = data.aws_ami.ubuntu.id
ami = var.ami_id
instance_type = var.db_accessor_instance_class
associate_public_ip_address = false

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/elastic.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

resource "aws_instance" "elk_stack" {
count = var.create_elk_instance ? 1 : 0
ami = data.aws_ami.ubuntu.id
ami = var.ami_id
instance_type = var.elk_instance_class
associate_public_ip_address = false

Expand Down
1 change: 1 addition & 0 deletions infrastructure/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ create_db_accessor_instance = true
db_accessor_instance_class = "t3.2xlarge"
create_elk_instance = false
elk_instance_class = "t3.2xlarge"
ami_id = "ami-064cd328d8f9a9f00"
1 change: 1 addition & 0 deletions infrastructure/stage.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ create_db_accessor_instance = true
db_accessor_instance_class = "t3.2xlarge"
create_elk_instance = true
elk_instance_class = "t3.2xlarge"
ami_id = "ami-064cd328d8f9a9f00"
6 changes: 6 additions & 0 deletions infrastructure/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -400,3 +400,9 @@ variable "create_elk_instance" {
type = bool
default = false
}

variable "ami_id" {
description = "ID of the AMI to use for EC2 instances."
type = string
default = "ami-064cd328d8f9a9f00"
}

0 comments on commit ae75292

Please sign in to comment.