bastion

Guimove/bastion/aws

Terraform Module HCL AWS

Terraform module which creates SSH bastion infrastructure on AWS

Install
module "bastion" {
source = "Guimove/bastion/aws"
version = "3.0.6"
}
⭐ Source on GitHub 📦 Registry page
README

AWS Bastion Terraform module =========================================== ![Open Source Helpers](https://www.codetriage.com/guimove/terraform-aws-bastion) Terraform module which creates a secure SSH bastion on AWS. Mainly inspired by Securely Connect to Linux Instances Running in a Private Amazon VPC Features -------- This module will create an SSH bastion to securely connect in SSH to your private instances. !Bastion Infrastrucutre All SSH commands are logged on an S3 bucket for security compliance, in the /logs path. SSH users are managed by their public key, simply drop the SSH key of the user in the /public-keys path of the bucket. Keys should be named like 'username.pub', this will create the user 'username' on the bastion server. Username must contain alphanumeric characters only. The

Inputs (43)
NameTypeDescriptionDefault
create_dns_recordboolChoose if you want to create a record name for the bastion (LB). If true, 'hoste required
vpc_idstringVPC ID where we'll deploy the bastion required
bucket_namestringBucket name where the bastion will store the logs required
auto_scaling_group_subnetslist(string)List of subnets where the Auto Scaling Group will deploy the instances required
regionstring required
bastion_host_key_pairstringSelect the key pair to use to launch the bastion host required
disk_encryptboolInstance EBS encryptiontrue
http_put_response_hop_limitnumberThe desired HTTP PUT response hop limit for instance metadata requests1
ipv6_cidrslist(string)List of IPv6 CIDRs that can access the bastion. Default: ::/0[ "::/0" ]
kms_enable_key_rotationboolEnable key rotation for the KMS keyfalse
allow_ssh_commandsboolAllows the SSH user to execute one-off commands. Pass true to enable. Warning: Tfalse
bastion_iam_permissions_boundarystringIAM Role Permissions Boundary to constrain the bastion host role""
extra_user_data_contentstringAdditional scripting to pass to the bastion host. For example, this can include ""
public_ssh_portnumberSet the SSH port to use from desktop to the bastion22
associate_public_ip_addressbooltrue
enable_http_protocol_ipv6boolEnables or disables the IPv6 endpoint for the instance metadata servicefalse
http_endpointboolWhether the metadata service is availabletrue
use_imds_v2boolUse (IMDSv2) Instance Metadata Service V2false
bastion_iam_role_namestringIAM role name to createnull
elb_subnetslist(string)List of subnets where the ELB will be deployed[]
hosted_zone_idstringName of the hosted zone where we'll register the bastion DNS name""
disk_sizenumberRoot EBS size in GB8
instance_typestringInstance size of the bastion"t3.nano"
log_standard_ia_daysnumberNumber of days before moving logs to IA Storage30
private_ssh_portnumberSet the SSH port to use between the bastion and private instance22
bastion_iam_policy_namestringIAM policy name to create for granting the instance role access to the bucket"BastionHost"
… and 3 more inputs
Outputs (11)
elb_arn — The ARN of the ELB for bastion hosts
elb_ip — The DNS name of the ELB for bastion hosts
target_group_arn — The ARN of the target group for the ELB
bastion_elb_id — The ID of the ELB for bastion hosts
bucket_kms_key_arn — The ARN of the KMS key for the bucket
bucket_name — The ID of the S3 bucket
bucket_kms_key_alias — The name of the KMS key alias for the bucket
private_instances_security_group — The ID of the security group for private instances
bastion_auto_scaling_group_name — The name of the Auto Scaling Group for bastion hosts
bastion_host_security_group — The ID of the bastion host security group
bucket_arn — The ARN of the S3 bucket
Resources (21)
aws_autoscaling_groupaws_iam_instance_profileaws_iam_policyaws_iam_roleaws_iam_role_policy_attachmentaws_kms_aliasaws_kms_keyaws_launch_templateaws_lbaws_lb_listeneraws_lb_target_groupaws_route53_recordaws_s3_bucketaws_s3_bucket_aclaws_s3_bucket_lifecycle_configurationaws_s3_bucket_ownership_controlsaws_s3_bucket_server_side_encryption_configurationaws_s3_bucket_versioningaws_s3_objectaws_security_groupaws_security_group_rule
Details
FrameworkTerraform Module
LanguageHCL
Version3.0.6
Cloud AWS
★ Stars212
Forks183
Total downloads446.4k
Inputs43
Outputs11
Resources21
LicenseApache-2.0
NamespaceGuimove
Updated