hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder
https://www.packer.io/docs/builders/amazon
Mozilla Public License 2.0
72 stars 110 forks source link

Support custom Systems Manager Document #421

Open malshash opened 1 year ago

malshash commented 1 year ago

Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

Community Note

Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, 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.

Description

Can you please support the ability to use a specified Systems Manager document when provisioning with ssm on AWS. Currently, the functionality is hard coded to the AWS managed document named AWS-StartPortForwardingSession

This initial enhancement would be great if it just handled a custom document but the parameters for the document would be identical to the AWS managed document. I can see further enhancements to supporting custom documents in the future which can be handled by https://github.com/hashicorp/packer-plugin-amazon/issues/417.

Use Case(s)

Some companies strictly control which documents are allowed and when updates should be adopted. An AWS owned document does not let us control those aspects.

Potential configuration

source "amazon-ebs" "image" {
  ...
  communicator = "ssh"

  ssh_interface        = "session_manager"
  ssh_username         = "someuser"
  iam_instance_profile = "SomeInstanceProfileName"

  ssm_document = "MyPortForwardingDocument"   # Name of custom document to use
}

Potential References

https://docs.aws.amazon.com/systems-manager/latest/userguide/documents.html