Windows AMI creation deploy using CircleCI, Packer, Ansible and Terraform
To run this pipeline, there are some resources that will need to be in place before launching
- A VPC must be launched to retrieve the
vpc-id
andsubnet-id
for creation of the AMI - The
vpc-id
andsubnet-id
need to be input in thetf.vars
file - A bucket must be created ahead of time to hold the terraform state file
- The bucket information must be input into the
backend.tf
file - Terraform needs to be initialized beofre running the code through the pipeline
This is a first time manual step, but is necessary to store the Terraform state. Create the S3 bucket where you plan to store the state and record the name given.
Navigate into the vpc
folder and run the following code to initiate the code for the vpc.
terraform init
You will be asked for the
- profile name
- bucket name
- file name
Use the respected values in the variables asked.
Once that is done, you can go ahead and run terraform apply