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
- Host: GitHub
- URL: https://github.com/hadenlabs/terraform-aws-openvpn
- Owner: hadenlabs
- License: lgpl-3.0
- Created: 2021-02-16T13:33:52.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2022-05-15T05:23:51.000Z (about 4 years ago)
- Last Synced: 2024-09-27T19:21:49.799Z (almost 2 years ago)
- Topics: aws, hadenlabs, openvpn, peru, terraform, terraform-modules
- Language: HCL
- Homepage:
- Size: 567 KB
- Stars: 5
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: docs/contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: docs/code_of_conduct.md
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/hadenlabs/terraform-aws-openvpn/releases) [](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=lint-code) [](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=ci) [](https://github.com/hadenlabs/terraform-aws-openvpn/actions?workflow=test) [](https://github.com/pre-commit/pre-commit) [](https://conventionalcommits.org) [](https://keepachangelog.com) [](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)