Last active
January 6, 2019 09:01
-
-
Save sanudatta11/c99aa06adef843e3d093b265767f7613 to your computer and use it in GitHub Desktop.
This is the Base AMI for Medium Article based on usage of Packer on AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"aws_access_key": "${AWS_ACCESS_KEY_ID}", | |
"aws_secret_key": "${AWS_SECRET_ACCESS_KEY}", | |
"vpc_region": "${vpc_region}", | |
"vpc_id": "${vpc_id}", | |
"vpc_public_sn_id": "${vpc_public_sn_id}", | |
"vpc_public_sg_id": "${vpc_public_sg_id}", | |
"source_ami": "${source_ami}", | |
"instance_type": "${instance_type}", | |
"ssh_username": "${ssh_username}" | |
}, | |
"builders": [ | |
{ | |
"type": "amazon-ebs", | |
"access_key": "{{user `aws_access_key`}}", | |
"secret_key": "{{user `aws_secret_key`}}", | |
"region": "{{user `vpc_region`}}", | |
"vpc_id": "{{user `vpc_id`}}", | |
"subnet_id": "{{user `vpc_public_sn_id`}}", | |
"associate_public_ip_address": true, | |
"security_group_id": "{{user `vpc_public_sg_id`}}", | |
"source_ami": "{{user `source_ami`}}", | |
"instance_type": "{{user `instance_type`}}", | |
"ssh_username": "{{user `ssh_username`}}", | |
"ami_name": "base-ami-{{isotime \"2006-01-02-1504\"}}", | |
"ami_groups": "all", | |
"launch_block_device_mappings": [ | |
{ | |
"device_name": "/dev/sda1", | |
"volume_type": "gp2", | |
"volume_size": "30", | |
"delete_on_termination": true | |
} | |
] | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"script": "baseInit.sh" | |
} | |
], | |
"post-processors": [ | |
{ | |
"type": "manifest", | |
"output": "manifest.json", | |
"strip_path": true | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment