unity-sds / unity-ads-deployment

Apache License 2.0
0 stars 6 forks source link

Modify Dockstore to use latest AMI #102

Closed mcduffie closed 1 year ago

mcduffie commented 1 year ago

The AMI used for Dockstore should be updated to the latest one due to security issues. Instead of hard coding the AMI ID, grab the latest.

mcduffie commented 1 year ago

One way to fix the AMI issue to refer to the latest of a given type:

data "aws_ssm_parameter" "ami" {
  name = "/path/to/ami"
}

resource "aws_instance" "nginx" {
  ami           = data.aws_ssm_parameter.ami.value # pull value from parameter store
  instance_type = "t2.micro"

  provisioner "remote-exec" {
    inline = [
      "sudo yum install nginx -y",
      "sudo service nginx start"
    ]
  }
}