From 3e6a80e69de44bf4810613b87f291211c828232d Mon Sep 17 00:00:00 2001 From: darox Date: Tue, 11 Jun 2024 15:43:56 +0200 Subject: [PATCH 1/3] Bump: ec2-bastion-server module --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a33c628..59ec5bc 100644 --- a/main.tf +++ b/main.tf @@ -154,7 +154,7 @@ module "bastion" { count = var.bastion_host_enabled ? 1 : 0 source = "cloudposse/ec2-bastion-server/aws" - version = "0.30.1" + version = "0.31.0" ami_filter = { name = [var.bastion_host_ami_name_filter] } ami_owners = var.bastion_host_ami_owners From 4f631e1fe1fcdbfcbd4a4c0ec4940f71bf81519a Mon Sep 17 00:00:00 2001 From: darox Date: Tue, 11 Jun 2024 15:45:48 +0200 Subject: [PATCH 2/3] Vars: add bastion userdata var Signed-off-by: darox --- main.tf | 2 ++ variables.tf | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/main.tf b/main.tf index 59ec5bc..f33bcc0 100644 --- a/main.tf +++ b/main.tf @@ -170,4 +170,6 @@ module "bastion" { subnets = var.bastion_host_assign_public_ip ? module.vpc.public_subnets : module.vpc.private_subnets tags = var.tags vpc_id = module.vpc.vpc_id + user_data = var.bastion_host_user_data + user_data_base64 = var.bastion_host_user_data_base64 } diff --git a/variables.tf b/variables.tf index f97bc64..48d2dff 100644 --- a/variables.tf +++ b/variables.tf @@ -120,6 +120,18 @@ variable "bastion_host_ssh_public_key" { type = string } +variable "bastion_host_user_data" { + default = [] + description = "The user data to use for the bastion host." + type = string +} + +variable "bastion_host_user_data_base64" { + default = "" + description = "The user data to use for the bastion host, base64 encoded." + type = string +} + variable "cidr" { description = "The CIDR to be used for the VPC." type = string From 91dce32784531cdba48cfc1f53c204e6beea24a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Jun 2024 13:47:26 +0000 Subject: [PATCH 3/3] terraform-docs: automated action --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82c413d..77d78fc 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ An opinionated Terraform module that can be used to create and manage an VPC in | Name | Source | Version | |------|--------|---------| -| [bastion](#module\_bastion) | cloudposse/ec2-bastion-server/aws | 0.30.1 | +| [bastion](#module\_bastion) | cloudposse/ec2-bastion-server/aws | 0.31.0 | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 5.0.0 | ## Resources @@ -59,6 +59,8 @@ An opinionated Terraform module that can be used to create and manage an VPC in | [bastion\_host\_instance\_type](#input\_bastion\_host\_instance\_type) | The instance type to use for the bastion host. | `string` | `"t2.micro"` | no | | [bastion\_host\_security\_group\_rules](#input\_bastion\_host\_security\_group\_rules) | A list of security group rules to apply to the bastion host. | `list(any)` |
[
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "Allow all outbound traffic",
"from_port": 0,
"protocol": -1,
"to_port": 0,
"type": "egress"
},
{
"cidr_blocks": [
"0.0.0.0/0"
],
"description": "Allow all inbound to SSH",
"from_port": 22,
"protocol": "tcp",
"to_port": 22,
"type": "ingress"
}
]
| no | | [bastion\_host\_ssh\_public\_key](#input\_bastion\_host\_ssh\_public\_key) | If specified, will be used as the public SSH key for the bastion host. | `string` | `""` | no | +| [bastion\_host\_user\_data](#input\_bastion\_host\_user\_data) | The user data to use for the bastion host. | `string` | `[]` | no | +| [bastion\_host\_user\_data\_base64](#input\_bastion\_host\_user\_data\_base64) | The user data to use for the bastion host, base64 encoded. | `string` | `""` | no | | [cidr](#input\_cidr) | The CIDR to be used for the VPC. | `string` | n/a | yes | | [enable\_ipv6](#input\_enable\_ipv6) | Whether to enable the ipv6 stack. | `bool` | `false` | no | | [map\_public\_ip\_on\_launch](#input\_map\_public\_ip\_on\_launch) | Whether to map public IPs on launch. | `bool` | `false` | no |