aws-ec2-instance: upgrade AMI to Ubuntu 22.04

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-10-14 12:39:22 +02:00
parent d0b97a118d
commit e2b1b6248b
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
2 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,8 @@ locals {
/* the image needs to be queried */
data "aws_ami" "ubuntu" {
most_recent = true
owners = [var.image_owner]
filter {
@ -75,6 +77,11 @@ resource "aws_instance" "main" {
Fleet = "${var.env}.${var.stage}"
}
/* Ignore changes to disk image */
lifecycle {
ignore_changes = [ami]
}
/* bootstraping access for later Ansible use */
provisioner "ansible" {
plays {

View File

@ -3,7 +3,7 @@
variable "image_name" {
description = "Name of AMI image to use."
type = string
default = "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20190212.1"
default = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"
}
variable "image_owner" {