ec2-bastion-server

cloudposse/ec2-bastion-server/aws

Terraform Module HCL AWS

Terraform module to define a generic Bastion host with parameterized user_data and support for AWS SSM Session Manager for remote access with IAM authentication.

Install
module "ec2-bastion-server" {
source = "cloudposse/ec2-bastion-server/aws"
version = "0.31.2"
}
plain text: /constructs/tfmod-cloudposse-ec2-bastion-server-aws/install.txt
⭐ Source on GitHub 📦 Registry page
README

Terraform module to define a generic Bastion host with parameterized user_data and support for AWS SSM Session Manager for remote access with IAM authentication. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Requirements | Name | Version | |------|---------| | terraform | >= 0.13.0 | | aws | >= 2.55 | Providers | Name | Version | |------|---------| | aws | >= 2.55 | Modules | Name | Source | Version | |------|--------|---------| | dns | cloudposse/route53-cluster-hostname/aws | 0.12.2 | | security\_group | cloudposse/securit

Inputs (50)
NameTypeDescriptionDefault
subnetslist(string)AWS subnet IDs required
vpc_idstringVPC ID required
stagestringID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bunull
delimiterstringDelimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` null
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
regex_replace_charsstringTerraform regular expression (regex) string. Characters matching the regex will null
ami_ownerslist(string)The list of owners used to select the AMI of action runner instances.[ "amazon" ]
ssm_enabledboolEnable SSM Agent on Host.true
security_group_ruleslist(any)A list of maps of Security Group rules. The values of map is fully complated wi[ { "cidr_blocks": [ "0.0.0.
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
id_length_limitnumberLimit `id` to this many characters (minimum 6). Set to `0` for unlimited length.null
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by null
descriptor_formatsanyDescribe additional descriptors to be output in the `descriptors` output map. Ma{}
monitoringboolLaunched EC2 instance will have detailed monitoring enabledtrue
metadata_http_endpoint_enabledboolWhether the metadata service is availabletrue
amistringAMI to use for the instance. Setting this will ignore `ami_filter` and `ami_ownenull
ebs_block_device_encryptedboolWhether to encrypt the EBS block devicetrue
label_value_casestringControls the letter case of ID elements (labels) as included in `id`, set as tagnull
zone_idstringRoute53 DNS Zone ID""
ebs_block_device_volume_sizenumberThe volume size (in GiB) to provision for the EBS block device. Creation skipped0
ebs_device_namestringThe name of the EBS block device to mount on the instance"/dev/sdh"
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
… and 10 more inputs
Outputs (15)
instance_id — Instance ID
public_ip — Public IP of the instance (or EIP)
id — Disambiguated ID of the instance
arn — ARN of the instance
security_group_name — Bastion host Security Group name
ssh_user — SSH user
security_group_ids — IDs on the AWS Security Groups associated with the instance
role — Name of AWS IAM Role associated with the instance
security_group_arn — Bastion host Security Group ARN
private_dns — Private DNS of instance
hostname — DNS hostname
security_group_id — Bastion host Security Group ID
private_ip — Private IP of the instance
public_dns — Public DNS of instance (or DNS of EIP)
name — Instance name
Resources (5)
aws_eipaws_iam_instance_profileaws_iam_roleaws_iam_role_policyaws_instance
Details
FrameworkTerraform Module
LanguageHCL
Version0.31.2
Cloud AWS
★ Stars169
Forks113
Total downloads621.0k
Inputs50
Outputs15
Resources5
Examples1
LicenseApache-2.0
Namespacecloudposse
Updated