The profile key defines which profile Packer uses to access the AWS API, as
you understood correctly.

iam_instance_profile just sets the IamInstanceProfile of the EC2 Instance
packer launches.

Can you share your template, I thing there is a simple error.

On Wed, Jan 9, 2019 at 4:02 PM Steven Hirschorn <[email protected]>
wrote:

> 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
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/packer-tool/56d7ccfb-5c80-4f55-9574-35eeeceaee2f%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/56d7ccfb-5c80-4f55-9574-35eeeceaee2f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt-LdKJemo6mG2-aj6v3DsGbO6mWJXNZ55yb6idEem7UZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to