Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions terraform/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,17 @@ resource "aws_subnet" "national_parks_subnet" {
////////////////////////////////
// Instance Data

data "aws_ami" "centos" {
data "aws_ami" "rhel7" {
most_recent = true

owners = ["309956199498"]
filter {
name = "name"
values = ["chef-highperf-centos7-*"]
values = ["RHEL-7.?*GA*"]
}

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

owners = ["446539779517"]
}

8 changes: 4 additions & 4 deletions terraform/aws/national-parks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resource "aws_instance" "permanent_peer" {
private_key = file(var.aws_key_pair_file)
}

ami = data.aws_ami.centos.id
ami = data.aws_ami.rhel7.id
instance_type = var.test_server_instance_type
key_name = var.aws_key_pair_name
subnet_id = aws_subnet.national_parks_subnet.id
Expand Down Expand Up @@ -82,7 +82,7 @@ resource "aws_instance" "mongodb" {
private_key = file(var.aws_key_pair_file)
}

ami = data.aws_ami.centos.id
ami = data.aws_ami.rhel7.id
instance_type = var.test_server_instance_type
key_name = var.aws_key_pair_name
subnet_id = aws_subnet.national_parks_subnet.id
Expand Down Expand Up @@ -168,7 +168,7 @@ resource "aws_instance" "national_parks" {
private_key = file(var.aws_key_pair_file)
}

ami = data.aws_ami.centos.id
ami = data.aws_ami.rhel7.id
instance_type = var.test_server_instance_type
key_name = var.aws_key_pair_name
subnet_id = aws_subnet.national_parks_subnet.id
Expand Down Expand Up @@ -246,7 +246,7 @@ resource "aws_instance" "haproxy" {
private_key = file(var.aws_key_pair_file)
}

ami = data.aws_ami.centos.id
ami = data.aws_ami.rhel7.id
instance_type = var.test_server_instance_type
key_name = var.aws_key_pair_name
subnet_id = aws_subnet.national_parks_subnet.id
Expand Down
6 changes: 3 additions & 3 deletions terraform/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ variable "aws_region" {
////////////////////////////////
// Server Settings

variable "aws_centos_image_user" {
default = "centos"
variable "aws_rhel7_image_user" {
default = "ec2-user"
}

variable "aws_ami_user" {
default = "centos"
default = "ec2-user"
}

variable "aws_amazon_image_user" {
Expand Down