mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-26 09:44:01 -04:00
PutRolePolicy & AddRoleToInstanceProfile are eventually consistent but it is not possible to wait for them to be done here: https://github.com/hashicorp/packer/blob/0785c2f6fca9c22bf25528e0176042799dd79df9/builder/amazon/common/step_iam_instance_profile.go#L117-L134 which was causing the `CreateFleet` to fail (100% for me). So for now we retry a bit later. Waiting 5 seconds after the previously linked code also fixed this. Test file: ```json { "builders": [ { "type": "amazon-ebs", "region": "eu-west-1", "ami_name": "ubuntu-16.04 test {{timestamp}}", "ami_description": "Ubuntu 16.04 LTS - expand root partition", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*/ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": [ "099720109477" ], "most_recent": true }, "spot_price": "0.03", "spot_instance_types": [ "t2.small" ], "encrypt_boot": true, "ssh_username": "ubuntu", "ssh_interface": "session_manager", "temporary_iam_instance_profile_policy_document": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "*" ], "Resource": "*" } ] }, "communicator": "ssh" } ]} ```