An open API service indexing awesome lists of open source software.

https://github.com/hadenlabs/terraform-aws-openvpn

terraform module openvpn for aws
https://github.com/hadenlabs/terraform-aws-openvpn

aws hadenlabs openvpn peru terraform terraform-modules

Last synced: 8 months ago
JSON representation

terraform module openvpn for aws

Awesome Lists containing this project

README

          

[![Latest Release](https://img.shields.io/github/release/hadenlabs/terraform-aws-openvpn)](https://github.com/hadenlabs/terraform-aws-openvpn/releases) [![Lint](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-openvpn/lint-code)](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=lint-code) [![CI](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-openvpn/ci)](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=ci) [![Test](https://img.shields.io/github/workflow/status/hadenlabs/terraform-aws-openvpn/test)](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=test) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow)](https://conventionalcommits.org) [![KeepAChangelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.0.0-orange)](https://keepachangelog.com) [![Terraform Version](https://img.shields.io/badge/terraform-1.x%20|%200.15%20|%200.14%20|%200.13%20|%200.12.20+-623CE4.svg?logo=terraform)](https://github.com/hashicorp/terraform/releases)

# terraform-aws-openvpn

Terraform module to provision an openvpn instance.

## Requirements

This is a list of plugins that need to be installed previously to enjoy all the goodies of this configuration:

- [gomplate](https://github.com/hairyhenderson/gomplate)
- [Docker](https://www.docker.com)
- [python](https://www.python.org)
- [taskfile](https://github.com/go-task/task)

## Usage

# How to use this project

```hcl
module "main" {
source = "hadenlabs/openvpn/aws"
version = "0.3.0"

providers = {
aws = aws
template = template
local = local
}

public_key = local.auth_public_key
private_key = local.auth_private_key
admin_user = "slovacus"
storage_path = "~/openvpn"

}
```

Full working examples can be found in [examples](./examples) folder.

## Examples

### common

```hcl
module "main" {
source = "hadenlabs/openvpn/aws"
version = "0.4.0"

providers = {
aws = aws
template = template
local = local
}

public_key = local.auth_public_key
private_key = local.auth_private_key
admin_user = "slovacus"
storage_path = "~/openvpn"

}

```

## Requirements

| Name | Version |
| ------------------------------------------------------------------------ | ----------------- |
| [terraform](#requirement_terraform) | >= 0.12.20, < 2.0 |
| [aws](#requirement_aws) | >=3.2.0 |
| [null](#requirement_null) | >=0.1.0 |

## Providers

| Name | Version |
| --------------------------------------------------- | ------- |
| [aws](#provider_aws) | >=3.2.0 |
| [null](#provider_null) | >=0.1.0 |

## Modules

| Name | Source | Version |
| ----------------------------------------------- | ------------------- | ------- |
| [tags](#module_tags) | hadenlabs/tags/null | >0.1 |

## Resources

| Name | Type |
| --- | --- |
| [aws_eip.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eip) | resource |
| [aws_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
| [aws_internet_gateway.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/internet_gateway) | resource |
| [aws_key_pair.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/key_pair) | resource |
| [aws_route.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route) | resource |
| [aws_security_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_security_group_rule.egress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_security_group_rule.ingress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
| [aws_subnet.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource |
| [aws_vpc.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |
| [null_resource.openvpn_adduser](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [null_resource.openvpn_download_configurations](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [null_resource.openvpn_install](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [null_resource.provision_core](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [null_resource.provision_openvpn](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [aws_ami.amazon_linux](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ami) | data source |

## Inputs

| Name | Description | Type | Default | Required |
| --- | --- | --- | --- | :-: |
| [admin_user](#input_admin_user) | admin user | `string` | `"openvpn"` | no |
| [environment](#input_environment) | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
| [instance_type](#input_instance_type) | type instance | `string` | `"t2.micro"` | no |
| [is_test](#input_is_test) | implement when is execute a test | `bool` | `false` | no |
| [name](#input_name) | Solution name, e.g. 'app' or 'jenkins' | `string` | n/a | yes |
| [namespace](#input_namespace) | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
| [private_key](#input_private_key) | private key | `string` | n/a | yes |
| [public_key](#input_public_key) | public key | `string` | n/a | yes |
| [rules_ingress](#input_rules_ingress) | list rule for security group |

list(object({
from_port = number
to_port = number
protocol = string
cidr_blocks = list(string)
}))
| `[]` | no |
| [ssh_cidr](#input_ssh_cidr) | ssh cidr | `string` | `"0.0.0.0/0"` | no |
| [ssh_port](#input_ssh_port) | port ssh | `number` | `22` | no |
| [ssh_user](#input_ssh_user) | user ssh | `string` | `"ubuntu"` | no |
| [stage](#input_stage) | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| [storage_path](#input_storage_path) | storage path keys to local | `string` | `"~/openvpn"` | no |
| [subnet_cidr_block](#input_subnet_cidr_block) | subnet cidr block | `string` | `"10.0.0.0/16"` | no |
| [tags](#input_tags) | Additional tags (e.g. `map('BusinessUnit','XYZ')` | `map(string)` | `{}` | no |
| [vpc_cidr_block](#input_vpc_cidr_block) | vpc cidr block | `string` | `"10.0.0.0/16"` | no |

## Outputs

| Name | Description |
| -------------------------------------------------------------------- | ----------------------------------------- |
| [instance](#output_instance) | return instance openvpn |
| [instance_ip](#output_instance_ip) | return instance openvpn elastic ip public |
| [private_key](#output_private_key) | return filepath privatekey |

## Help

**Got a question?**

File a GitHub [issue](https://github.com/hadenlabs/terraform-aws-openvpn/issues).

## Contributing

See [Contributing](./docs/contributing.md).

## Module Versioning

This Module follows the principles of [Semantic Versioning (SemVer)](https://semver.org/).

Using the given version number of `MAJOR.MINOR.PATCH`, we apply the following constructs:

1. Use the `MAJOR` version for incompatible changes.
1. Use the `MINOR` version when adding functionality in a backwards compatible manner.
1. Use the `PATCH` version when introducing backwards compatible bug fixes.

### Backwards compatibility in `0.0.z` and `0.y.z` version

- In the context of initial development, backwards compatibility in versions `0.0.z` is **not guaranteed** when `z` is increased. (Initial development)
- In the context of pre-release, backwards compatibility in versions `0.y.z` is **not guaranteed** when `y` is increased. (Pre-release)

## Copyright

Copyright © 2018-2022 [Hadenlabs](https://hadenlabs.com)

## Trademarks

All other trademarks referenced herein are the property of their respective owners.

## License

The code and styles are licensed under the LGPL-3.0 license [See project license.](LICENSE).

## Don't forget to 🌟 Star 🌟 the repo if you like terraform-aws-openvpn

[Your feedback is appreciated](https://github.com/hadenlabs/terraform-aws-openvpn/issues)