diff --git a/main.tf b/main.tf index b8f55cb..ad97cbd 100644 --- a/main.tf +++ b/main.tf @@ -185,6 +185,20 @@ module "windows" { instance_type = "t2.xlarge" } +# Rhel pipeline testing - Braxton +module "arm_rhel_image_pipeline" { + source = "./packer" + source_repo_name = "aws-image-pipeline" + project_name = "arm-rhel-image-pipeline" + environment = "dev" + source_ami = "ami-xxx" # Need a real AMI Here + instance_type = "t4g.micro" # Figure out what instance size needed + ssh_username = "ec2-user" + playbook = "playbook.yml" + vpc_config = local.vpc_config + state_config = local.state_config +} + output iam_arn { value = module.main.iam_arn } diff --git a/packer/rhel-arm.pkr.hcl b/packer/rhel-arm.pkr.hcl new file mode 100644 index 0000000..dcbad04 --- /dev/null +++ b/packer/rhel-arm.pkr.hcl @@ -0,0 +1,37 @@ +packer { + required_plugins { + amazon = { + version = ">= 1.2.8" + source = "github.com/hashicorp/amazon" + } + ansible = { + version = ">= 1.1.1" + source = "github.com/hashicorp/ansible" + } + } +} + +variable "subnet_id" {} +variable "security_group_id" {} + +source "amazon-ebs" "rhel-arm" { + ami_name = "arm-rhel-image" + instance_type = "t4g.micro" + source_ami = "ami-xxx" # Need to change + ssh_username = "ec2-user" + subnet_id = var.subnet_id + security_group_ids = [ + var.security_group_id + ] + architecture = "arm64" +} + +build { + name = "arm-rhel-build" + sources = [ + "source.amazon-ebs.rhel-arm" + ] + provisioner "ansible" { + playbook_file = "../ansible/playbook.yml" + } +} \ No newline at end of file