Hapag-Lloyd / terraform-aws-bastion-host-ssm

Terraform module to create an enterprise grade bastion host: High availability, SSM access only, encrypted disk and flexible resource naming.
Apache License 2.0
9 stars 4 forks source link

feat: add `var.ami_id` to fix the AMI used for the Bastion #199

Closed kayman-mk closed 11 months ago

kayman-mk commented 11 months ago

Description

The infrastructure should be immutable, i.e. applying the same infrastructure every week shouldn't change anything. At the moment the AMI id changes when a new AMI is published. This might introduce problems as the image is changed. It also increases the elapsed time of your workflows/pipelines by roughly 4 minutes.

This PR adds an optional var.ami_id. In case it is filled, this AMI is used for the Bastion EC2 instance. The var.ami_name_filter is now deprecated and will be removed with version 3.0.0 of the module.

I recommend using this new parameter. But make sure that you have an update procedure in place to update the AMI id regularly.

Verification

Apply the simple example --> Bastion host is setup and boots

Checklist

github-actions[bot] commented 11 months ago

Hey @kayman-mk! 👋

Thank you for your contribution to the project. Please refer to the contribution rules for a quick overview of the process.

Make sure that this PR clearly explains:

With submitting this PR you confirm that you hold the rights of the code added and agree that it will published under the Apache 2.0 license.

The following ChatOps commands are supported:

Simply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command.

This message was generated automatically. You are welcome to improve it.