Run this Terraform config to configure the IAM role for packer. This will create a file named packer.pkrvar.hcl
in the packer/
directory.
The files have explainations inside them.
The Terraform module uses your ~/.aws/credentials
file to connect to AWS.
# Using default AWS profile 'default'
cd terraform
terraform apply
or
# Using a different AWS profile
cd terraform
terraform apply -var 'aws_profile=other-profile-than-default'
cd packer
# To test your build without creating the AMI
packer build -var-file=packer.pkrvar.hcl aws-k3s.pkr.hcl
# To create the AMI
packer build -var 'skip_create_ami=false' -var-file=packer.pkrvar.hcl aws-k3s.pkr.hcl