Home

Awesome

<!-- BEGIN_TF_DOCS -->

Instance (AWS)

AWS Instance with multiple SSH Key support.

Usage

ssh-keygen -t rsa
module "bastion" {
  source = "github.com/opszero/terraform-aws-bastion"

  ssh_keys = [ "ssh-rsa ..." ]
  
  users = {
    "username" = {
      ssh-keys = [
         "ssh-rs ..."
      ]
    }
  }
}

Connect

Deployment

terraform init
terraform plan
terraform apply -auto-approve

Teardown

terraform destroy -auto-approve

Providers

NameVersion
<a name="provider_aws"></a> awsn/a
<a name="provider_cloudinit"></a> cloudinitn/a

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_ami_id"></a> ami_idThe AMI ID of the bastion hoststringnullno
<a name="input_efs_mounts"></a> efs_mountsEFS multiple mountsmap{}no
<a name="input_ingress_cidrs"></a> ingress_cidrsConfiguration block for ingress rulesanyn/ayes
<a name="input_instance_profile"></a> instance_profilen/a<pre>object({<br/> role_name = string<br/> assume_role_service = string<br/> policy_arns = list(string)<br/> })</pre>nullno
<a name="input_instance_type"></a> instance_typeEC2 Instance Type of the bastion hoststring"t3.micro"no
<a name="input_name"></a> nameThe name of the bastion hoststringn/ayes
<a name="input_security_group_ids"></a> security_group_idsA list of security group names to associate with.list(any)[]no
<a name="input_ssh_keys"></a> ssh_keysSSH public keys to add to the imagelist(any)[]no
<a name="input_subnet_id"></a> subnet_idThe VPC subnet ID to launch in EC2 bastion hoststringn/ayes
<a name="input_tags"></a> tagsA map of tags to assign to the resourcemap(any){}no
<a name="input_ubuntu_version"></a> ubuntu_versionUbuntu Server Versionstring"24.04"no
<a name="input_user_data"></a> user_dataUser data to provide when launching the instancestring""no
<a name="input_user_data_replace_on_change"></a> user_data_replace_on_changeTo recreate the instance when user_data is changedboolfalseno
<a name="input_userdata"></a> userdataUser data to provide when launching the instancestring""no
<a name="input_users"></a> usersCustom user accounts of the instancemap<pre>{<br/> "retool": {<br/> "ssh-keys": []<br/> }<br/>}</pre>no
<a name="input_volume_size"></a> volume_sizeSize of the volume in gibibytes (GiB)number20no
<a name="input_vpc_id"></a> vpc_idThe VPC ID to create security group for bastion hoststringn/ayes

Resources

NameType
aws_cloudwatch_metric_alarm.aws_bastion_cpu_thresholdresource
aws_eip.thisresource
aws_iam_instance_profile.thisresource
aws_iam_role.thisresource
aws_iam_role_policy_attachment.thisresource
aws_instance.thisresource
aws_security_group.thisresource
aws_security_group_rule.thisresource
aws_ssm_parameter.ubuntudata source
cloudinit_config.configdata source

Outputs

NameDescription
<a name="output_instance_id"></a> instance_idn/a
<a name="output_public_ip"></a> public_ipn/a

🚀 Built by opsZero!

<a href="https://opszero.com"><img src="https://opszero.com/wp-content/uploads/2024/07/opsZero_logo_svg.svg" width="300px"/></a>

Since 2016 opsZero has been providing Kubernetes expertise to companies of all sizes on any Cloud. With a focus on AI and Compliance we can say we seen it all whether SOC2, HIPAA, PCI-DSS, ITAR, FedRAMP, CMMC we have you and your customers covered.

We provide support to organizations in the following ways:

We do this with a high-touch support model where you:

Please schedule a call if you need support.

<br/><br/>

<div style="display: block"> <img src="https://opszero.com/wp-content/uploads/2024/07/aws-advanced.png" width="150px" /> <img src="https://opszero.com/wp-content/uploads/2024/07/AWS-public-sector.png" width="150px" /> <img src="https://opszero.com/wp-content/uploads/2024/07/AWS-eks.png" width="150px" /> </div> <!-- END_TF_DOCS -->