From 2b6a4ddbff0ea5dc9e81b4149470bcee2b501b92 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Thu, 11 Apr 2024 00:09:34 +0200 Subject: [PATCH] feat(variables): add initial files and start working on variables --- .pre-commit-config.yaml | 19 +++++++++++++++++++ LICENSE | 21 ++++++++++++++++----- README.md | 32 +++++++++++++++++++++++++++++++- examples/.gitkeep | 0 main.tf | 0 modules/.gitkeep | 0 outputs.tf | 0 variables.tf | 34 ++++++++++++++++++++++++++++++++++ 8 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 examples/.gitkeep create mode 100644 main.tf create mode 100644 modules/.gitkeep create mode 100644 outputs.tf create mode 100644 variables.tf diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c54adef --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,19 @@ +repos: + - repo: https://github.com/antonbabenko/pre-commit-terraform + rev: v1.86.0 + hooks: + - id: terraform_fmt + - id: terraform_docs + args: + - "--hook-config=--path-to-file=README.md" + - "--hook-config=--add-to-existing-file=true" + - "--hook-config=--create-file-if-not-exist=true" + - "--args=--escape=false" + - "--args=--lockfile=false" + - "--args=--indent 3" + - "--args=--show all" + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/LICENSE b/LICENSE index 0d756e8..475d657 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,20 @@ -MIT License +The MIT License (MIT) -Copyright (c) 2024 terraform-registry +Copyright (c) 2017 Bertrand Lanson -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index a520e62..98173ca 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,33 @@ # terraform-openstack-security-group -Terraform module to deploy a Neutron security-group in a given project. \ No newline at end of file +Terraform module to deploy a Neutron security-group in a given project. +### Requirements + +No requirements. + +### Providers + +No providers. + +### Modules + +No modules. + +### Resources + +No resources. + +### Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [delete_default_rules](#input_delete_default_rules) | Whether or not to delete the default egress rules applied to the security group.
Default rules allow egress ipv4 and ipv6 to 0.0.0.0/0. | `bool` | `false` | no | +| [description](#input_description) | Description for the security group. | `string` | `null` | no | +| [name](#input_name) | The name of the security group. | `string` | n/a | yes | +| [tags](#input_tags) | A list of tags (strings) to apply to the security group | `list(string)` | `[]` | no | +| [tenant_id](#input_tenant_id) | The tenant for which to create the security group.
This is only required for admins creating security groups for other tenant. | `string` | `null` | no | + +### Outputs + +No outputs. + diff --git a/examples/.gitkeep b/examples/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/main.tf b/main.tf new file mode 100644 index 0000000..e69de29 diff --git a/modules/.gitkeep b/modules/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/outputs.tf b/outputs.tf new file mode 100644 index 0000000..e69de29 diff --git a/variables.tf b/variables.tf new file mode 100644 index 0000000..3c9a77c --- /dev/null +++ b/variables.tf @@ -0,0 +1,34 @@ +variable "name" { + type = string + description = "The name of the security group." +} + +variable "description" { + type = string + description = "Description for the security group." + default = null +} + +variable "delete_default_rules" { + type = bool + description = <<-EOT + Whether or not to delete the default egress rules applied to the security group. + Default rules allow egress ipv4 and ipv6 to 0.0.0.0/0. + EOT + default = false +} + +variable "tenant_id" { + type = string + description = <<-EOT + The tenant for which to create the security group. + This is only required for admins creating security groups for other tenant. + EOT + default = null +} + +variable "tags" { + type = list(string) + description = "A list of tags (strings) to apply to the security group" + default = [] +}