Skip to content

opsstation/terraform-aws-pritunl

Repository files navigation

Terraform AWS Pritunl Module

Table of Contents

Introduction

Terraform module to create an pritunl resource on AWS with ElasticC IP Addresses and Elastic Block Store.

Usage

To use this module, include it in your Terraform configuration.

Examples

Example

module "pritunl" {
  source      = "git::https://github.com/opsstation/terraform-aws-pritunl.git?ref=v1.0.0"
  name        = "pritunl"
  environment = "test"

  #instance
  ami           = "ami-0a8e758f5e873d1c1"
  instance_type = "t2.medium"

  #Networking
  vpc_id            = module.vpc.id
  ssh_allowed_ip    = ["0.0.0.0/0"]
  subnet_ids        = tolist(module.public_subnets.public_subnet_id)
  ssh_allowed_ports = [22, 1194]

  #Keypair
  public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDmPzqVYDVlaExxJBwbrXT2jG44xMM1U6Z+nCPkjStGj4ayo7Lkz8SzzFbAS0uYaXaTJfc/ZI980BwtLAeWZeaFYDABDROJHS748cTwyByUe1S+yNMrz7wbyeZllQGt6EtnxcOADuMvtBGioTgfXIzJNYb73TlPEUVlTOEDbQd+8oDpO+u7SJFgT+q5OZE5XFyYvp5hHSdLgZhXurRfjvFpqVBwiTojL5o0Q2xqXxTFOFfdoDKcjbMwFwr4vdJ5Edqqa2gcl9nRtCL4vo0m/St0ekbZ3yT9h3gRgP3+u9L0rc0f4XZxNW3b0ljWC1dEd/pAVw1k1y1xRnYKKwNaT6nZcKqFawT/G4S9fj6LrD+RPJsEgMXcIaAcGeidQolVZce4fWyAJc5Dx0ALKTkHNN7NyyTXopuK63YJ5lUEwWOYc6q9l/xM49i9hdpMD0TafqM0rWXFY3ALR9z/U0CMWwtlQ33iInGEYRqd+wupm48nuHII359uNe/GKhjqCLU5K4E= rahul@rahul"

  #IAM
  iam_instance_profile = module.iam-role.name

  #Root Volume
  root_block_device = [
    {
      volume_type           = "gp2"
      volume_size           = 20
      delete_on_termination = true
      kms_key_id            = module.kms_key.key_arn
    }
  ]

  #user data
  user_data = file("${path.module}/pritunl.sh")
}

Examples

For detailed examples on how to use this module, please refer to the examples directory within this repository.

License

This Terraform module is provided under the MIT License. Please see the LICENSE file for more details.

Author

Your Name Replace MIT and opsstation with the appropriate license and your information. Feel free to expand this README with additional details or usage instructions as needed for your specific use case.

Requirements

Name Version
terraform >= 1.5.7
aws >= 5.13.1

Providers

No providers.

Modules

Name Source Version
ec2 git::https://github.com/opsstation/terraform-aws-ec2.git v1.0.0

Resources

No resources.

Inputs

Name Description Type Default Required
ami The AMI to use for the instance. string "" no
ebs_volume_enabled Flag to control the ebs creation. bool false no
ebs_volume_size Size of the EBS volume in gigabytes. number 30 no
ebs_volume_type The type of EBS volume. Can be standard, gp2 or io1. string "gp2" no
environment Environment (e.g. prod, dev, staging). string "" no
iam_instance_profile The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. string "" no
instance_count Number of instances to launch. number 1 no
instance_tags Instance tags. map(any) {} no
instance_type The type of instance to start. Updates to this field will trigger a stop/start of the EC2 instance. string n/a yes
name Name (e.g. app or cluster). string "" no
public_key The key name to use for the instance. string "" no
repository Terraform current module repo string "https://github.com/opsstation/terraform-aws-pritunl" no
root_block_device Customize details about the root block device of the instance. See Block Devices below for details. list(any) [] no
ssh_allowed_ip List of allowed ip. list(any) [] no
ssh_allowed_ports List of allowed ingress ports list(any) [] no
subnet_ids A list of VPC Subnet IDs to launch in. list(string) [] no
user_data (Optional) A string of the desired User Data for the ec2. string "" no
vpc_id The ID of the VPC that the instance security group belongs to. string "" no

Outputs

Name Description
instance_id The instance ID.
private_ip Private IP of instance.
tags The instance tags.