NEW: packer files and minor update to aws-assume-role.py
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Packer file which query for the latest RHEL9 AMI and print it
|
||||
|
||||
packer {
|
||||
required_plugins {
|
||||
amazon = {
|
||||
source = "github.com/hashicorp/amazon"
|
||||
version = "~> 1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "aws_region" {
|
||||
type = string
|
||||
default = "${env("AWS_REGION")}"
|
||||
}
|
||||
|
||||
data "amazon-ami" "rhel" {
|
||||
filters = {
|
||||
name = "RHEL-9.*HVM_GA*x86_64*GP3"
|
||||
root-device-type = "ebs"
|
||||
virtualization-type = "hvm"
|
||||
}
|
||||
most_recent = true
|
||||
owners = ["amazon"]
|
||||
region = "${var.aws_region}"
|
||||
}
|
||||
|
||||
source "null" "local" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
name = "query"
|
||||
sources = ["null.local"]
|
||||
|
||||
provisioner "shell-local" {
|
||||
inline = ["echo ${data.amazon-ami.rhel.id} ${data.amazon-ami.rhel.name}"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user