Skip to content

Commit c6a0a23

Browse files
authored
Merge pull request #14 from sourcefuse/feature/vpn
added module usage guide and contributing file for client VPN
2 parents 3053a80 + 4d9f039 commit c6a0a23

File tree

3 files changed

+277
-1
lines changed

3 files changed

+277
-1
lines changed

.github/workflows/update-docs.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,19 @@ jobs:
1818
with:
1919
source_file: "README.md"
2020
destination_repo: "sourcefuse/arc-docs"
21-
destination_folder: "docs/arc-iac-docs/modules/terraform-aws-refarch-vpn"
21+
destination_folder: "docs/arc-iac-docs/modules/terraform-aws-arc-vpn"
2222
user_email: "[email protected]"
2323
user_name: ${{ github.actor }}
2424
commit_message: ${{ github.event.head_commit.message }}
25+
- name: Pushes Module Usage Guide
26+
uses: dmnemec/copy_file_to_another_repo_action@main
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
API_TOKEN_GITHUB: ${{ secrets.ARC_DOCS_API_TOKEN_GITHUB }}
30+
with:
31+
source_file: 'docs/module-usage-guide/README.md'
32+
destination_repo: 'sourcefuse/arc-docs'
33+
destination_folder: 'docs/arc-iac-docs/modules/terraform-aws-arc-vpn/docs/module-usage-guide'
34+
user_email: '[email protected]'
35+
user_name: ${{ github.actor }}
36+
commit_message: ${{ github.event.head_commit.message }}

CONTRIBUTING.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Contributing to AWS ARC Client VPN
2+
Thank you for considering contributing to AWS ARC CLient VPN! We appreciate your time and effort.
3+
To ensure a smooth collaboration, please take a moment to review the following guidelines.
4+
5+
## How to Contribute
6+
1. Fork the repository to your own GitHub account.
7+
2. Clone the repository to your local machine.
8+
```bash
9+
git clone https://github.com/<your_organization>/<your_terraform_module>.git
10+
```
11+
3. Create a new branch for your feature / bugfix.
12+
```bash
13+
git checkout -b feature/branch_name
14+
```
15+
4. Make your changes and commit them.
16+
```bash
17+
git commit -m "Your descriptive commit message"
18+
19+
5. Run pre-commit checks
20+
```bash
21+
pre-commit run --all-files
22+
23+
6. Push to your forked repository.
24+
```bash
25+
git push origin feature/branch_name
26+
```
27+
7. Open a pull request in the original repository with a clear title and description.
28+
If your pull request addresses an issue, please reference the issue number in the pull request description.
29+
30+
## Git commits
31+
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
32+
33+
For Example
34+
35+
```sh
36+
git commit -m "your commit message #major"
37+
```
38+
By specifying this , it will bump the version and if you don't specify this in your commit message then by default it will consider patch and will bump that accordingly
39+
40+
# Terraform Code Collaboration Guidelines
41+
42+
## File Naming Conventions
43+
44+
1. **Variables File (variables.tf):**
45+
- All variable names should be in snake_case.
46+
- Each variable declaration must contain:
47+
- Description: A brief explanation of the variable's purpose.
48+
- Type: The data type of the variable.
49+
50+
Example:
51+
```hcl
52+
variable "example_variable" {
53+
description = "This is an example variable."
54+
type = string
55+
}
56+
```
57+
58+
2. **Outputs File (outputs.tf):**
59+
- All output names should be in snake_case.
60+
- Each output declaration must contain:
61+
- Description: A brief explanation of the output's purpose.
62+
- Value: The value that will be exposed as the output.
63+
64+
Example:
65+
```hcl
66+
output "example_output" {
67+
description = "This is an example output."
68+
value = module.example_module.example_attribute
69+
}
70+
```
71+
72+
## Resource and Module Naming
73+
74+
1. **Terraform Resources/Modules:**
75+
- Resource and module names should be in snake_case.
76+
- Choose descriptive names that reflect the purpose of the resource or module.
77+
78+
Example:
79+
```hcl
80+
resource "aws_instance" "web_server" {
81+
// ...
82+
}
83+
84+
module "clinet_vpn" {
85+
// ...
86+
}
87+
```
88+
89+
## General Guidelines
90+
91+
1. **Consistent Formatting:**
92+
- Follow consistent code formatting to enhance readability.
93+
- Use indentation and line breaks appropriately.
94+
95+
2. **Comments:**
96+
- Add comments to explain complex logic, decisions, or any non-trivial code.
97+
- Keep comments up-to-date with the code.
98+
99+
3. **Module Documentation:**
100+
- Include a README.md file within each module directory, explaining its purpose, inputs, and outputs.
101+
- Use inline documentation within the code for complex modules.
102+
103+
4. **Avoid Hardcoding:**
104+
- Minimize hardcoded values; prefer using variables and references for increased flexibility.
105+
106+
5. **Sensitive Information:**
107+
- Do not hardcode sensitive information (e.g., passwords, API keys). Use appropriate methods for securing sensitive data.
108+
109+
6. **Error Handling:**
110+
- Implement proper error handling and consider the impact of potential failures.
111+
112+
## Version Control
113+
114+
1. **Commit Messages:**
115+
- Use descriptive and concise commit messages that explain the purpose of the changes.
116+
117+
2. **Branching:**
118+
- Follow a branching strategy (e.g., feature branches) for better collaboration.
119+
120+
## Code Style
121+
Please follow the Terraform language conventions and formatting guidelines. Consider using an editor with Terraform support or a linter to ensure adherence to the style.
122+
123+
## Testing
124+
!!! This section is a work-in-progress, as we are starting to adopt testing using Terratest. !!!
125+
126+
Before submitting a pull request, ensure that your changes pass all tests. If applicable, add new tests to cover your changes.
127+
128+
## Documentation
129+
Keep the module documentation up-to-date. If you add new features or change existing functionality, update the [README](README.md) and any relevant documentation files.
130+
131+
## Security and Compliance Checks
132+
GitHub Actions are in place to perform security and compliance checks. Please make sure your changes pass these checks before submitting a pull request.
133+
134+
## Licensing
135+
By contributing, you agree that your contributions will be licensed under the project's [LICENSE](LICENSE).

docs/module-usage-guide/README.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Terraform AWS ARC VPN Module Usage Guide
2+
3+
## Introduction
4+
5+
### Purpose of the Document
6+
7+
This document provides guidelines and instructions for users looking to implement Terraform ARC module for managing a Client VPN.
8+
9+
### Module Overview
10+
11+
The [terraform-aws-arc-vpn](https://github.com/sourcefuse/terraform-aws-arc-vpn) The VPN setup allows users to securely connect to the AWS VPC from anywhere, using the created client VPN.
12+
13+
### Prerequisites
14+
15+
Before using this module, ensure you have the following:
16+
17+
- AWS credentials configured.
18+
- Terraform installed.
19+
- A working knowledge of AWS Client VPN
20+
21+
## Getting Started
22+
23+
### Module Source
24+
25+
To use the module in your Terraform configuration, include the following source block:
26+
27+
```hcl
28+
module "client_vpn" {
29+
source = "sourcefuse/arc-vpn/aws"
30+
version = "0.0.8"
31+
# insert the required variables here
32+
}
33+
```
34+
35+
### Integration with Existing Terraform Configurations
36+
37+
Integrate the module with your existing Terraform mono repo configuration, follow the steps below:
38+
39+
1. Create a new folder in `terraform/` named `client_vpn`.
40+
2. Create the required files, see the [examples](https://github.com/sourcefuse/terraform-aws-arc-vpn/tree/main/examples/simple) to base off of.
41+
3. Configure with your backend
42+
- Create the environment backend configuration file: `config.<environment>.hcl`
43+
- **region**: Where the backend resides
44+
- **key**: `<working_directory>/terraform.tfstate`
45+
- **bucket**: Bucket name where the terraform state will reside
46+
- **dynamodb_table**: Lock table so there are not duplicate tfplans in the mix
47+
- **encrypt**: Encrypt all traffic to and from the backend
48+
49+
### Required AWS Permissions
50+
51+
Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create Client VPN.
52+
53+
## Module Configuration
54+
55+
### Input Variables
56+
57+
For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-vpn?tab=readme-ov-file#inputs) section.
58+
59+
### Output Values
60+
61+
For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-vpn?tab=readme-ov-file#outputs) section.
62+
63+
## Module Usage
64+
65+
### Basic Usage
66+
67+
For basic usage, see the [example](https://github.com/sourcefuse/terraform-aws-arc-vpn/tree/main/example) folder.
68+
69+
This example will create:
70+
71+
Self-Signed Certificate Authority (CA) Creation: It creates a self-signed CA certificate using the cloudposse/terraform-aws-ssm-tls-self-signed-cert module. The certificate is stored in AWS SSM (Systems Manager).
72+
73+
Self-Signed Root Certificate Creation: It creates a self-signed root certificate using the cloudposse/terraform-aws-ssm-tls-self-signed-cert module. This certificate is signed by the previously created CA certificate.
74+
75+
VPN Setup: It uses the sourcefuse/arc-vpn/aws module to create a VPN setup. This includes:
76+
77+
Setting up certificate-based authentication using the self-signed root certificate.
78+
79+
Authorizing all groups to access the VPN.
80+
81+
Specifying the private subnets where the VPN endpoints will be created.
82+
83+
Specifying the target network CIDR block, which is the VPC's CIDR block.
84+
85+
Creating a self-signed server certificate.
86+
87+
Setting up the client VPN with a specified client CIDR block, VPN name, and VPN gateway name.
88+
89+
The VPN setup allows users to securely connect to the AWS VPC from anywhere, using the created client VPN. The self-signed certificates are used to authenticate the users.
90+
### Tips and Recommendations
91+
92+
The module focuses on setting up AWS Client VPN. Adjust the configuration parameters as needed for your specific use case.
93+
94+
## Troubleshooting
95+
96+
### Reporting Issues
97+
98+
If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-vpn/issues).
99+
100+
## Security Considerations
101+
102+
### AWS VPC
103+
104+
Understand the security considerations related to Client VPN when using this module.
105+
106+
### Best Practices for Client VPN
107+
108+
Follow best practices to ensure secure Client VPN.
109+
[Client VPN Security on AWS](https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/security-best-practices.html)
110+
111+
## Contributing and Community Support
112+
113+
### Contributing Guidelines
114+
115+
Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-vpn/blob/main/CONTRIBUTING.md) file.
116+
117+
### Reporting Bugs and Issues
118+
119+
If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-vpn/issues).
120+
121+
## License
122+
123+
### License Information
124+
125+
This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-vpn/blob/main/LICENSE) file for more details.
126+
127+
### Open Source Contribution
128+
129+
Contribute to open source by using and enhancing this module. Your contributions are welcome!

0 commit comments

Comments
 (0)