|
| 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). |
0 commit comments