Is there a way I can use both
profile and
iam_instance_profile keys simultaneously
in a Packer template? I'd like the initial launch of the temporary EC2 instance to use the local AWS CLI credentials (which we are referencing already in a packer template using the
profile key) but the temporary EC2 instance to use an instance profile for the build scripts when running locally on that instance.
With profile alone, Packer uses the AWS CLI profile specified to launch the EC2 instance (though the instance doesn't have credentials cross-account to access an S3 bucket I need it to access)
With profile and iam_instance_profile it complains:
"InvalidParameterValue: Value (<profilename>) for parameter iamInstanceProfile.name is invalid"
Note that the profile name quoted is the AWS CLI profile name (the profile value, not the iam_instance_profile value.
Is it expected behaviour that profile and iam_instance_profile are mutually exclusive?
Thanks,
Steven