hashicorp / hashicorp/packer-plugin-amazon
Unable to create AMI from Marketplace source with subscribed credentials
- Dominant language
- Go
- Stars
- 91
- Forks
- 141
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 3
Description
### Description
I am encountering an issue when using Packer to create an AMI from a source AMI in the AWS Marketplace. Here are the details:
### Problem
Packer is configured with a set of AWS credentials, and the source AMI in the AWS Marketplace requires a subscription. I can launch an instance from the source AMI. However, when attempting to use Packer with the exact same credentials, I encounter the following error:
```
==> amazon-ebs.aws: Error launching source instance: OptInRequired: In order to use this AWS Marketplace product you need to accept terms and subscribe. To do so please visit https://aws.amazon.com/marketplace/pp?sku=cotnnspjrsi38lfn8qo4ibnnm
```
### Steps to Reproduce
1. Subscribe to the source AMI in the AWS Marketplace.
2. Use the same AWS credentials on the command line to launch an instance from the source AMI (successfully).
3. Configure Packer with the same AWS credentials and attempt to create an AMI.
4. Encounter the "OptInRequired" error mentioned above.
### Expected Behavior
Packer should be able to use the subscribed credentials to create an AMI from the source AMI in the AWS Marketplace without encountering the "OptInRequired" error.
### Environment
Packer Version: 1.9.4
Operating System: Ubuntu
#### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
#### Overview of the Issue
A paragraph or two about the issue you're experiencing.
#### Reproduction Steps
Steps to reproduce this issue
### Packer version
From `packer version`
### Simplified Packer Template
If the file is longer than a few dozen lines, please include the URL to the
[gist](https://gist.github.com/) of the log or use the [Github detailed
format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d)
instead of posting it directly in the issue.
### Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
### Log Fragments and crash.log files
Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the [gist](https://gist.github.com/) of the log or
use the [Github detailed format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d) instead of posting it directly in the issue.
Set the env var `PACKER_LOG=1` for maximum log detail.
Contributor guide
Assessment
This issue has not been assessed yet.