diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 3973df4..1e50760 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -14,7 +14,7 @@ jobs: steps: # Please look up the latest version from # https://github.com/amannn/action-semantic-pull-request/releases - - uses: amannn/action-semantic-pull-request@v5.4.0 + - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 6cd4b18..23318bc 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -7,8 +7,8 @@ on: - master env: - TERRAFORM_DOCS_VERSION: v0.16.0 - TFLINT_VERSION: v0.50.3 + TERRAFORM_DOCS_VERSION: v0.19.0 + TFLINT_VERSION: v0.53.0 jobs: collectInputs: @@ -45,14 +45,14 @@ jobs: - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.3.0 + uses: clowdhaus/terraform-min-max@v1.3.1 with: directory: ${{ matrix.directory }} - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory != '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} tflint-version: ${{ env.TFLINT_VERSION }} @@ -61,7 +61,7 @@ jobs: - name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }} # Run only validate pre-commit check on min version supported if: ${{ matrix.directory == '.' }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.minVersion }} tflint-version: ${{ env.TFLINT_VERSION }} @@ -92,7 +92,7 @@ jobs: sudo apt-get -qq remove -y 'postgresql-.*' sudo apt-get -qq remove -y 'php.*' sudo apt-get -qq remove -y 'temurin-.*' - sudo apt-get -qq remove -y kubectl firefox powershell mono-devel + sudo apt-get -qq remove -y kubectl firefox mono-devel sudo apt-get -qq autoremove -y sudo apt-get -qq clean df -h @@ -105,14 +105,14 @@ jobs: - name: Terraform min/max versions id: minMax - uses: clowdhaus/terraform-min-max@v1.3.0 + uses: clowdhaus/terraform-min-max@v1.3.1 # Special to this repo, we don't want to check this dir - name: Hide template dir run: rm -rf modules/_templates - name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }} - uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 + uses: clowdhaus/terraform-composite-actions/pre-commit@v1.11.1 with: terraform-version: ${{ steps.minMax.outputs.maxVersion }} tflint-version: ${{ env.TFLINT_VERSION }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd8599b..a0f2722 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,19 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.88.0 + rev: v1.96.1 hooks: - id: terraform_fmt + - id: terraform_wrapper_module_for_each - id: terraform_docs args: - '--args=--lockfile=false' - id: terraform_validate - exclude: '^modules/_templates/[^/]+$' + exclude: '^modules/_templates/[^/]+$|^wrappers/.+$' - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v5.0.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer - id: trailing-whitespace + - id: mixed-line-ending + args: [--fix=lf] diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d4071a..1aa9ceb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. +## [5.3.0](https://github.com/terraform-aws-modules/terraform-aws-security-group/compare/v5.2.0...v5.3.0) (2025-01-08) + + +### Features + +* Added wrappers for all submodules ([#333](https://github.com/terraform-aws-modules/terraform-aws-security-group/issues/333)) ([8500adb](https://github.com/terraform-aws-modules/terraform-aws-security-group/commit/8500adbc068bb1c1c244435abc9e7e6dbeddf21d)) + + +### Bug Fixes + +* Update CI workflow versions to latest ([#329](https://github.com/terraform-aws-modules/terraform-aws-security-group/issues/329)) ([43798ea](https://github.com/terraform-aws-modules/terraform-aws-security-group/commit/43798eab255616bd23ef4140f50252d585c9c51b)) + ## [5.2.0](https://github.com/terraform-aws-modules/terraform-aws-security-group/compare/v5.1.2...v5.2.0) (2024-08-31) diff --git a/README.md b/README.md index c781d2d..4b0d449 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ Rules and groups are defined in [rules.tf](https://github.com/terraform-aws-modu No issue is creating limit on this module. - + ## Requirements | Name | Version | @@ -207,7 +207,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [auto\_groups](#input\_auto\_groups) | Map of groups of security group rules to use to generate modules (see update\_groups.sh) | `map(map(list(string)))` |
{
"activemq": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"activemq-5671-tcp",
"activemq-8883-tcp",
"activemq-61614-tcp",
"activemq-61617-tcp",
"activemq-61619-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"alertmanager": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"alertmanager-9093-tcp",
"alertmanager-9094-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"carbon-relay-ng": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"carbon-line-in-tcp",
"carbon-line-in-udp",
"carbon-pickle-tcp",
"carbon-pickle-udp",
"carbon-gui-udp"
],
"ingress_with_self": [
"all-all"
]
},
"cassandra": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"cassandra-clients-tcp",
"cassandra-thrift-clients-tcp",
"cassandra-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"consul": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"consul-tcp",
"consul-grpc-tcp",
"consul-grpc-tcp-tls",
"consul-webui-http-tcp",
"consul-webui-https-tcp",
"consul-dns-tcp",
"consul-dns-udp",
"consul-serf-lan-tcp",
"consul-serf-lan-udp",
"consul-serf-wan-tcp",
"consul-serf-wan-udp"
],
"ingress_with_self": [
"all-all"
]
},
"dax-cluster": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"dax-cluster-unencrypted-tcp",
"dax-cluster-encrypted-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"docker-swarm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"docker-swarm-mngmt-tcp",
"docker-swarm-node-tcp",
"docker-swarm-node-udp",
"docker-swarm-overlay-udp"
],
"ingress_with_self": [
"all-all"
]
},
"elasticsearch": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"elasticsearch-rest-tcp",
"elasticsearch-java-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"etcd": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"etcd-client-tcp",
"etcd-peer-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"grafana": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"grafana-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"graphite-statsd": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"graphite-webui",
"graphite-2003-tcp",
"graphite-2004-tcp",
"graphite-2023-tcp",
"graphite-2024-tcp",
"graphite-8080-tcp",
"graphite-8125-tcp",
"graphite-8125-udp",
"graphite-8126-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"http-80": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-80-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"http-8080": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-8080-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"https-443": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"https-443-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"https-8443": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"https-8443-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ipsec-4500": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ipsec-4500-udp"
],
"ingress_with_self": [
"all-all"
]
},
"ipsec-500": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ipsec-500-udp"
],
"ingress_with_self": [
"all-all"
]
},
"kafka": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kafka-broker-tcp",
"kafka-broker-tls-tcp",
"kafka-broker-tls-public-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-iam-tcp",
"kafka-broker-sasl-iam-public-tcp",
"kafka-jmx-exporter-tcp",
"kafka-node-exporter-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"kibana": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kibana-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"kubernetes-api": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kubernetes-api-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ldap": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ldap-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ldaps": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ldaps-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"logstash": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"logstash-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"loki": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"loki-grafana",
"loki-grafana-grpc"
],
"ingress_with_self": [
"all-all"
]
},
"memcached": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"memcached-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"minio": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"minio-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mongodb": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mongodb-27017-tcp",
"mongodb-27018-tcp",
"mongodb-27019-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mssql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mssql-tcp",
"mssql-udp",
"mssql-analytics-tcp",
"mssql-broker-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mysql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mysql-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"nfs": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"nfs-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"nomad": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"nomad-http-tcp",
"nomad-rpc-tcp",
"nomad-serf-tcp",
"nomad-serf-udp"
],
"ingress_with_self": [
"all-all"
]
},
"ntp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ntp-udp"
],
"ingress_with_self": [
"all-all"
]
},
"openvpn": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"openvpn-udp",
"openvpn-tcp",
"openvpn-https-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"oracle-db": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"oracle-db-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"postgresql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"postgresql-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"prometheus": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"prometheus-http-tcp",
"prometheus-pushgateway-http-tcp",
"prometheus-node-exporter-http-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"promtail": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"promtail-http"
],
"ingress_with_self": [
"all-all"
]
},
"puppet": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"puppet-tcp",
"puppetdb-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"rabbitmq": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"rabbitmq-4369-tcp",
"rabbitmq-5671-tcp",
"rabbitmq-5672-tcp",
"rabbitmq-15672-tcp",
"rabbitmq-25672-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"rdp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"rdp-tcp",
"rdp-udp"
],
"ingress_with_self": [
"all-all"
]
},
"redis": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"redis-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"redshift": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"redshift-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtp-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtp-submission": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtp-submission-587-tcp",
"smtp-submission-2587-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtps": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtps-465-tcp",
"smtps-2465-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"solr": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"solr-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"splunk": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"splunk-indexer-tcp",
"splunk-web-tcp",
"splunk-splunkd-tcp",
"splunk-hec-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"squid": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"squid-proxy-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ssh": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ssh-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"storm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"storm-nimbus-tcp",
"storm-ui-tcp",
"storm-supervisor-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"vault": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"vault-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"wazuh": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"wazuh-server-agent-connection-tcp",
"wazuh-server-agent-connection-udp",
"wazuh-server-agent-enrollment",
"wazuh-server-agent-cluster-daemon",
"wazuh-server-syslog-collector-tcp",
"wazuh-server-syslog-collector-udp",
"wazuh-server-restful-api",
"wazuh-indexer-restful-api",
"wazuh-dashboard"
],
"ingress_with_self": [
"all-all"
]
},
"web": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-80-tcp",
"http-8080-tcp",
"https-443-tcp",
"web-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"winrm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"winrm-http-tcp",
"winrm-https-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"zabbix": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zabbix-server",
"zabbix-proxy",
"zabbix-agent"
],
"ingress_with_self": [
"all-all"
]
},
"zipkin": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zipkin-admin-tcp",
"zipkin-admin-query-tcp",
"zipkin-admin-web-tcp",
"zipkin-query-tcp",
"zipkin-web-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"zookeeper": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zookeeper-2181-tcp",
"zookeeper-2182-tls-tcp",
"zookeeper-2888-tcp",
"zookeeper-3888-tcp",
"zookeeper-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
}
}
| no | +| [auto\_groups](#input\_auto\_groups) | Map of groups of security group rules to use to generate modules (see update\_groups.sh) | `map(map(list(string)))` |
{
"activemq": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"activemq-5671-tcp",
"activemq-8883-tcp",
"activemq-61614-tcp",
"activemq-61617-tcp",
"activemq-61619-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"alertmanager": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"alertmanager-9093-tcp",
"alertmanager-9094-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"carbon-relay-ng": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"carbon-line-in-tcp",
"carbon-line-in-udp",
"carbon-pickle-tcp",
"carbon-pickle-udp",
"carbon-gui-udp"
],
"ingress_with_self": [
"all-all"
]
},
"cassandra": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"cassandra-clients-tcp",
"cassandra-thrift-clients-tcp",
"cassandra-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"consul": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"consul-tcp",
"consul-grpc-tcp",
"consul-grpc-tcp-tls",
"consul-webui-http-tcp",
"consul-webui-https-tcp",
"consul-dns-tcp",
"consul-dns-udp",
"consul-serf-lan-tcp",
"consul-serf-lan-udp",
"consul-serf-wan-tcp",
"consul-serf-wan-udp"
],
"ingress_with_self": [
"all-all"
]
},
"dax-cluster": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"dax-cluster-unencrypted-tcp",
"dax-cluster-encrypted-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"docker-swarm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"docker-swarm-mngmt-tcp",
"docker-swarm-node-tcp",
"docker-swarm-node-udp",
"docker-swarm-overlay-udp"
],
"ingress_with_self": [
"all-all"
]
},
"elasticsearch": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"elasticsearch-rest-tcp",
"elasticsearch-java-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"etcd": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"etcd-client-tcp",
"etcd-peer-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"grafana": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"grafana-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"graphite-statsd": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"graphite-webui",
"graphite-2003-tcp",
"graphite-2004-tcp",
"graphite-2023-tcp",
"graphite-2024-tcp",
"graphite-8080-tcp",
"graphite-8125-tcp",
"graphite-8125-udp",
"graphite-8126-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"http-80": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-80-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"http-8080": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-8080-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"https-443": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"https-443-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"https-8443": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"https-8443-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ipsec-4500": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ipsec-4500-udp"
],
"ingress_with_self": [
"all-all"
]
},
"ipsec-500": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ipsec-500-udp"
],
"ingress_with_self": [
"all-all"
]
},
"kafka": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kafka-broker-tcp",
"kafka-broker-tls-tcp",
"kafka-broker-tls-public-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-iam-tcp",
"kafka-broker-sasl-iam-public-tcp",
"kafka-jmx-exporter-tcp",
"kafka-node-exporter-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"kibana": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kibana-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"kubernetes-api": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"kubernetes-api-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ldap": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ldap-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ldaps": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ldaps-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"logstash": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"logstash-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"loki": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"loki-grafana",
"loki-grafana-grpc"
],
"ingress_with_self": [
"all-all"
]
},
"memcached": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"memcached-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"minio": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"minio-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mongodb": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mongodb-27017-tcp",
"mongodb-27018-tcp",
"mongodb-27019-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mssql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mssql-tcp",
"mssql-udp",
"mssql-analytics-tcp",
"mssql-broker-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"mysql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"mysql-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"nfs": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"nfs-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"nomad": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"nomad-http-tcp",
"nomad-rpc-tcp",
"nomad-serf-tcp",
"nomad-serf-udp"
],
"ingress_with_self": [
"all-all"
]
},
"ntp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ntp-udp"
],
"ingress_with_self": [
"all-all"
]
},
"openvpn": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"openvpn-udp",
"openvpn-tcp",
"openvpn-https-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"oracle-db": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"oracle-db-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"postgresql": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"postgresql-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"prometheus": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"prometheus-http-tcp",
"prometheus-pushgateway-http-tcp",
"prometheus-node-exporter-http-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"promtail": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"promtail-http"
],
"ingress_with_self": [
"all-all"
]
},
"puppet": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"puppet-tcp",
"puppetdb-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"rabbitmq": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"rabbitmq-4369-tcp",
"rabbitmq-5671-tcp",
"rabbitmq-5672-tcp",
"rabbitmq-15672-tcp",
"rabbitmq-25672-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"rdp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"rdp-tcp",
"rdp-udp"
],
"ingress_with_self": [
"all-all"
]
},
"redis": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"redis-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"redshift": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"redshift-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtp": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtp-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtp-submission": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtp-submission-587-tcp",
"smtp-submission-2587-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"smtps": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"smtps-465-tcp",
"smtps-2465-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"solr": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"solr-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"splunk": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"splunk-indexer-tcp",
"splunk-web-tcp",
"splunk-splunkd-tcp",
"splunk-hec-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"squid": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"squid-proxy-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"ssh": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"ssh-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"storm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"storm-nimbus-tcp",
"storm-ui-tcp",
"storm-supervisor-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"vault": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"vault-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"wazuh": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"wazuh-server-agent-connection-tcp",
"wazuh-server-agent-connection-udp",
"wazuh-server-agent-enrollment",
"wazuh-server-agent-cluster-daemon",
"wazuh-server-syslog-collector-tcp",
"wazuh-server-syslog-collector-udp",
"wazuh-server-restful-api",
"wazuh-indexer-restful-api",
"wazuh-dashboard"
],
"ingress_with_self": [
"all-all"
]
},
"web": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"http-80-tcp",
"http-8080-tcp",
"https-443-tcp",
"web-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"winrm": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"winrm-http-tcp",
"winrm-https-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"zabbix": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zabbix-server",
"zabbix-proxy",
"zabbix-agent"
],
"ingress_with_self": [
"all-all"
]
},
"zipkin": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zipkin-admin-tcp",
"zipkin-admin-query-tcp",
"zipkin-admin-web-tcp",
"zipkin-query-tcp",
"zipkin-web-tcp"
],
"ingress_with_self": [
"all-all"
]
},
"zookeeper": {
"egress_rules": [
"all-all"
],
"ingress_rules": [
"zookeeper-2181-tcp",
"zookeeper-2182-tls-tcp",
"zookeeper-2888-tcp",
"zookeeper-3888-tcp",
"zookeeper-jmx-tcp"
],
"ingress_with_self": [
"all-all"
]
}
}
| no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | | [computed\_egress\_with\_ipv6\_cidr\_blocks](#input\_computed\_egress\_with\_ipv6\_cidr\_blocks) | List of computed egress rules to create where 'ipv6\_cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -225,8 +225,8 @@ No modules. | [create\_timeout](#input\_create\_timeout) | Time to wait for a security group to be created | `string` | `"10m"` | no | | [delete\_timeout](#input\_delete\_timeout) | Time to wait for a security group to be deleted | `string` | `"15m"` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -258,7 +258,7 @@ No modules. | [number\_of\_computed\_ingress\_with\_source\_security\_group\_id](#input\_number\_of\_computed\_ingress\_with\_source\_security\_group\_id) | Number of computed ingress rules to create where 'source\_security\_group\_id' is used | `number` | `0` | no | | [putin\_khuylo](#input\_putin\_khuylo) | Do you agree that Putin doesn't respect Ukrainian sovereignty and territorial integrity? More info: https://en.wikipedia.org/wiki/Putin_khuylo! | `bool` | `true` | no | | [revoke\_rules\_on\_delete](#input\_revoke\_rules\_on\_delete) | Instruct Terraform to revoke all of the Security Groups attached ingress and egress rules before deleting the rule itself. Enable for EMR. | `bool` | `false` | no | -| [rules](#input\_rules) | Map of known security group rules (define as 'name' = ['from port', 'to port', 'protocol', 'description']) | `map(list(any))` |
{
"_": [
"",
"",
""
],
"activemq-5671-tcp": [
5671,
5671,
"tcp",
"ActiveMQ AMQP"
],
"activemq-61614-tcp": [
61614,
61614,
"tcp",
"ActiveMQ STOMP"
],
"activemq-61617-tcp": [
61617,
61617,
"tcp",
"ActiveMQ OpenWire"
],
"activemq-61619-tcp": [
61619,
61619,
"tcp",
"ActiveMQ WebSocket"
],
"activemq-8883-tcp": [
8883,
8883,
"tcp",
"ActiveMQ MQTT"
],
"alertmanager-9093-tcp": [
9093,
9093,
"tcp",
"Alert Manager"
],
"alertmanager-9094-tcp": [
9094,
9094,
"tcp",
"Alert Manager Cluster"
],
"all-all": [
-1,
-1,
"-1",
"All protocols"
],
"all-icmp": [
-1,
-1,
"icmp",
"All IPV4 ICMP"
],
"all-ipv6-icmp": [
-1,
-1,
58,
"All IPV6 ICMP"
],
"all-tcp": [
0,
65535,
"tcp",
"All TCP ports"
],
"all-udp": [
0,
65535,
"udp",
"All UDP ports"
],
"carbon-admin-tcp": [
2004,
2004,
"tcp",
"Carbon admin"
],
"carbon-gui-udp": [
8081,
8081,
"tcp",
"Carbon GUI"
],
"carbon-line-in-tcp": [
2003,
2003,
"tcp",
"Carbon line-in"
],
"carbon-line-in-udp": [
2003,
2003,
"udp",
"Carbon line-in"
],
"carbon-pickle-tcp": [
2013,
2013,
"tcp",
"Carbon pickle"
],
"carbon-pickle-udp": [
2013,
2013,
"udp",
"Carbon pickle"
],
"cassandra-clients-tcp": [
9042,
9042,
"tcp",
"Cassandra clients"
],
"cassandra-jmx-tcp": [
7199,
7199,
"tcp",
"JMX"
],
"cassandra-thrift-clients-tcp": [
9160,
9160,
"tcp",
"Cassandra Thrift clients"
],
"consul-dns-tcp": [
8600,
8600,
"tcp",
"Consul DNS"
],
"consul-dns-udp": [
8600,
8600,
"udp",
"Consul DNS"
],
"consul-grpc-tcp": [
8502,
8502,
"tcp",
"Consul gRPC"
],
"consul-grpc-tcp-tls": [
8503,
8503,
"tcp",
"Consul gRPC TLS"
],
"consul-serf-lan-tcp": [
8301,
8301,
"tcp",
"Serf LAN"
],
"consul-serf-lan-udp": [
8301,
8301,
"udp",
"Serf LAN"
],
"consul-serf-wan-tcp": [
8302,
8302,
"tcp",
"Serf WAN"
],
"consul-serf-wan-udp": [
8302,
8302,
"udp",
"Serf WAN"
],
"consul-tcp": [
8300,
8300,
"tcp",
"Consul server"
],
"consul-webui-http-tcp": [
8500,
8500,
"tcp",
"Consul web UI HTTP"
],
"consul-webui-https-tcp": [
8501,
8501,
"tcp",
"Consul web UI HTTPS"
],
"dax-cluster-encrypted-tcp": [
9111,
9111,
"tcp",
"DAX Cluster encrypted"
],
"dax-cluster-unencrypted-tcp": [
8111,
8111,
"tcp",
"DAX Cluster unencrypted"
],
"dns-tcp": [
53,
53,
"tcp",
"DNS"
],
"dns-udp": [
53,
53,
"udp",
"DNS"
],
"docker-swarm-mngmt-tcp": [
2377,
2377,
"tcp",
"Docker Swarm cluster management"
],
"docker-swarm-node-tcp": [
7946,
7946,
"tcp",
"Docker Swarm node"
],
"docker-swarm-node-udp": [
7946,
7946,
"udp",
"Docker Swarm node"
],
"docker-swarm-overlay-udp": [
4789,
4789,
"udp",
"Docker Swarm Overlay Network Traffic"
],
"elasticsearch-java-tcp": [
9300,
9300,
"tcp",
"Elasticsearch Java interface"
],
"elasticsearch-rest-tcp": [
9200,
9200,
"tcp",
"Elasticsearch REST interface"
],
"etcd-client-tcp": [
2379,
2379,
"tcp",
"Etcd Client"
],
"etcd-peer-tcp": [
2380,
2380,
"tcp",
"Etcd Peer"
],
"grafana-tcp": [
3000,
3000,
"tcp",
"Grafana Dashboard"
],
"graphite-2003-tcp": [
2003,
2003,
"tcp",
"Carbon receiver plain text"
],
"graphite-2004-tcp": [
2004,
2004,
"tcp",
"Carbon receiver pickle"
],
"graphite-2023-tcp": [
2023,
2023,
"tcp",
"Carbon aggregator plaintext"
],
"graphite-2024-tcp": [
2024,
2024,
"tcp",
"Carbon aggregator pickle"
],
"graphite-8080-tcp": [
8080,
8080,
"tcp",
"Graphite gunicorn port"
],
"graphite-8125-tcp": [
8125,
8125,
"tcp",
"Statsd TCP"
],
"graphite-8125-udp": [
8125,
8125,
"udp",
"Statsd UDP default"
],
"graphite-8126-tcp": [
8126,
8126,
"tcp",
"Statsd admin"
],
"graphite-webui": [
80,
80,
"tcp",
"Graphite admin interface"
],
"http-80-tcp": [
80,
80,
"tcp",
"HTTP"
],
"http-8080-tcp": [
8080,
8080,
"tcp",
"HTTP"
],
"https-443-tcp": [
443,
443,
"tcp",
"HTTPS"
],
"https-8443-tcp": [
8443,
8443,
"tcp",
"HTTPS"
],
"ipsec-4500-udp": [
4500,
4500,
"udp",
"IPSEC NAT-T"
],
"ipsec-500-udp": [
500,
500,
"udp",
"IPSEC ISAKMP"
],
"kafka-broker-sasl-iam-public-tcp": [
9198,
9198,
"tcp",
"Kafka SASL/IAM Public access control enabled (MSK specific)"
],
"kafka-broker-sasl-iam-tcp": [
9098,
9098,
"tcp",
"Kafka SASL/IAM access control enabled (MSK specific)"
],
"kafka-broker-sasl-scram-public-tcp": [
9196,
9196,
"tcp",
"Kafka SASL/SCRAM Public enabled broker (MSK specific)"
],
"kafka-broker-sasl-scram-tcp": [
9096,
9096,
"tcp",
"Kafka SASL/SCRAM enabled broker (MSK specific)"
],
"kafka-broker-tcp": [
9092,
9092,
"tcp",
"Kafka PLAINTEXT enable broker 0.8.2+"
],
"kafka-broker-tls-public-tcp": [
9194,
9194,
"tcp",
"Kafka TLS Public enabled broker 0.8.2+ (MSK specific)"
],
"kafka-broker-tls-tcp": [
9094,
9094,
"tcp",
"Kafka TLS enabled broker 0.8.2+"
],
"kafka-jmx-exporter-tcp": [
11001,
11001,
"tcp",
"Kafka JMX Exporter"
],
"kafka-node-exporter-tcp": [
11002,
11002,
"tcp",
"Kafka Node Exporter"
],
"kibana-tcp": [
5601,
5601,
"tcp",
"Kibana Web Interface"
],
"kubernetes-api-tcp": [
6443,
6443,
"tcp",
"Kubernetes API Server"
],
"ldap-tcp": [
389,
389,
"tcp",
"LDAP"
],
"ldaps-tcp": [
636,
636,
"tcp",
"LDAPS"
],
"logstash-tcp": [
5044,
5044,
"tcp",
"Logstash"
],
"loki-grafana": [
3100,
3100,
"tcp",
"Grafana Loki endpoint"
],
"loki-grafana-grpc": [
9095,
9095,
"tcp",
"Grafana Loki GRPC"
],
"memcached-tcp": [
11211,
11211,
"tcp",
"Memcached"
],
"minio-tcp": [
9000,
9000,
"tcp",
"MinIO"
],
"mongodb-27017-tcp": [
27017,
27017,
"tcp",
"MongoDB"
],
"mongodb-27018-tcp": [
27018,
27018,
"tcp",
"MongoDB shard"
],
"mongodb-27019-tcp": [
27019,
27019,
"tcp",
"MongoDB config server"
],
"mssql-analytics-tcp": [
2383,
2383,
"tcp",
"MSSQL Analytics"
],
"mssql-broker-tcp": [
4022,
4022,
"tcp",
"MSSQL Broker"
],
"mssql-tcp": [
1433,
1433,
"tcp",
"MSSQL Server"
],
"mssql-udp": [
1434,
1434,
"udp",
"MSSQL Browser"
],
"mysql-tcp": [
3306,
3306,
"tcp",
"MySQL/Aurora"
],
"nfs-tcp": [
2049,
2049,
"tcp",
"NFS/EFS"
],
"nomad-http-tcp": [
4646,
4646,
"tcp",
"Nomad HTTP"
],
"nomad-rpc-tcp": [
4647,
4647,
"tcp",
"Nomad RPC"
],
"nomad-serf-tcp": [
4648,
4648,
"tcp",
"Serf"
],
"nomad-serf-udp": [
4648,
4648,
"udp",
"Serf"
],
"ntp-udp": [
123,
123,
"udp",
"NTP"
],
"octopus-tentacle-tcp": [
10933,
10933,
"tcp",
"Octopus Tentacle"
],
"openvpn-https-tcp": [
443,
443,
"tcp",
"OpenVPN"
],
"openvpn-tcp": [
943,
943,
"tcp",
"OpenVPN"
],
"openvpn-udp": [
1194,
1194,
"udp",
"OpenVPN"
],
"oracle-db-tcp": [
1521,
1521,
"tcp",
"Oracle"
],
"postgresql-tcp": [
5432,
5432,
"tcp",
"PostgreSQL"
],
"prometheus-http-tcp": [
9090,
9090,
"tcp",
"Prometheus"
],
"prometheus-node-exporter-http-tcp": [
9100,
9100,
"tcp",
"Prometheus Node Exporter"
],
"prometheus-pushgateway-http-tcp": [
9091,
9091,
"tcp",
"Prometheus Pushgateway"
],
"promtail-http": [
9080,
9080,
"tcp",
"Promtail endpoint"
],
"puppet-tcp": [
8140,
8140,
"tcp",
"Puppet"
],
"puppetdb-tcp": [
8081,
8081,
"tcp",
"PuppetDB"
],
"rabbitmq-15672-tcp": [
15672,
15672,
"tcp",
"RabbitMQ"
],
"rabbitmq-25672-tcp": [
25672,
25672,
"tcp",
"RabbitMQ"
],
"rabbitmq-4369-tcp": [
4369,
4369,
"tcp",
"RabbitMQ epmd"
],
"rabbitmq-5671-tcp": [
5671,
5671,
"tcp",
"RabbitMQ"
],
"rabbitmq-5672-tcp": [
5672,
5672,
"tcp",
"RabbitMQ"
],
"rdp-tcp": [
3389,
3389,
"tcp",
"Remote Desktop"
],
"rdp-udp": [
3389,
3389,
"udp",
"Remote Desktop"
],
"redis-tcp": [
6379,
6379,
"tcp",
"Redis"
],
"redshift-tcp": [
5439,
5439,
"tcp",
"Redshift"
],
"saltstack-tcp": [
4505,
4506,
"tcp",
"SaltStack"
],
"smtp-submission-2587-tcp": [
2587,
2587,
"tcp",
"SMTP Submission"
],
"smtp-submission-587-tcp": [
587,
587,
"tcp",
"SMTP Submission"
],
"smtp-tcp": [
25,
25,
"tcp",
"SMTP"
],
"smtps-2456-tcp": [
2465,
2465,
"tcp",
"SMTPS"
],
"smtps-465-tcp": [
465,
465,
"tcp",
"SMTPS"
],
"solr-tcp": [
8983,
8987,
"tcp",
"Solr"
],
"splunk-hec-tcp": [
8088,
8088,
"tcp",
"Splunk HEC"
],
"splunk-indexer-tcp": [
9997,
9997,
"tcp",
"Splunk indexer"
],
"splunk-splunkd-tcp": [
8089,
8089,
"tcp",
"Splunkd"
],
"splunk-web-tcp": [
8000,
8000,
"tcp",
"Splunk Web"
],
"squid-proxy-tcp": [
3128,
3128,
"tcp",
"Squid default proxy"
],
"ssh-tcp": [
22,
22,
"tcp",
"SSH"
],
"storm-nimbus-tcp": [
6627,
6627,
"tcp",
"Nimbus"
],
"storm-supervisor-tcp": [
6700,
6703,
"tcp",
"Supervisor"
],
"storm-ui-tcp": [
8080,
8080,
"tcp",
"Storm UI"
],
"vault-tcp": [
8200,
8200,
"tcp",
"Vault"
],
"wazuh-dashboard": [
443,
443,
"tcp",
"Wazuh web user interface"
],
"wazuh-indexer-restful-api": [
9200,
9200,
"tcp",
"Wazuh indexer RESTful API"
],
"wazuh-server-agent-cluster-daemon": [
1516,
1516,
"tcp",
"Wazuh cluster daemon"
],
"wazuh-server-agent-connection-tcp": [
1514,
1514,
"tcp",
"Agent connection service(TCP)"
],
"wazuh-server-agent-connection-udp": [
1514,
1514,
"udp",
"Agent connection service(UDP)"
],
"wazuh-server-agent-enrollment": [
1515,
1515,
"tcp",
"Agent enrollment service"
],
"wazuh-server-restful-api": [
55000,
55000,
"tcp",
"Wazuh server RESTful API"
],
"wazuh-server-syslog-collector-tcp": [
514,
514,
"tcp",
"Wazuh Syslog collector(TCP)"
],
"wazuh-server-syslog-collector-udp": [
514,
514,
"udp",
"Wazuh Syslog collector(UDP)"
],
"web-jmx-tcp": [
1099,
1099,
"tcp",
"JMX"
],
"winrm-http-tcp": [
5985,
5985,
"tcp",
"WinRM HTTP"
],
"winrm-https-tcp": [
5986,
5986,
"tcp",
"WinRM HTTPS"
],
"zabbix-agent": [
10050,
10050,
"tcp",
"Zabbix Agent"
],
"zabbix-proxy": [
10051,
10051,
"tcp",
"Zabbix Proxy"
],
"zabbix-server": [
10051,
10051,
"tcp",
"Zabbix Server"
],
"zipkin-admin-query-tcp": [
9901,
9901,
"tcp",
"Zipkin Admin port query"
],
"zipkin-admin-tcp": [
9990,
9990,
"tcp",
"Zipkin Admin port collector"
],
"zipkin-admin-web-tcp": [
9991,
9991,
"tcp",
"Zipkin Admin port web"
],
"zipkin-query-tcp": [
9411,
9411,
"tcp",
"Zipkin query port"
],
"zipkin-web-tcp": [
8080,
8080,
"tcp",
"Zipkin web port"
],
"zookeeper-2181-tcp": [
2181,
2181,
"tcp",
"Zookeeper"
],
"zookeeper-2182-tls-tcp": [
2182,
2182,
"tcp",
"Zookeeper TLS (MSK specific)"
],
"zookeeper-2888-tcp": [
2888,
2888,
"tcp",
"Zookeeper"
],
"zookeeper-3888-tcp": [
3888,
3888,
"tcp",
"Zookeeper"
],
"zookeeper-jmx-tcp": [
7199,
7199,
"tcp",
"JMX"
]
}
| no | +| [rules](#input\_rules) | Map of known security group rules (define as 'name' = ['from port', 'to port', 'protocol', 'description']) | `map(list(any))` |
{
"_": [
"",
"",
""
],
"activemq-5671-tcp": [
5671,
5671,
"tcp",
"ActiveMQ AMQP"
],
"activemq-61614-tcp": [
61614,
61614,
"tcp",
"ActiveMQ STOMP"
],
"activemq-61617-tcp": [
61617,
61617,
"tcp",
"ActiveMQ OpenWire"
],
"activemq-61619-tcp": [
61619,
61619,
"tcp",
"ActiveMQ WebSocket"
],
"activemq-8883-tcp": [
8883,
8883,
"tcp",
"ActiveMQ MQTT"
],
"alertmanager-9093-tcp": [
9093,
9093,
"tcp",
"Alert Manager"
],
"alertmanager-9094-tcp": [
9094,
9094,
"tcp",
"Alert Manager Cluster"
],
"all-all": [
-1,
-1,
"-1",
"All protocols"
],
"all-icmp": [
-1,
-1,
"icmp",
"All IPV4 ICMP"
],
"all-ipv6-icmp": [
-1,
-1,
58,
"All IPV6 ICMP"
],
"all-tcp": [
0,
65535,
"tcp",
"All TCP ports"
],
"all-udp": [
0,
65535,
"udp",
"All UDP ports"
],
"carbon-admin-tcp": [
2004,
2004,
"tcp",
"Carbon admin"
],
"carbon-gui-udp": [
8081,
8081,
"tcp",
"Carbon GUI"
],
"carbon-line-in-tcp": [
2003,
2003,
"tcp",
"Carbon line-in"
],
"carbon-line-in-udp": [
2003,
2003,
"udp",
"Carbon line-in"
],
"carbon-pickle-tcp": [
2013,
2013,
"tcp",
"Carbon pickle"
],
"carbon-pickle-udp": [
2013,
2013,
"udp",
"Carbon pickle"
],
"cassandra-clients-tcp": [
9042,
9042,
"tcp",
"Cassandra clients"
],
"cassandra-jmx-tcp": [
7199,
7199,
"tcp",
"JMX"
],
"cassandra-thrift-clients-tcp": [
9160,
9160,
"tcp",
"Cassandra Thrift clients"
],
"consul-dns-tcp": [
8600,
8600,
"tcp",
"Consul DNS"
],
"consul-dns-udp": [
8600,
8600,
"udp",
"Consul DNS"
],
"consul-grpc-tcp": [
8502,
8502,
"tcp",
"Consul gRPC"
],
"consul-grpc-tcp-tls": [
8503,
8503,
"tcp",
"Consul gRPC TLS"
],
"consul-serf-lan-tcp": [
8301,
8301,
"tcp",
"Serf LAN"
],
"consul-serf-lan-udp": [
8301,
8301,
"udp",
"Serf LAN"
],
"consul-serf-wan-tcp": [
8302,
8302,
"tcp",
"Serf WAN"
],
"consul-serf-wan-udp": [
8302,
8302,
"udp",
"Serf WAN"
],
"consul-tcp": [
8300,
8300,
"tcp",
"Consul server"
],
"consul-webui-http-tcp": [
8500,
8500,
"tcp",
"Consul web UI HTTP"
],
"consul-webui-https-tcp": [
8501,
8501,
"tcp",
"Consul web UI HTTPS"
],
"dax-cluster-encrypted-tcp": [
9111,
9111,
"tcp",
"DAX Cluster encrypted"
],
"dax-cluster-unencrypted-tcp": [
8111,
8111,
"tcp",
"DAX Cluster unencrypted"
],
"dns-tcp": [
53,
53,
"tcp",
"DNS"
],
"dns-udp": [
53,
53,
"udp",
"DNS"
],
"docker-swarm-mngmt-tcp": [
2377,
2377,
"tcp",
"Docker Swarm cluster management"
],
"docker-swarm-node-tcp": [
7946,
7946,
"tcp",
"Docker Swarm node"
],
"docker-swarm-node-udp": [
7946,
7946,
"udp",
"Docker Swarm node"
],
"docker-swarm-overlay-udp": [
4789,
4789,
"udp",
"Docker Swarm Overlay Network Traffic"
],
"elasticsearch-java-tcp": [
9300,
9300,
"tcp",
"Elasticsearch Java interface"
],
"elasticsearch-rest-tcp": [
9200,
9200,
"tcp",
"Elasticsearch REST interface"
],
"etcd-client-tcp": [
2379,
2379,
"tcp",
"Etcd Client"
],
"etcd-peer-tcp": [
2380,
2380,
"tcp",
"Etcd Peer"
],
"grafana-tcp": [
3000,
3000,
"tcp",
"Grafana Dashboard"
],
"graphite-2003-tcp": [
2003,
2003,
"tcp",
"Carbon receiver plain text"
],
"graphite-2004-tcp": [
2004,
2004,
"tcp",
"Carbon receiver pickle"
],
"graphite-2023-tcp": [
2023,
2023,
"tcp",
"Carbon aggregator plaintext"
],
"graphite-2024-tcp": [
2024,
2024,
"tcp",
"Carbon aggregator pickle"
],
"graphite-8080-tcp": [
8080,
8080,
"tcp",
"Graphite gunicorn port"
],
"graphite-8125-tcp": [
8125,
8125,
"tcp",
"Statsd TCP"
],
"graphite-8125-udp": [
8125,
8125,
"udp",
"Statsd UDP default"
],
"graphite-8126-tcp": [
8126,
8126,
"tcp",
"Statsd admin"
],
"graphite-webui": [
80,
80,
"tcp",
"Graphite admin interface"
],
"http-80-tcp": [
80,
80,
"tcp",
"HTTP"
],
"http-8080-tcp": [
8080,
8080,
"tcp",
"HTTP"
],
"https-443-tcp": [
443,
443,
"tcp",
"HTTPS"
],
"https-8443-tcp": [
8443,
8443,
"tcp",
"HTTPS"
],
"ipsec-4500-udp": [
4500,
4500,
"udp",
"IPSEC NAT-T"
],
"ipsec-500-udp": [
500,
500,
"udp",
"IPSEC ISAKMP"
],
"kafka-broker-sasl-iam-public-tcp": [
9198,
9198,
"tcp",
"Kafka SASL/IAM Public access control enabled (MSK specific)"
],
"kafka-broker-sasl-iam-tcp": [
9098,
9098,
"tcp",
"Kafka SASL/IAM access control enabled (MSK specific)"
],
"kafka-broker-sasl-scram-public-tcp": [
9196,
9196,
"tcp",
"Kafka SASL/SCRAM Public enabled broker (MSK specific)"
],
"kafka-broker-sasl-scram-tcp": [
9096,
9096,
"tcp",
"Kafka SASL/SCRAM enabled broker (MSK specific)"
],
"kafka-broker-tcp": [
9092,
9092,
"tcp",
"Kafka PLAINTEXT enable broker 0.8.2+"
],
"kafka-broker-tls-public-tcp": [
9194,
9194,
"tcp",
"Kafka TLS Public enabled broker 0.8.2+ (MSK specific)"
],
"kafka-broker-tls-tcp": [
9094,
9094,
"tcp",
"Kafka TLS enabled broker 0.8.2+"
],
"kafka-jmx-exporter-tcp": [
11001,
11001,
"tcp",
"Kafka JMX Exporter"
],
"kafka-node-exporter-tcp": [
11002,
11002,
"tcp",
"Kafka Node Exporter"
],
"kibana-tcp": [
5601,
5601,
"tcp",
"Kibana Web Interface"
],
"kubernetes-api-tcp": [
6443,
6443,
"tcp",
"Kubernetes API Server"
],
"ldap-tcp": [
389,
389,
"tcp",
"LDAP"
],
"ldaps-tcp": [
636,
636,
"tcp",
"LDAPS"
],
"logstash-tcp": [
5044,
5044,
"tcp",
"Logstash"
],
"loki-grafana": [
3100,
3100,
"tcp",
"Grafana Loki endpoint"
],
"loki-grafana-grpc": [
9095,
9095,
"tcp",
"Grafana Loki GRPC"
],
"memcached-tcp": [
11211,
11211,
"tcp",
"Memcached"
],
"minio-tcp": [
9000,
9000,
"tcp",
"MinIO"
],
"mongodb-27017-tcp": [
27017,
27017,
"tcp",
"MongoDB"
],
"mongodb-27018-tcp": [
27018,
27018,
"tcp",
"MongoDB shard"
],
"mongodb-27019-tcp": [
27019,
27019,
"tcp",
"MongoDB config server"
],
"mssql-analytics-tcp": [
2383,
2383,
"tcp",
"MSSQL Analytics"
],
"mssql-broker-tcp": [
4022,
4022,
"tcp",
"MSSQL Broker"
],
"mssql-tcp": [
1433,
1433,
"tcp",
"MSSQL Server"
],
"mssql-udp": [
1434,
1434,
"udp",
"MSSQL Browser"
],
"mysql-tcp": [
3306,
3306,
"tcp",
"MySQL/Aurora"
],
"nfs-tcp": [
2049,
2049,
"tcp",
"NFS/EFS"
],
"nomad-http-tcp": [
4646,
4646,
"tcp",
"Nomad HTTP"
],
"nomad-rpc-tcp": [
4647,
4647,
"tcp",
"Nomad RPC"
],
"nomad-serf-tcp": [
4648,
4648,
"tcp",
"Serf"
],
"nomad-serf-udp": [
4648,
4648,
"udp",
"Serf"
],
"ntp-udp": [
123,
123,
"udp",
"NTP"
],
"octopus-tentacle-tcp": [
10933,
10933,
"tcp",
"Octopus Tentacle"
],
"openvpn-https-tcp": [
443,
443,
"tcp",
"OpenVPN"
],
"openvpn-tcp": [
943,
943,
"tcp",
"OpenVPN"
],
"openvpn-udp": [
1194,
1194,
"udp",
"OpenVPN"
],
"oracle-db-tcp": [
1521,
1521,
"tcp",
"Oracle"
],
"postgresql-tcp": [
5432,
5432,
"tcp",
"PostgreSQL"
],
"prometheus-http-tcp": [
9090,
9090,
"tcp",
"Prometheus"
],
"prometheus-node-exporter-http-tcp": [
9100,
9100,
"tcp",
"Prometheus Node Exporter"
],
"prometheus-pushgateway-http-tcp": [
9091,
9091,
"tcp",
"Prometheus Pushgateway"
],
"promtail-http": [
9080,
9080,
"tcp",
"Promtail endpoint"
],
"puppet-tcp": [
8140,
8140,
"tcp",
"Puppet"
],
"puppetdb-tcp": [
8081,
8081,
"tcp",
"PuppetDB"
],
"rabbitmq-15672-tcp": [
15672,
15672,
"tcp",
"RabbitMQ"
],
"rabbitmq-25672-tcp": [
25672,
25672,
"tcp",
"RabbitMQ"
],
"rabbitmq-4369-tcp": [
4369,
4369,
"tcp",
"RabbitMQ epmd"
],
"rabbitmq-5671-tcp": [
5671,
5671,
"tcp",
"RabbitMQ"
],
"rabbitmq-5672-tcp": [
5672,
5672,
"tcp",
"RabbitMQ"
],
"rdp-tcp": [
3389,
3389,
"tcp",
"Remote Desktop"
],
"rdp-udp": [
3389,
3389,
"udp",
"Remote Desktop"
],
"redis-tcp": [
6379,
6379,
"tcp",
"Redis"
],
"redshift-tcp": [
5439,
5439,
"tcp",
"Redshift"
],
"saltstack-tcp": [
4505,
4506,
"tcp",
"SaltStack"
],
"smtp-submission-2587-tcp": [
2587,
2587,
"tcp",
"SMTP Submission"
],
"smtp-submission-587-tcp": [
587,
587,
"tcp",
"SMTP Submission"
],
"smtp-tcp": [
25,
25,
"tcp",
"SMTP"
],
"smtps-2456-tcp": [
2465,
2465,
"tcp",
"SMTPS"
],
"smtps-465-tcp": [
465,
465,
"tcp",
"SMTPS"
],
"solr-tcp": [
8983,
8987,
"tcp",
"Solr"
],
"splunk-hec-tcp": [
8088,
8088,
"tcp",
"Splunk HEC"
],
"splunk-indexer-tcp": [
9997,
9997,
"tcp",
"Splunk indexer"
],
"splunk-splunkd-tcp": [
8089,
8089,
"tcp",
"Splunkd"
],
"splunk-web-tcp": [
8000,
8000,
"tcp",
"Splunk Web"
],
"squid-proxy-tcp": [
3128,
3128,
"tcp",
"Squid default proxy"
],
"ssh-tcp": [
22,
22,
"tcp",
"SSH"
],
"storm-nimbus-tcp": [
6627,
6627,
"tcp",
"Nimbus"
],
"storm-supervisor-tcp": [
6700,
6703,
"tcp",
"Supervisor"
],
"storm-ui-tcp": [
8080,
8080,
"tcp",
"Storm UI"
],
"vault-tcp": [
8200,
8200,
"tcp",
"Vault"
],
"wazuh-dashboard": [
443,
443,
"tcp",
"Wazuh web user interface"
],
"wazuh-indexer-restful-api": [
9200,
9200,
"tcp",
"Wazuh indexer RESTful API"
],
"wazuh-server-agent-cluster-daemon": [
1516,
1516,
"tcp",
"Wazuh cluster daemon"
],
"wazuh-server-agent-connection-tcp": [
1514,
1514,
"tcp",
"Agent connection service(TCP)"
],
"wazuh-server-agent-connection-udp": [
1514,
1514,
"udp",
"Agent connection service(UDP)"
],
"wazuh-server-agent-enrollment": [
1515,
1515,
"tcp",
"Agent enrollment service"
],
"wazuh-server-restful-api": [
55000,
55000,
"tcp",
"Wazuh server RESTful API"
],
"wazuh-server-syslog-collector-tcp": [
514,
514,
"tcp",
"Wazuh Syslog collector(TCP)"
],
"wazuh-server-syslog-collector-udp": [
514,
514,
"udp",
"Wazuh Syslog collector(UDP)"
],
"web-jmx-tcp": [
1099,
1099,
"tcp",
"JMX"
],
"winrm-http-tcp": [
5985,
5985,
"tcp",
"WinRM HTTP"
],
"winrm-https-tcp": [
5986,
5986,
"tcp",
"WinRM HTTPS"
],
"zabbix-agent": [
10050,
10050,
"tcp",
"Zabbix Agent"
],
"zabbix-proxy": [
10051,
10051,
"tcp",
"Zabbix Proxy"
],
"zabbix-server": [
10051,
10051,
"tcp",
"Zabbix Server"
],
"zipkin-admin-query-tcp": [
9901,
9901,
"tcp",
"Zipkin Admin port query"
],
"zipkin-admin-tcp": [
9990,
9990,
"tcp",
"Zipkin Admin port collector"
],
"zipkin-admin-web-tcp": [
9991,
9991,
"tcp",
"Zipkin Admin port web"
],
"zipkin-query-tcp": [
9411,
9411,
"tcp",
"Zipkin query port"
],
"zipkin-web-tcp": [
8080,
8080,
"tcp",
"Zipkin web port"
],
"zookeeper-2181-tcp": [
2181,
2181,
"tcp",
"Zookeeper"
],
"zookeeper-2182-tls-tcp": [
2182,
2182,
"tcp",
"Zookeeper TLS (MSK specific)"
],
"zookeeper-2888-tcp": [
2888,
2888,
"tcp",
"Zookeeper"
],
"zookeeper-3888-tcp": [
3888,
3888,
"tcp",
"Zookeeper"
],
"zookeeper-jmx-tcp": [
7199,
7199,
"tcp",
"JMX"
]
}
| no | | [security\_group\_id](#input\_security\_group\_id) | ID of existing security group whose rules we will manage | `string` | `null` | no | | [tags](#input\_tags) | A mapping of tags to assign to security group | `map(string)` | `{}` | no | | [use\_name\_prefix](#input\_use\_name\_prefix) | Whether to use name\_prefix or fixed name. Should be true to able to update security group name after initial creation | `bool` | `true` | no | @@ -274,7 +274,7 @@ No modules. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + ## Authors diff --git a/examples/complete/README.md b/examples/complete/README.md index 44a2e89..2ca9c0a 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -67,4 +67,4 @@ No inputs. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/examples/computed/README.md b/examples/computed/README.md index 6ef2158..d73af4f 100644 --- a/examples/computed/README.md +++ b/examples/computed/README.md @@ -14,7 +14,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -56,4 +56,4 @@ No inputs. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/examples/disabled/README.md b/examples/disabled/README.md index 7dc6bcf..8a13e02 100644 --- a/examples/disabled/README.md +++ b/examples/disabled/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -54,4 +54,4 @@ No inputs. |------|-------------| | [security\_group\_arn](#output\_security\_group\_arn) | The ARN of the security group | | [security\_group\_id](#output\_security\_group\_id) | The ID of the security group | - + diff --git a/examples/dynamic/README.md b/examples/dynamic/README.md index ef36748..1c34c9f 100644 --- a/examples/dynamic/README.md +++ b/examples/dynamic/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -57,4 +57,4 @@ No inputs. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/examples/http/README.md b/examples/http/README.md index 54281f3..d97582b 100644 --- a/examples/http/README.md +++ b/examples/http/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -63,4 +63,4 @@ No inputs. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/examples/rules-only/README.md b/examples/rules-only/README.md index 44e57d1..553bde8 100644 --- a/examples/rules-only/README.md +++ b/examples/rules-only/README.md @@ -16,7 +16,7 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. - + ## Requirements | Name | Version | @@ -58,4 +58,4 @@ No inputs. | [service\_one\_security\_group\_id](#output\_service\_one\_security\_group\_id) | The ID of the security group for service one | | [service\_tow\_security\_group\_arn](#output\_service\_tow\_security\_group\_arn) | The ARN of the security group for service two | | [service\_two\_security\_group\_id](#output\_service\_two\_security\_group\_id) | The ID of the security group for service two | - + diff --git a/modules/activemq/README.md b/modules/activemq/README.md index f82c302..5ae6291 100644 --- a/modules/activemq/README.md +++ b/modules/activemq/README.md @@ -13,7 +13,7 @@ module "activemq_security_group" { All automatic values **activemq module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/activemq/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"activemq-5671-tcp",
"activemq-8883-tcp",
"activemq-61614-tcp",
"activemq-61617-tcp",
"activemq-61619-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"activemq-5671-tcp",
"activemq-8883-tcp",
"activemq-61614-tcp",
"activemq-61617-tcp",
"activemq-61619-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/alertmanager/README.md b/modules/alertmanager/README.md index 4a37c34..a7b021c 100644 --- a/modules/alertmanager/README.md +++ b/modules/alertmanager/README.md @@ -13,7 +13,7 @@ module "alertmanager_security_group" { All automatic values **alertmanager module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/alertmanager/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"alertmanager-9093-tcp",
"alertmanager-9094-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"alertmanager-9093-tcp",
"alertmanager-9094-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/carbon-relay-ng/README.md b/modules/carbon-relay-ng/README.md index 6e6fb9f..5b88860 100644 --- a/modules/carbon-relay-ng/README.md +++ b/modules/carbon-relay-ng/README.md @@ -13,7 +13,7 @@ module "carbon_relay-ng_security_group" { All automatic values **carbon-relay-ng module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/carbon-relay-ng/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"carbon-line-in-tcp",
"carbon-line-in-udp",
"carbon-pickle-tcp",
"carbon-pickle-udp",
"carbon-gui-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"carbon-line-in-tcp",
"carbon-line-in-udp",
"carbon-pickle-tcp",
"carbon-pickle-udp",
"carbon-gui-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/cassandra/README.md b/modules/cassandra/README.md index dfdd4a0..d894e55 100644 --- a/modules/cassandra/README.md +++ b/modules/cassandra/README.md @@ -13,7 +13,7 @@ module "cassandra_security_group" { All automatic values **cassandra module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/cassandra/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"cassandra-clients-tcp",
"cassandra-thrift-clients-tcp",
"cassandra-jmx-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"cassandra-clients-tcp",
"cassandra-thrift-clients-tcp",
"cassandra-jmx-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/consul/README.md b/modules/consul/README.md index 1368f76..3b17ce0 100644 --- a/modules/consul/README.md +++ b/modules/consul/README.md @@ -13,7 +13,7 @@ module "consul_security_group" { All automatic values **consul module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/consul/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"consul-tcp",
"consul-grpc-tcp",
"consul-grpc-tcp-tls",
"consul-webui-http-tcp",
"consul-webui-https-tcp",
"consul-dns-tcp",
"consul-dns-udp",
"consul-serf-lan-tcp",
"consul-serf-lan-udp",
"consul-serf-wan-tcp",
"consul-serf-wan-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"consul-tcp",
"consul-grpc-tcp",
"consul-grpc-tcp-tls",
"consul-webui-http-tcp",
"consul-webui-https-tcp",
"consul-dns-tcp",
"consul-dns-udp",
"consul-serf-lan-tcp",
"consul-serf-lan-udp",
"consul-serf-wan-tcp",
"consul-serf-wan-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/dax-cluster/README.md b/modules/dax-cluster/README.md index 6ead1ce..874ec1a 100644 --- a/modules/dax-cluster/README.md +++ b/modules/dax-cluster/README.md @@ -13,7 +13,7 @@ module "dax_cluster_security_group" { All automatic values **dax-cluster module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/dax-cluster/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"dax-cluster-unencrypted-tcp",
"dax-cluster-encrypted-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"dax-cluster-unencrypted-tcp",
"dax-cluster-encrypted-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/docker-swarm/README.md b/modules/docker-swarm/README.md index 9a68ac7..799cd2b 100644 --- a/modules/docker-swarm/README.md +++ b/modules/docker-swarm/README.md @@ -13,7 +13,7 @@ module "docker_swarm_security_group" { All automatic values **docker-swarm module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/docker-swarm/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"docker-swarm-mngmt-tcp",
"docker-swarm-node-tcp",
"docker-swarm-node-udp",
"docker-swarm-overlay-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"docker-swarm-mngmt-tcp",
"docker-swarm-node-tcp",
"docker-swarm-node-udp",
"docker-swarm-overlay-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/elasticsearch/README.md b/modules/elasticsearch/README.md index 4a40cd6..6b7f43d 100644 --- a/modules/elasticsearch/README.md +++ b/modules/elasticsearch/README.md @@ -13,7 +13,7 @@ module "elasticsearch_security_group" { All automatic values **elasticsearch module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/elasticsearch/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"elasticsearch-rest-tcp",
"elasticsearch-java-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"elasticsearch-rest-tcp",
"elasticsearch-java-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/etcd/README.md b/modules/etcd/README.md index 6a3195a..38c7e06 100644 --- a/modules/etcd/README.md +++ b/modules/etcd/README.md @@ -13,7 +13,7 @@ module "etcd_security_group" { All automatic values **etcd module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/etcd/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"etcd-client-tcp",
"etcd-peer-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"etcd-client-tcp",
"etcd-peer-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/grafana/README.md b/modules/grafana/README.md index 80bbb70..678acb4 100644 --- a/modules/grafana/README.md +++ b/modules/grafana/README.md @@ -13,7 +13,7 @@ module "grafana_security_group" { All automatic values **grafana module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/grafana/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"grafana-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"grafana-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/graphite-statsd/README.md b/modules/graphite-statsd/README.md index 938693e..7e5624c 100644 --- a/modules/graphite-statsd/README.md +++ b/modules/graphite-statsd/README.md @@ -13,7 +13,7 @@ module "graphite_statsd_security_group" { All automatic values **graphite-statsd module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/graphite-statsd/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"graphite-webui",
"graphite-2003-tcp",
"graphite-2004-tcp",
"graphite-2023-tcp",
"graphite-2024-tcp",
"graphite-8080-tcp",
"graphite-8125-tcp",
"graphite-8125-udp",
"graphite-8126-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"graphite-webui",
"graphite-2003-tcp",
"graphite-2004-tcp",
"graphite-2023-tcp",
"graphite-2024-tcp",
"graphite-8080-tcp",
"graphite-8125-tcp",
"graphite-8125-udp",
"graphite-8126-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/http-80/README.md b/modules/http-80/README.md index 5102ff9..85a896f 100644 --- a/modules/http-80/README.md +++ b/modules/http-80/README.md @@ -13,7 +13,7 @@ module "http_80_security_group" { All automatic values **http-80 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/http-80/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-80-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-80-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/http-8080/README.md b/modules/http-8080/README.md index 4f8fbb7..6c35030 100644 --- a/modules/http-8080/README.md +++ b/modules/http-8080/README.md @@ -13,7 +13,7 @@ module "http_8080_security_group" { All automatic values **http-8080 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/http-8080/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-8080-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-8080-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/https-443/README.md b/modules/https-443/README.md index a120017..4abeb1c 100644 --- a/modules/https-443/README.md +++ b/modules/https-443/README.md @@ -13,7 +13,7 @@ module "https_443_security_group" { All automatic values **https-443 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/https-443/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"https-443-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"https-443-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/https-8443/README.md b/modules/https-8443/README.md index cd5cfb8..fcb8c4b 100644 --- a/modules/https-8443/README.md +++ b/modules/https-8443/README.md @@ -13,7 +13,7 @@ module "https_8443_security_group" { All automatic values **https-8443 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/https-8443/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"https-8443-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"https-8443-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ipsec-4500/README.md b/modules/ipsec-4500/README.md index 4d5c761..e938f72 100644 --- a/modules/ipsec-4500/README.md +++ b/modules/ipsec-4500/README.md @@ -13,7 +13,7 @@ module "ipsec_4500_security_group" { All automatic values **ipsec-4500 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ipsec-4500/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ipsec-4500-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ipsec-4500-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ipsec-500/README.md b/modules/ipsec-500/README.md index 4552fd5..37a50e0 100644 --- a/modules/ipsec-500/README.md +++ b/modules/ipsec-500/README.md @@ -13,7 +13,7 @@ module "ipsec_500_security_group" { All automatic values **ipsec-500 module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ipsec-500/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ipsec-500-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ipsec-500-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/kafka/README.md b/modules/kafka/README.md index ce9ccb2..c0ba802 100644 --- a/modules/kafka/README.md +++ b/modules/kafka/README.md @@ -13,7 +13,7 @@ module "kafka_security_group" { All automatic values **kafka module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/kafka/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kafka-broker-tcp",
"kafka-broker-tls-tcp",
"kafka-broker-tls-public-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-iam-tcp",
"kafka-broker-sasl-iam-public-tcp",
"kafka-jmx-exporter-tcp",
"kafka-node-exporter-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kafka-broker-tcp",
"kafka-broker-tls-tcp",
"kafka-broker-tls-public-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-scram-tcp",
"kafka-broker-sasl-iam-tcp",
"kafka-broker-sasl-iam-public-tcp",
"kafka-jmx-exporter-tcp",
"kafka-node-exporter-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/kibana/README.md b/modules/kibana/README.md index 79c0278..6a2b68d 100644 --- a/modules/kibana/README.md +++ b/modules/kibana/README.md @@ -13,7 +13,7 @@ module "kibana_security_group" { All automatic values **kibana module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/kibana/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kibana-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kibana-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/kubernetes-api/README.md b/modules/kubernetes-api/README.md index b534dc0..25f9d93 100644 --- a/modules/kubernetes-api/README.md +++ b/modules/kubernetes-api/README.md @@ -13,7 +13,7 @@ module "kubernetes_api_security_group" { All automatic values **kubernetes-api module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/kubernetes-api/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kubernetes-api-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"kubernetes-api-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ldap/README.md b/modules/ldap/README.md index 4db9c17..362a30b 100644 --- a/modules/ldap/README.md +++ b/modules/ldap/README.md @@ -13,7 +13,7 @@ module "ldap_security_group" { All automatic values **ldap module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ldap/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ldap-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ldap-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ldaps/README.md b/modules/ldaps/README.md index eb1e44f..0655ad0 100644 --- a/modules/ldaps/README.md +++ b/modules/ldaps/README.md @@ -13,7 +13,7 @@ module "ldaps_security_group" { All automatic values **ldaps module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ldaps/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ldaps-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ldaps-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/logstash/README.md b/modules/logstash/README.md index 3f8d9de..c9f3d2b 100644 --- a/modules/logstash/README.md +++ b/modules/logstash/README.md @@ -13,7 +13,7 @@ module "logstash_security_group" { All automatic values **logstash module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/logstash/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"logstash-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"logstash-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/loki/README.md b/modules/loki/README.md index 6bc6e3b..3583b96 100644 --- a/modules/loki/README.md +++ b/modules/loki/README.md @@ -13,7 +13,7 @@ module "loki_security_group" { All automatic values **loki module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/loki/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"loki-grafana",
"loki-grafana-grpc"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"loki-grafana",
"loki-grafana-grpc"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/memcached/README.md b/modules/memcached/README.md index 4d8b2de..fc39b00 100644 --- a/modules/memcached/README.md +++ b/modules/memcached/README.md @@ -13,7 +13,7 @@ module "memcached_security_group" { All automatic values **memcached module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/memcached/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"memcached-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"memcached-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/minio/README.md b/modules/minio/README.md index a96dde1..2c54295 100644 --- a/modules/minio/README.md +++ b/modules/minio/README.md @@ -13,7 +13,7 @@ module "minio_security_group" { All automatic values **minio module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/minio/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"minio-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"minio-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/mongodb/README.md b/modules/mongodb/README.md index 6f96cf2..40decfa 100644 --- a/modules/mongodb/README.md +++ b/modules/mongodb/README.md @@ -13,7 +13,7 @@ module "mongodb_security_group" { All automatic values **mongodb module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/mongodb/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mongodb-27017-tcp",
"mongodb-27018-tcp",
"mongodb-27019-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mongodb-27017-tcp",
"mongodb-27018-tcp",
"mongodb-27019-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/mssql/README.md b/modules/mssql/README.md index a15ee16..cce23f1 100644 --- a/modules/mssql/README.md +++ b/modules/mssql/README.md @@ -13,7 +13,7 @@ module "mssql_security_group" { All automatic values **mssql module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/mssql/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mssql-tcp",
"mssql-udp",
"mssql-analytics-tcp",
"mssql-broker-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mssql-tcp",
"mssql-udp",
"mssql-analytics-tcp",
"mssql-broker-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/mysql/README.md b/modules/mysql/README.md index 6b2a1e0..7d7b158 100644 --- a/modules/mysql/README.md +++ b/modules/mysql/README.md @@ -13,7 +13,7 @@ module "mysql_security_group" { All automatic values **mysql module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/mysql/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mysql-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"mysql-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/nfs/README.md b/modules/nfs/README.md index eba6272..94f7489 100644 --- a/modules/nfs/README.md +++ b/modules/nfs/README.md @@ -13,7 +13,7 @@ module "nfs_security_group" { All automatic values **nfs module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/nfs/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"nfs-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"nfs-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/nomad/README.md b/modules/nomad/README.md index a7a2216..89b5963 100644 --- a/modules/nomad/README.md +++ b/modules/nomad/README.md @@ -13,7 +13,7 @@ module "nomad_security_group" { All automatic values **nomad module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/nomad/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"nomad-http-tcp",
"nomad-rpc-tcp",
"nomad-serf-tcp",
"nomad-serf-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"nomad-http-tcp",
"nomad-rpc-tcp",
"nomad-serf-tcp",
"nomad-serf-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ntp/README.md b/modules/ntp/README.md index 9eca552..89b15ff 100644 --- a/modules/ntp/README.md +++ b/modules/ntp/README.md @@ -13,7 +13,7 @@ module "ntp_security_group" { All automatic values **ntp module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ntp/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ntp-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ntp-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/openvpn/README.md b/modules/openvpn/README.md index 51d7a58..ee2b41d 100644 --- a/modules/openvpn/README.md +++ b/modules/openvpn/README.md @@ -13,7 +13,7 @@ module "openvpn_security_group" { All automatic values **openvpn module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/openvpn/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"openvpn-udp",
"openvpn-tcp",
"openvpn-https-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"openvpn-udp",
"openvpn-tcp",
"openvpn-https-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/oracle-db/README.md b/modules/oracle-db/README.md index ea463e0..97be5ac 100644 --- a/modules/oracle-db/README.md +++ b/modules/oracle-db/README.md @@ -13,7 +13,7 @@ module "oracle_db_security_group" { All automatic values **oracle-db module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/oracle-db/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"oracle-db-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"oracle-db-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/postgresql/README.md b/modules/postgresql/README.md index e7410e9..cdba2df 100644 --- a/modules/postgresql/README.md +++ b/modules/postgresql/README.md @@ -13,7 +13,7 @@ module "postgresql_security_group" { All automatic values **postgresql module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/postgresql/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"postgresql-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"postgresql-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/prometheus/README.md b/modules/prometheus/README.md index 3eea787..d967c99 100644 --- a/modules/prometheus/README.md +++ b/modules/prometheus/README.md @@ -13,7 +13,7 @@ module "prometheus_security_group" { All automatic values **prometheus module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/prometheus/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"prometheus-http-tcp",
"prometheus-pushgateway-http-tcp",
"prometheus-node-exporter-http-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"prometheus-http-tcp",
"prometheus-pushgateway-http-tcp",
"prometheus-node-exporter-http-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/promtail/README.md b/modules/promtail/README.md index d88f461..68f93e3 100644 --- a/modules/promtail/README.md +++ b/modules/promtail/README.md @@ -13,7 +13,7 @@ module "promtail_security_group" { All automatic values **promtail module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/promtail/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"promtail-http"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"promtail-http"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/puppet/README.md b/modules/puppet/README.md index 2f9b8f8..9c5c9a2 100644 --- a/modules/puppet/README.md +++ b/modules/puppet/README.md @@ -13,7 +13,7 @@ module "puppet_security_group" { All automatic values **puppet module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/puppet/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"puppet-tcp",
"puppetdb-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"puppet-tcp",
"puppetdb-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/rabbitmq/README.md b/modules/rabbitmq/README.md index 81db819..57ff249 100644 --- a/modules/rabbitmq/README.md +++ b/modules/rabbitmq/README.md @@ -13,7 +13,7 @@ module "rabbitmq_security_group" { All automatic values **rabbitmq module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/rabbitmq/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"rabbitmq-4369-tcp",
"rabbitmq-5671-tcp",
"rabbitmq-5672-tcp",
"rabbitmq-15672-tcp",
"rabbitmq-25672-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"rabbitmq-4369-tcp",
"rabbitmq-5671-tcp",
"rabbitmq-5672-tcp",
"rabbitmq-15672-tcp",
"rabbitmq-25672-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/rdp/README.md b/modules/rdp/README.md index 38a842c..f8aea9a 100644 --- a/modules/rdp/README.md +++ b/modules/rdp/README.md @@ -13,7 +13,7 @@ module "rdp_security_group" { All automatic values **rdp module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/rdp/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"rdp-tcp",
"rdp-udp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"rdp-tcp",
"rdp-udp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/redis/README.md b/modules/redis/README.md index 5a9d74a..9bf1293 100644 --- a/modules/redis/README.md +++ b/modules/redis/README.md @@ -13,7 +13,7 @@ module "redis_security_group" { All automatic values **redis module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/redis/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"redis-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"redis-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/redshift/README.md b/modules/redshift/README.md index d2f97c9..1f6cdd7 100644 --- a/modules/redshift/README.md +++ b/modules/redshift/README.md @@ -13,7 +13,7 @@ module "redshift_security_group" { All automatic values **redshift module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/redshift/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"redshift-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"redshift-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/smtp-submission/README.md b/modules/smtp-submission/README.md index ea9059a..477fbf5 100644 --- a/modules/smtp-submission/README.md +++ b/modules/smtp-submission/README.md @@ -13,7 +13,7 @@ module "smtp_submission_security_group" { All automatic values **smtp-submission module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/smtp-submission/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtp-submission-587-tcp",
"smtp-submission-2587-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtp-submission-587-tcp",
"smtp-submission-2587-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/smtp/README.md b/modules/smtp/README.md index 9aaf9c7..7afa632 100644 --- a/modules/smtp/README.md +++ b/modules/smtp/README.md @@ -13,7 +13,7 @@ module "smtp_security_group" { All automatic values **smtp module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/smtp/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtp-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtp-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/smtps/README.md b/modules/smtps/README.md index 899da7c..316e3b9 100644 --- a/modules/smtps/README.md +++ b/modules/smtps/README.md @@ -13,7 +13,7 @@ module "smtps_security_group" { All automatic values **smtps module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/smtps/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtps-465-tcp",
"smtps-2465-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"smtps-465-tcp",
"smtps-2465-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/solr/README.md b/modules/solr/README.md index 5c4a5b3..6365ef8 100644 --- a/modules/solr/README.md +++ b/modules/solr/README.md @@ -13,7 +13,7 @@ module "solr_security_group" { All automatic values **solr module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/solr/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"solr-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"solr-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/splunk/README.md b/modules/splunk/README.md index e1c2afe..8747922 100644 --- a/modules/splunk/README.md +++ b/modules/splunk/README.md @@ -13,7 +13,7 @@ module "splunk_security_group" { All automatic values **splunk module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/splunk/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"splunk-indexer-tcp",
"splunk-web-tcp",
"splunk-splunkd-tcp",
"splunk-hec-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"splunk-indexer-tcp",
"splunk-web-tcp",
"splunk-splunkd-tcp",
"splunk-hec-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/squid/README.md b/modules/squid/README.md index 14f32d6..fe6d7f1 100644 --- a/modules/squid/README.md +++ b/modules/squid/README.md @@ -13,7 +13,7 @@ module "squid_security_group" { All automatic values **squid module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/squid/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"squid-proxy-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"squid-proxy-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/ssh/README.md b/modules/ssh/README.md index 6a365b2..2703130 100644 --- a/modules/ssh/README.md +++ b/modules/ssh/README.md @@ -13,7 +13,7 @@ module "ssh_security_group" { All automatic values **ssh module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/ssh/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ssh-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"ssh-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/storm/README.md b/modules/storm/README.md index 8b41478..0baae3b 100644 --- a/modules/storm/README.md +++ b/modules/storm/README.md @@ -13,7 +13,7 @@ module "storm_security_group" { All automatic values **storm module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/storm/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"storm-nimbus-tcp",
"storm-ui-tcp",
"storm-supervisor-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"storm-nimbus-tcp",
"storm-ui-tcp",
"storm-supervisor-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/vault/README.md b/modules/vault/README.md index 4982bb9..02eb8bc 100644 --- a/modules/vault/README.md +++ b/modules/vault/README.md @@ -13,7 +13,7 @@ module "vault_security_group" { All automatic values **vault module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/vault/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"vault-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"vault-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/wazuh/README.md b/modules/wazuh/README.md index 8c7f016..26ce4bb 100644 --- a/modules/wazuh/README.md +++ b/modules/wazuh/README.md @@ -13,7 +13,7 @@ module "wazuh_security_group" { All automatic values **wazuh module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/wazuh/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"wazuh-server-agent-connection-tcp",
"wazuh-server-agent-connection-udp",
"wazuh-server-agent-enrollment",
"wazuh-server-agent-cluster-daemon",
"wazuh-server-syslog-collector-tcp",
"wazuh-server-syslog-collector-udp",
"wazuh-server-restful-api",
"wazuh-indexer-restful-api",
"wazuh-dashboard"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"wazuh-server-agent-connection-tcp",
"wazuh-server-agent-connection-udp",
"wazuh-server-agent-enrollment",
"wazuh-server-agent-cluster-daemon",
"wazuh-server-syslog-collector-tcp",
"wazuh-server-syslog-collector-udp",
"wazuh-server-restful-api",
"wazuh-indexer-restful-api",
"wazuh-dashboard"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/web/README.md b/modules/web/README.md index 9256168..82cdaf0 100644 --- a/modules/web/README.md +++ b/modules/web/README.md @@ -13,7 +13,7 @@ module "web_security_group" { All automatic values **web module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/web/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-80-tcp",
"http-8080-tcp",
"https-443-tcp",
"web-jmx-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"http-80-tcp",
"http-8080-tcp",
"https-443-tcp",
"web-jmx-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/winrm/README.md b/modules/winrm/README.md index abd62a3..05e8a5a 100644 --- a/modules/winrm/README.md +++ b/modules/winrm/README.md @@ -13,7 +13,7 @@ module "winrm_security_group" { All automatic values **winrm module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/winrm/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"winrm-http-tcp",
"winrm-https-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"winrm-http-tcp",
"winrm-https-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/zabbix/README.md b/modules/zabbix/README.md index 8901a60..305f531 100644 --- a/modules/zabbix/README.md +++ b/modules/zabbix/README.md @@ -13,7 +13,7 @@ module "zabbix_security_group" { All automatic values **zabbix module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/zabbix/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zabbix-server",
"zabbix-proxy",
"zabbix-agent"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zabbix-server",
"zabbix-proxy",
"zabbix-agent"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/zipkin/README.md b/modules/zipkin/README.md index b87222c..1d9dc48 100644 --- a/modules/zipkin/README.md +++ b/modules/zipkin/README.md @@ -13,7 +13,7 @@ module "zipkin_security_group" { All automatic values **zipkin module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/zipkin/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zipkin-admin-tcp",
"zipkin-admin-query-tcp",
"zipkin-admin-web-tcp",
"zipkin-query-tcp",
"zipkin-web-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zipkin-admin-tcp",
"zipkin-admin-query-tcp",
"zipkin-admin-web-tcp",
"zipkin-query-tcp",
"zipkin-web-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/modules/zookeeper/README.md b/modules/zookeeper/README.md index ea290b4..b45e67c 100644 --- a/modules/zookeeper/README.md +++ b/modules/zookeeper/README.md @@ -13,7 +13,7 @@ module "zookeeper_security_group" { All automatic values **zookeeper module** is using are available [here](https://github.com/terraform-aws-modules/terraform-aws-security-group/blob/master/modules/zookeeper/auto_values.tf). - + ## Requirements | Name | Version | @@ -43,16 +43,16 @@ No resources. | [auto\_computed\_egress\_with\_self](#input\_auto\_computed\_egress\_with\_self) | List of maps defining computed egress rules with self to add automatically | `list(map(string))` | `[]` | no | | [auto\_computed\_ingress\_rules](#input\_auto\_computed\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` | `[]` | no | | [auto\_computed\_ingress\_with\_self](#input\_auto\_computed\_ingress\_with\_self) | List of maps defining computed ingress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | +| [auto\_egress\_rules](#input\_auto\_egress\_rules) | List of egress rules to add automatically | `list(string)` |
[
"all-all"
]
| no | | [auto\_egress\_with\_self](#input\_auto\_egress\_with\_self) | List of maps defining egress rules with self to add automatically | `list(map(string))` | `[]` | no | -| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zookeeper-2181-tcp",
"zookeeper-2182-tls-tcp",
"zookeeper-2888-tcp",
"zookeeper-3888-tcp",
"zookeeper-jmx-tcp"
]
| no | -| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | +| [auto\_ingress\_rules](#input\_auto\_ingress\_rules) | List of ingress rules to add automatically | `list(string)` |
[
"zookeeper-2181-tcp",
"zookeeper-2182-tls-tcp",
"zookeeper-2888-tcp",
"zookeeper-3888-tcp",
"zookeeper-jmx-tcp"
]
| no | +| [auto\_ingress\_with\_self](#input\_auto\_ingress\_with\_self) | List of maps defining ingress rules with self to add automatically | `list(map(string))` |
[
{
"rule": "all-all"
}
]
| no | | [auto\_number\_of\_computed\_egress\_rules](#input\_auto\_number\_of\_computed\_egress\_rules) | Number of computed egress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_egress\_with\_self](#input\_auto\_number\_of\_computed\_egress\_with\_self) | Number of computed egress rules to create where 'self' is defined | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_rules](#input\_auto\_number\_of\_computed\_ingress\_rules) | Number of computed ingress rules to create by name | `number` | `0` | no | | [auto\_number\_of\_computed\_ingress\_with\_self](#input\_auto\_number\_of\_computed\_ingress\_with\_self) | Number of computed ingress rules to create where 'self' is defined | `number` | `0` | no | -| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | +| [computed\_egress\_cidr\_blocks](#input\_computed\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [computed\_egress\_ipv6\_cidr\_blocks](#input\_computed\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all computed egress rules | `list(string)` |
[
"::/0"
]
| no | | [computed\_egress\_prefix\_list\_ids](#input\_computed\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all computed egress rules | `list(string)` | `[]` | no | | [computed\_egress\_rules](#input\_computed\_egress\_rules) | List of computed egress rules to create by name | `list(string)` | `[]` | no | | [computed\_egress\_with\_cidr\_blocks](#input\_computed\_egress\_with\_cidr\_blocks) | List of computed egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -71,8 +71,8 @@ No resources. | [computed\_ingress\_with\_source\_security\_group\_id](#input\_computed\_ingress\_with\_source\_security\_group\_id) | List of computed ingress rules to create where 'source\_security\_group\_id' is used | `list(map(string))` | `[]` | no | | [create](#input\_create) | Whether to create security group and all rules | `bool` | `true` | no | | [description](#input\_description) | Description of security group | `string` | `"Security Group managed by Terraform"` | no | -| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | -| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | +| [egress\_cidr\_blocks](#input\_egress\_cidr\_blocks) | List of IPv4 CIDR ranges to use on all egress rules | `list(string)` |
[
"0.0.0.0/0"
]
| no | +| [egress\_ipv6\_cidr\_blocks](#input\_egress\_ipv6\_cidr\_blocks) | List of IPv6 CIDR ranges to use on all egress rules | `list(string)` |
[
"::/0"
]
| no | | [egress\_prefix\_list\_ids](#input\_egress\_prefix\_list\_ids) | List of prefix list IDs (for allowing access to VPC endpoints) to use on all egress rules | `list(string)` | `[]` | no | | [egress\_rules](#input\_egress\_rules) | List of egress rules to create by name | `list(string)` | `[]` | no | | [egress\_with\_cidr\_blocks](#input\_egress\_with\_cidr\_blocks) | List of egress rules to create where 'cidr\_blocks' is used | `list(map(string))` | `[]` | no | @@ -123,4 +123,4 @@ No resources. | [security\_group\_name](#output\_security\_group\_name) | The name of the security group | | [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID | | [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID | - + diff --git a/wrappers/README.md b/wrappers/README.md new file mode 100644 index 0000000..1fde665 --- /dev/null +++ b/wrappers/README.md @@ -0,0 +1,100 @@ +# Wrapper for the root module + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/_templates/README.md b/wrappers/_templates/README.md new file mode 100644 index 0000000..4880c4d --- /dev/null +++ b/wrappers/_templates/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/_templates` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/_templates" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/_templates?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/_templates" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/_templates/main.tf b/wrappers/_templates/main.tf new file mode 100644 index 0000000..a63ed9f --- /dev/null +++ b/wrappers/_templates/main.tf @@ -0,0 +1,67 @@ +module "wrapper" { + source = "../../modules/_templates" + + for_each = var.items + + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/_templates/outputs.tf b/wrappers/_templates/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/_templates/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/_templates/variables.tf b/wrappers/_templates/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/_templates/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/_templates/versions.tf b/wrappers/_templates/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/_templates/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/activemq/README.md b/wrappers/activemq/README.md new file mode 100644 index 0000000..310b5e9 --- /dev/null +++ b/wrappers/activemq/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/activemq` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/activemq" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/activemq?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/activemq" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/activemq/main.tf b/wrappers/activemq/main.tf new file mode 100644 index 0000000..a8e048b --- /dev/null +++ b/wrappers/activemq/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/activemq" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["activemq-5671-tcp", "activemq-8883-tcp", "activemq-61614-tcp", "activemq-61617-tcp", "activemq-61619-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/activemq/outputs.tf b/wrappers/activemq/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/activemq/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/activemq/variables.tf b/wrappers/activemq/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/activemq/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/activemq/versions.tf b/wrappers/activemq/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/activemq/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/alertmanager/README.md b/wrappers/alertmanager/README.md new file mode 100644 index 0000000..4810b02 --- /dev/null +++ b/wrappers/alertmanager/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/alertmanager` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/alertmanager" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/alertmanager?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/alertmanager" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/alertmanager/main.tf b/wrappers/alertmanager/main.tf new file mode 100644 index 0000000..93e495c --- /dev/null +++ b/wrappers/alertmanager/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/alertmanager" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["alertmanager-9093-tcp", "alertmanager-9094-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/alertmanager/outputs.tf b/wrappers/alertmanager/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/alertmanager/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/alertmanager/variables.tf b/wrappers/alertmanager/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/alertmanager/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/alertmanager/versions.tf b/wrappers/alertmanager/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/alertmanager/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/carbon-relay-ng/README.md b/wrappers/carbon-relay-ng/README.md new file mode 100644 index 0000000..71246ee --- /dev/null +++ b/wrappers/carbon-relay-ng/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/carbon-relay-ng` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/carbon-relay-ng" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/carbon-relay-ng?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/carbon-relay-ng" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/carbon-relay-ng/main.tf b/wrappers/carbon-relay-ng/main.tf new file mode 100644 index 0000000..a54d5b8 --- /dev/null +++ b/wrappers/carbon-relay-ng/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/carbon-relay-ng" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["carbon-line-in-tcp", "carbon-line-in-udp", "carbon-pickle-tcp", "carbon-pickle-udp", "carbon-gui-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/carbon-relay-ng/outputs.tf b/wrappers/carbon-relay-ng/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/carbon-relay-ng/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/carbon-relay-ng/variables.tf b/wrappers/carbon-relay-ng/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/carbon-relay-ng/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/carbon-relay-ng/versions.tf b/wrappers/carbon-relay-ng/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/carbon-relay-ng/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/cassandra/README.md b/wrappers/cassandra/README.md new file mode 100644 index 0000000..8edfb5b --- /dev/null +++ b/wrappers/cassandra/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/cassandra` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/cassandra" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/cassandra?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/cassandra" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/cassandra/main.tf b/wrappers/cassandra/main.tf new file mode 100644 index 0000000..c7c2854 --- /dev/null +++ b/wrappers/cassandra/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/cassandra" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["cassandra-clients-tcp", "cassandra-thrift-clients-tcp", "cassandra-jmx-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/cassandra/outputs.tf b/wrappers/cassandra/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/cassandra/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/cassandra/variables.tf b/wrappers/cassandra/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/cassandra/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/cassandra/versions.tf b/wrappers/cassandra/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/cassandra/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/consul/README.md b/wrappers/consul/README.md new file mode 100644 index 0000000..dd8324f --- /dev/null +++ b/wrappers/consul/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/consul` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/consul" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/consul?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/consul" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/consul/main.tf b/wrappers/consul/main.tf new file mode 100644 index 0000000..f094982 --- /dev/null +++ b/wrappers/consul/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/consul" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["consul-tcp", "consul-grpc-tcp", "consul-grpc-tcp-tls", "consul-webui-http-tcp", "consul-webui-https-tcp", "consul-dns-tcp", "consul-dns-udp", "consul-serf-lan-tcp", "consul-serf-lan-udp", "consul-serf-wan-tcp", "consul-serf-wan-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/consul/outputs.tf b/wrappers/consul/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/consul/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/consul/variables.tf b/wrappers/consul/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/consul/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/consul/versions.tf b/wrappers/consul/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/consul/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/dax-cluster/README.md b/wrappers/dax-cluster/README.md new file mode 100644 index 0000000..a9207bd --- /dev/null +++ b/wrappers/dax-cluster/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/dax-cluster` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/dax-cluster" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/dax-cluster?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/dax-cluster" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/dax-cluster/main.tf b/wrappers/dax-cluster/main.tf new file mode 100644 index 0000000..9bec23c --- /dev/null +++ b/wrappers/dax-cluster/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/dax-cluster" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["dax-cluster-unencrypted-tcp", "dax-cluster-encrypted-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/dax-cluster/outputs.tf b/wrappers/dax-cluster/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/dax-cluster/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/dax-cluster/variables.tf b/wrappers/dax-cluster/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/dax-cluster/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/dax-cluster/versions.tf b/wrappers/dax-cluster/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/dax-cluster/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/docker-swarm/README.md b/wrappers/docker-swarm/README.md new file mode 100644 index 0000000..b4b3a6e --- /dev/null +++ b/wrappers/docker-swarm/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/docker-swarm` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/docker-swarm" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/docker-swarm?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/docker-swarm" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/docker-swarm/main.tf b/wrappers/docker-swarm/main.tf new file mode 100644 index 0000000..0f867d1 --- /dev/null +++ b/wrappers/docker-swarm/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/docker-swarm" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["docker-swarm-mngmt-tcp", "docker-swarm-node-tcp", "docker-swarm-node-udp", "docker-swarm-overlay-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/docker-swarm/outputs.tf b/wrappers/docker-swarm/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/docker-swarm/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/docker-swarm/variables.tf b/wrappers/docker-swarm/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/docker-swarm/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/docker-swarm/versions.tf b/wrappers/docker-swarm/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/docker-swarm/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/elasticsearch/README.md b/wrappers/elasticsearch/README.md new file mode 100644 index 0000000..d1c1dcc --- /dev/null +++ b/wrappers/elasticsearch/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/elasticsearch` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/elasticsearch" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/elasticsearch?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/elasticsearch" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/elasticsearch/main.tf b/wrappers/elasticsearch/main.tf new file mode 100644 index 0000000..324df29 --- /dev/null +++ b/wrappers/elasticsearch/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/elasticsearch" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["elasticsearch-rest-tcp", "elasticsearch-java-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/elasticsearch/outputs.tf b/wrappers/elasticsearch/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/elasticsearch/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/elasticsearch/variables.tf b/wrappers/elasticsearch/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/elasticsearch/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/elasticsearch/versions.tf b/wrappers/elasticsearch/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/elasticsearch/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/etcd/README.md b/wrappers/etcd/README.md new file mode 100644 index 0000000..a7d3590 --- /dev/null +++ b/wrappers/etcd/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/etcd` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/etcd" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/etcd?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/etcd" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/etcd/main.tf b/wrappers/etcd/main.tf new file mode 100644 index 0000000..ef6995f --- /dev/null +++ b/wrappers/etcd/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/etcd" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["etcd-client-tcp", "etcd-peer-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/etcd/outputs.tf b/wrappers/etcd/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/etcd/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/etcd/variables.tf b/wrappers/etcd/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/etcd/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/etcd/versions.tf b/wrappers/etcd/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/etcd/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/grafana/README.md b/wrappers/grafana/README.md new file mode 100644 index 0000000..fbbbdc9 --- /dev/null +++ b/wrappers/grafana/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/grafana` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/grafana" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/grafana?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/grafana" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/grafana/main.tf b/wrappers/grafana/main.tf new file mode 100644 index 0000000..9073296 --- /dev/null +++ b/wrappers/grafana/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/grafana" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["grafana-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/grafana/outputs.tf b/wrappers/grafana/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/grafana/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/grafana/variables.tf b/wrappers/grafana/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/grafana/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/grafana/versions.tf b/wrappers/grafana/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/grafana/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/graphite-statsd/README.md b/wrappers/graphite-statsd/README.md new file mode 100644 index 0000000..489a1bb --- /dev/null +++ b/wrappers/graphite-statsd/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/graphite-statsd` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/graphite-statsd" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/graphite-statsd?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/graphite-statsd" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/graphite-statsd/main.tf b/wrappers/graphite-statsd/main.tf new file mode 100644 index 0000000..5a84f89 --- /dev/null +++ b/wrappers/graphite-statsd/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/graphite-statsd" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["graphite-webui", "graphite-2003-tcp", "graphite-2004-tcp", "graphite-2023-tcp", "graphite-2024-tcp", "graphite-8080-tcp", "graphite-8125-tcp", "graphite-8125-udp", "graphite-8126-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/graphite-statsd/outputs.tf b/wrappers/graphite-statsd/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/graphite-statsd/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/graphite-statsd/variables.tf b/wrappers/graphite-statsd/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/graphite-statsd/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/graphite-statsd/versions.tf b/wrappers/graphite-statsd/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/graphite-statsd/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/http-80/README.md b/wrappers/http-80/README.md new file mode 100644 index 0000000..bf49744 --- /dev/null +++ b/wrappers/http-80/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/http-80` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/http-80" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/http-80?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/http-80" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/http-80/main.tf b/wrappers/http-80/main.tf new file mode 100644 index 0000000..fd4161d --- /dev/null +++ b/wrappers/http-80/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/http-80" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["http-80-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/http-80/outputs.tf b/wrappers/http-80/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/http-80/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/http-80/variables.tf b/wrappers/http-80/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/http-80/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/http-80/versions.tf b/wrappers/http-80/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/http-80/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/http-8080/README.md b/wrappers/http-8080/README.md new file mode 100644 index 0000000..e78611f --- /dev/null +++ b/wrappers/http-8080/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/http-8080` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/http-8080" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/http-8080?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/http-8080" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/http-8080/main.tf b/wrappers/http-8080/main.tf new file mode 100644 index 0000000..c86eab7 --- /dev/null +++ b/wrappers/http-8080/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/http-8080" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["http-8080-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/http-8080/outputs.tf b/wrappers/http-8080/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/http-8080/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/http-8080/variables.tf b/wrappers/http-8080/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/http-8080/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/http-8080/versions.tf b/wrappers/http-8080/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/http-8080/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/https-443/README.md b/wrappers/https-443/README.md new file mode 100644 index 0000000..99cd957 --- /dev/null +++ b/wrappers/https-443/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/https-443` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/https-443" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/https-443?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/https-443" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/https-443/main.tf b/wrappers/https-443/main.tf new file mode 100644 index 0000000..b8a4d6f --- /dev/null +++ b/wrappers/https-443/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/https-443" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["https-443-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/https-443/outputs.tf b/wrappers/https-443/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/https-443/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/https-443/variables.tf b/wrappers/https-443/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/https-443/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/https-443/versions.tf b/wrappers/https-443/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/https-443/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/https-8443/README.md b/wrappers/https-8443/README.md new file mode 100644 index 0000000..12bd280 --- /dev/null +++ b/wrappers/https-8443/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/https-8443` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/https-8443" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/https-8443?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/https-8443" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/https-8443/main.tf b/wrappers/https-8443/main.tf new file mode 100644 index 0000000..55ffa4f --- /dev/null +++ b/wrappers/https-8443/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/https-8443" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["https-8443-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/https-8443/outputs.tf b/wrappers/https-8443/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/https-8443/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/https-8443/variables.tf b/wrappers/https-8443/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/https-8443/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/https-8443/versions.tf b/wrappers/https-8443/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/https-8443/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ipsec-4500/README.md b/wrappers/ipsec-4500/README.md new file mode 100644 index 0000000..b79037a --- /dev/null +++ b/wrappers/ipsec-4500/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ipsec-4500` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ipsec-4500" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ipsec-4500?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ipsec-4500" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ipsec-4500/main.tf b/wrappers/ipsec-4500/main.tf new file mode 100644 index 0000000..884769c --- /dev/null +++ b/wrappers/ipsec-4500/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ipsec-4500" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ipsec-4500-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ipsec-4500/outputs.tf b/wrappers/ipsec-4500/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ipsec-4500/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ipsec-4500/variables.tf b/wrappers/ipsec-4500/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ipsec-4500/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ipsec-4500/versions.tf b/wrappers/ipsec-4500/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ipsec-4500/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ipsec-500/README.md b/wrappers/ipsec-500/README.md new file mode 100644 index 0000000..6bdfbf0 --- /dev/null +++ b/wrappers/ipsec-500/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ipsec-500` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ipsec-500" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ipsec-500?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ipsec-500" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ipsec-500/main.tf b/wrappers/ipsec-500/main.tf new file mode 100644 index 0000000..3ddecd6 --- /dev/null +++ b/wrappers/ipsec-500/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ipsec-500" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ipsec-500-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ipsec-500/outputs.tf b/wrappers/ipsec-500/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ipsec-500/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ipsec-500/variables.tf b/wrappers/ipsec-500/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ipsec-500/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ipsec-500/versions.tf b/wrappers/ipsec-500/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ipsec-500/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/kafka/README.md b/wrappers/kafka/README.md new file mode 100644 index 0000000..1dc88b0 --- /dev/null +++ b/wrappers/kafka/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/kafka` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/kafka" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/kafka?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/kafka" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/kafka/main.tf b/wrappers/kafka/main.tf new file mode 100644 index 0000000..d654f96 --- /dev/null +++ b/wrappers/kafka/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/kafka" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["kafka-broker-tcp", "kafka-broker-tls-tcp", "kafka-broker-tls-public-tcp", "kafka-broker-sasl-scram-tcp", "kafka-broker-sasl-scram-tcp", "kafka-broker-sasl-iam-tcp", "kafka-broker-sasl-iam-public-tcp", "kafka-jmx-exporter-tcp", "kafka-node-exporter-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/kafka/outputs.tf b/wrappers/kafka/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/kafka/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/kafka/variables.tf b/wrappers/kafka/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/kafka/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/kafka/versions.tf b/wrappers/kafka/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/kafka/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/kibana/README.md b/wrappers/kibana/README.md new file mode 100644 index 0000000..27fa022 --- /dev/null +++ b/wrappers/kibana/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/kibana` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/kibana" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/kibana?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/kibana" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/kibana/main.tf b/wrappers/kibana/main.tf new file mode 100644 index 0000000..dd3dab8 --- /dev/null +++ b/wrappers/kibana/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/kibana" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["kibana-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/kibana/outputs.tf b/wrappers/kibana/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/kibana/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/kibana/variables.tf b/wrappers/kibana/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/kibana/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/kibana/versions.tf b/wrappers/kibana/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/kibana/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/kubernetes-api/README.md b/wrappers/kubernetes-api/README.md new file mode 100644 index 0000000..bf613a7 --- /dev/null +++ b/wrappers/kubernetes-api/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/kubernetes-api` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/kubernetes-api" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/kubernetes-api?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/kubernetes-api" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/kubernetes-api/main.tf b/wrappers/kubernetes-api/main.tf new file mode 100644 index 0000000..eab2065 --- /dev/null +++ b/wrappers/kubernetes-api/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/kubernetes-api" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["kubernetes-api-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/kubernetes-api/outputs.tf b/wrappers/kubernetes-api/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/kubernetes-api/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/kubernetes-api/variables.tf b/wrappers/kubernetes-api/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/kubernetes-api/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/kubernetes-api/versions.tf b/wrappers/kubernetes-api/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/kubernetes-api/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ldap/README.md b/wrappers/ldap/README.md new file mode 100644 index 0000000..cf571a8 --- /dev/null +++ b/wrappers/ldap/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ldap` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ldap" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ldap?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ldap" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ldap/main.tf b/wrappers/ldap/main.tf new file mode 100644 index 0000000..6e239b8 --- /dev/null +++ b/wrappers/ldap/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ldap" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ldap-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ldap/outputs.tf b/wrappers/ldap/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ldap/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ldap/variables.tf b/wrappers/ldap/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ldap/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ldap/versions.tf b/wrappers/ldap/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ldap/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ldaps/README.md b/wrappers/ldaps/README.md new file mode 100644 index 0000000..4073362 --- /dev/null +++ b/wrappers/ldaps/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ldaps` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ldaps" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ldaps?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ldaps" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ldaps/main.tf b/wrappers/ldaps/main.tf new file mode 100644 index 0000000..812457b --- /dev/null +++ b/wrappers/ldaps/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ldaps" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ldaps-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ldaps/outputs.tf b/wrappers/ldaps/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ldaps/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ldaps/variables.tf b/wrappers/ldaps/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ldaps/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ldaps/versions.tf b/wrappers/ldaps/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ldaps/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/logstash/README.md b/wrappers/logstash/README.md new file mode 100644 index 0000000..55f47ce --- /dev/null +++ b/wrappers/logstash/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/logstash` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/logstash" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/logstash?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/logstash" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/logstash/main.tf b/wrappers/logstash/main.tf new file mode 100644 index 0000000..d348936 --- /dev/null +++ b/wrappers/logstash/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/logstash" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["logstash-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/logstash/outputs.tf b/wrappers/logstash/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/logstash/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/logstash/variables.tf b/wrappers/logstash/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/logstash/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/logstash/versions.tf b/wrappers/logstash/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/logstash/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/loki/README.md b/wrappers/loki/README.md new file mode 100644 index 0000000..ae96802 --- /dev/null +++ b/wrappers/loki/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/loki` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/loki" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/loki?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/loki" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/loki/main.tf b/wrappers/loki/main.tf new file mode 100644 index 0000000..85fcace --- /dev/null +++ b/wrappers/loki/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/loki" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["loki-grafana", "loki-grafana-grpc"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/loki/outputs.tf b/wrappers/loki/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/loki/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/loki/variables.tf b/wrappers/loki/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/loki/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/loki/versions.tf b/wrappers/loki/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/loki/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/main.tf b/wrappers/main.tf new file mode 100644 index 0000000..83712d1 --- /dev/null +++ b/wrappers/main.tf @@ -0,0 +1,562 @@ +module "wrapper" { + source = "../" + + for_each = var.items + + auto_groups = try(each.value.auto_groups, var.defaults.auto_groups, { + activemq = { + ingress_rules = ["activemq-5671-tcp", "activemq-8883-tcp", "activemq-61614-tcp", "activemq-61617-tcp", "activemq-61619-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + alertmanager = { + ingress_rules = ["alertmanager-9093-tcp", "alertmanager-9094-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + carbon-relay-ng = { + ingress_rules = ["carbon-line-in-tcp", "carbon-line-in-udp", "carbon-pickle-tcp", "carbon-pickle-udp", "carbon-gui-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + cassandra = { + ingress_rules = ["cassandra-clients-tcp", "cassandra-thrift-clients-tcp", "cassandra-jmx-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + consul = { + ingress_rules = ["consul-tcp", "consul-grpc-tcp", "consul-grpc-tcp-tls", "consul-webui-http-tcp", "consul-webui-https-tcp", "consul-dns-tcp", "consul-dns-udp", "consul-serf-lan-tcp", "consul-serf-lan-udp", "consul-serf-wan-tcp", "consul-serf-wan-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + dax-cluster = { + ingress_rules = ["dax-cluster-unencrypted-tcp", "dax-cluster-encrypted-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + docker-swarm = { + ingress_rules = ["docker-swarm-mngmt-tcp", "docker-swarm-node-tcp", "docker-swarm-node-udp", "docker-swarm-overlay-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + etcd = { + ingress_rules = ["etcd-client-tcp", "etcd-peer-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + elasticsearch = { + ingress_rules = ["elasticsearch-rest-tcp", "elasticsearch-java-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + grafana = { + ingress_rules = ["grafana-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + graphite-statsd = { + ingress_rules = ["graphite-webui", "graphite-2003-tcp", "graphite-2004-tcp", "graphite-2023-tcp", "graphite-2024-tcp", "graphite-8080-tcp", "graphite-8125-tcp", "graphite-8125-udp", "graphite-8126-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + http-80 = { + ingress_rules = ["http-80-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + http-8080 = { + ingress_rules = ["http-8080-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + https-443 = { + ingress_rules = ["https-443-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + https-8443 = { + ingress_rules = ["https-8443-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ipsec-500 = { + ingress_rules = ["ipsec-500-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ipsec-4500 = { + ingress_rules = ["ipsec-4500-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + kafka = { + ingress_rules = ["kafka-broker-tcp", "kafka-broker-tls-tcp", "kafka-broker-tls-public-tcp", "kafka-broker-sasl-scram-tcp", "kafka-broker-sasl-scram-tcp", "kafka-broker-sasl-iam-tcp", "kafka-broker-sasl-iam-public-tcp", "kafka-jmx-exporter-tcp", "kafka-node-exporter-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + kubernetes-api = { + ingress_rules = ["kubernetes-api-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + kibana = { + ingress_rules = ["kibana-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ldap = { + ingress_rules = ["ldap-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ldaps = { + ingress_rules = ["ldaps-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + logstash = { + ingress_rules = ["logstash-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + loki = { + ingress_rules = ["loki-grafana", "loki-grafana-grpc"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + memcached = { + ingress_rules = ["memcached-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + minio = { + ingress_rules = ["minio-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + mongodb = { + ingress_rules = ["mongodb-27017-tcp", "mongodb-27018-tcp", "mongodb-27019-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + mysql = { + ingress_rules = ["mysql-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + mssql = { + ingress_rules = ["mssql-tcp", "mssql-udp", "mssql-analytics-tcp", "mssql-broker-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + nfs = { + ingress_rules = ["nfs-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + nomad = { + ingress_rules = ["nomad-http-tcp", "nomad-rpc-tcp", "nomad-serf-tcp", "nomad-serf-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + openvpn = { + ingress_rules = ["openvpn-udp", "openvpn-tcp", "openvpn-https-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + postgresql = { + ingress_rules = ["postgresql-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + oracle-db = { + ingress_rules = ["oracle-db-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ntp = { + ingress_rules = ["ntp-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + puppet = { + ingress_rules = ["puppet-tcp", "puppetdb-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + prometheus = { + ingress_rules = ["prometheus-http-tcp", "prometheus-pushgateway-http-tcp", "prometheus-node-exporter-http-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + promtail = { + ingress_rules = ["promtail-http"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + rabbitmq = { + ingress_rules = ["rabbitmq-4369-tcp", "rabbitmq-5671-tcp", "rabbitmq-5672-tcp", "rabbitmq-15672-tcp", "rabbitmq-25672-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + rdp = { + ingress_rules = ["rdp-tcp", "rdp-udp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + redis = { + ingress_rules = ["redis-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + redshift = { + ingress_rules = ["redshift-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + smtp = { + ingress_rules = ["smtp-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + smtp-submission = { + ingress_rules = ["smtp-submission-587-tcp", "smtp-submission-2587-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + smtps = { + ingress_rules = ["smtps-465-tcp", "smtps-2465-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + solr = { + ingress_rules = ["solr-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + splunk = { + ingress_rules = ["splunk-indexer-tcp", "splunk-web-tcp", "splunk-splunkd-tcp", "splunk-hec-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + squid = { + ingress_rules = ["squid-proxy-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + ssh = { + ingress_rules = ["ssh-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + storm = { + ingress_rules = ["storm-nimbus-tcp", "storm-ui-tcp", "storm-supervisor-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + vault = { + ingress_rules = ["vault-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + wazuh = { + ingress_rules = ["wazuh-server-agent-connection-tcp", "wazuh-server-agent-connection-udp", "wazuh-server-agent-enrollment", "wazuh-server-agent-cluster-daemon", "wazuh-server-syslog-collector-tcp", "wazuh-server-syslog-collector-udp", "wazuh-server-restful-api", "wazuh-indexer-restful-api", "wazuh-dashboard", ] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + web = { + ingress_rules = ["http-80-tcp", "http-8080-tcp", "https-443-tcp", "web-jmx-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + winrm = { + ingress_rules = ["winrm-http-tcp", "winrm-https-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + zabbix = { + ingress_rules = ["zabbix-server", "zabbix-proxy", "zabbix-agent"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + zipkin = { + ingress_rules = ["zipkin-admin-tcp", "zipkin-admin-query-tcp", "zipkin-admin-web-tcp", "zipkin-query-tcp", "zipkin-web-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + zookeeper = { + ingress_rules = ["zookeeper-2181-tcp", "zookeeper-2182-tls-tcp", "zookeeper-2888-tcp", "zookeeper-3888-tcp", "zookeeper-jmx-tcp"] + ingress_with_self = ["all-all"] + egress_rules = ["all-all"] + } + }) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + create_sg = try(each.value.create_sg, var.defaults.create_sg, true) + create_timeout = try(each.value.create_timeout, var.defaults.create_timeout, "10m") + delete_timeout = try(each.value.delete_timeout, var.defaults.delete_timeout, "15m") + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name, null) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + putin_khuylo = try(each.value.putin_khuylo, var.defaults.putin_khuylo, true) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + rules = try(each.value.rules, var.defaults.rules, { + + activemq-5671-tcp = [5671, 5671, "tcp", "ActiveMQ AMQP"] + activemq-8883-tcp = [8883, 8883, "tcp", "ActiveMQ MQTT"] + activemq-61614-tcp = [61614, 61614, "tcp", "ActiveMQ STOMP"] + activemq-61617-tcp = [61617, 61617, "tcp", "ActiveMQ OpenWire"] + activemq-61619-tcp = [61619, 61619, "tcp", "ActiveMQ WebSocket"] + + alertmanager-9093-tcp = [9093, 9093, "tcp", "Alert Manager"] + alertmanager-9094-tcp = [9094, 9094, "tcp", "Alert Manager Cluster"] + + carbon-line-in-tcp = [2003, 2003, "tcp", "Carbon line-in"] + carbon-line-in-udp = [2003, 2003, "udp", "Carbon line-in"] + carbon-pickle-tcp = [2013, 2013, "tcp", "Carbon pickle"] + carbon-pickle-udp = [2013, 2013, "udp", "Carbon pickle"] + carbon-admin-tcp = [2004, 2004, "tcp", "Carbon admin"] + carbon-gui-udp = [8081, 8081, "tcp", "Carbon GUI"] + + cassandra-clients-tcp = [9042, 9042, "tcp", "Cassandra clients"] + cassandra-thrift-clients-tcp = [9160, 9160, "tcp", "Cassandra Thrift clients"] + cassandra-jmx-tcp = [7199, 7199, "tcp", "JMX"] + + consul-tcp = [8300, 8300, "tcp", "Consul server"] + consul-grpc-tcp = [8502, 8502, "tcp", "Consul gRPC"] + consul-grpc-tcp-tls = [8503, 8503, "tcp", "Consul gRPC TLS"] + consul-webui-http-tcp = [8500, 8500, "tcp", "Consul web UI HTTP"] + consul-webui-https-tcp = [8501, 8501, "tcp", "Consul web UI HTTPS"] + consul-dns-tcp = [8600, 8600, "tcp", "Consul DNS"] + consul-dns-udp = [8600, 8600, "udp", "Consul DNS"] + consul-serf-lan-tcp = [8301, 8301, "tcp", "Serf LAN"] + consul-serf-lan-udp = [8301, 8301, "udp", "Serf LAN"] + consul-serf-wan-tcp = [8302, 8302, "tcp", "Serf WAN"] + consul-serf-wan-udp = [8302, 8302, "udp", "Serf WAN"] + + dax-cluster-unencrypted-tcp = [8111, 8111, "tcp", "DAX Cluster unencrypted"] + dax-cluster-encrypted-tcp = [9111, 9111, "tcp", "DAX Cluster encrypted"] + + docker-swarm-mngmt-tcp = [2377, 2377, "tcp", "Docker Swarm cluster management"] + docker-swarm-node-tcp = [7946, 7946, "tcp", "Docker Swarm node"] + docker-swarm-node-udp = [7946, 7946, "udp", "Docker Swarm node"] + docker-swarm-overlay-udp = [4789, 4789, "udp", "Docker Swarm Overlay Network Traffic"] + + dns-udp = [53, 53, "udp", "DNS"] + dns-tcp = [53, 53, "tcp", "DNS"] + + etcd-client-tcp = [2379, 2379, "tcp", "Etcd Client"] + etcd-peer-tcp = [2380, 2380, "tcp", "Etcd Peer"] + + ntp-udp = [123, 123, "udp", "NTP"] + + elasticsearch-rest-tcp = [9200, 9200, "tcp", "Elasticsearch REST interface"] + elasticsearch-java-tcp = [9300, 9300, "tcp", "Elasticsearch Java interface"] + + grafana-tcp = [3000, 3000, "tcp", "Grafana Dashboard"] + + graphite-webui = [80, 80, "tcp", "Graphite admin interface"] + graphite-2003-tcp = [2003, 2003, "tcp", "Carbon receiver plain text"] + graphite-2004-tcp = [2004, 2004, "tcp", "Carbon receiver pickle"] + graphite-2023-tcp = [2023, 2023, "tcp", "Carbon aggregator plaintext"] + graphite-2024-tcp = [2024, 2024, "tcp", "Carbon aggregator pickle"] + graphite-8080-tcp = [8080, 8080, "tcp", "Graphite gunicorn port"] + graphite-8125-tcp = [8125, 8125, "tcp", "Statsd TCP"] + graphite-8125-udp = [8125, 8125, "udp", "Statsd UDP default"] + graphite-8126-tcp = [8126, 8126, "tcp", "Statsd admin"] + + http-80-tcp = [80, 80, "tcp", "HTTP"] + http-8080-tcp = [8080, 8080, "tcp", "HTTP"] + + https-443-tcp = [443, 443, "tcp", "HTTPS"] + https-8443-tcp = [8443, 8443, "tcp", "HTTPS"] + + ipsec-500-udp = [500, 500, "udp", "IPSEC ISAKMP"] + ipsec-4500-udp = [4500, 4500, "udp", "IPSEC NAT-T"] + + kafka-broker-tcp = [9092, 9092, "tcp", "Kafka PLAINTEXT enable broker 0.8.2+"] + kafka-broker-tls-tcp = [9094, 9094, "tcp", "Kafka TLS enabled broker 0.8.2+"] + kafka-broker-tls-public-tcp = [9194, 9194, "tcp", "Kafka TLS Public enabled broker 0.8.2+ (MSK specific)"] + kafka-broker-sasl-scram-tcp = [9096, 9096, "tcp", "Kafka SASL/SCRAM enabled broker (MSK specific)"] + kafka-broker-sasl-scram-public-tcp = [9196, 9196, "tcp", "Kafka SASL/SCRAM Public enabled broker (MSK specific)"] + kafka-broker-sasl-iam-tcp = [9098, 9098, "tcp", "Kafka SASL/IAM access control enabled (MSK specific)"] + kafka-broker-sasl-iam-public-tcp = [9198, 9198, "tcp", "Kafka SASL/IAM Public access control enabled (MSK specific)"] + kafka-jmx-exporter-tcp = [11001, 11001, "tcp", "Kafka JMX Exporter"] + kafka-node-exporter-tcp = [11002, 11002, "tcp", "Kafka Node Exporter"] + + kibana-tcp = [5601, 5601, "tcp", "Kibana Web Interface"] + + kubernetes-api-tcp = [6443, 6443, "tcp", "Kubernetes API Server"] + + ldap-tcp = [389, 389, "tcp", "LDAP"] + + ldaps-tcp = [636, 636, "tcp", "LDAPS"] + + logstash-tcp = [5044, 5044, "tcp", "Logstash"] + + loki-grafana = [3100, 3100, "tcp", "Grafana Loki endpoint"] + loki-grafana-grpc = [9095, 9095, "tcp", "Grafana Loki GRPC"] + + memcached-tcp = [11211, 11211, "tcp", "Memcached"] + + minio-tcp = [9000, 9000, "tcp", "MinIO"] + + mongodb-27017-tcp = [27017, 27017, "tcp", "MongoDB"] + mongodb-27018-tcp = [27018, 27018, "tcp", "MongoDB shard"] + mongodb-27019-tcp = [27019, 27019, "tcp", "MongoDB config server"] + + mysql-tcp = [3306, 3306, "tcp", "MySQL/Aurora"] + + mssql-tcp = [1433, 1433, "tcp", "MSSQL Server"] + mssql-udp = [1434, 1434, "udp", "MSSQL Browser"] + mssql-analytics-tcp = [2383, 2383, "tcp", "MSSQL Analytics"] + mssql-broker-tcp = [4022, 4022, "tcp", "MSSQL Broker"] + + nfs-tcp = [2049, 2049, "tcp", "NFS/EFS"] + + nomad-http-tcp = [4646, 4646, "tcp", "Nomad HTTP"] + nomad-rpc-tcp = [4647, 4647, "tcp", "Nomad RPC"] + nomad-serf-tcp = [4648, 4648, "tcp", "Serf"] + nomad-serf-udp = [4648, 4648, "udp", "Serf"] + + openvpn-udp = [1194, 1194, "udp", "OpenVPN"] + openvpn-tcp = [943, 943, "tcp", "OpenVPN"] + openvpn-https-tcp = [443, 443, "tcp", "OpenVPN"] + + postgresql-tcp = [5432, 5432, "tcp", "PostgreSQL"] + + puppet-tcp = [8140, 8140, "tcp", "Puppet"] + puppetdb-tcp = [8081, 8081, "tcp", "PuppetDB"] + + prometheus-http-tcp = [9090, 9090, "tcp", "Prometheus"] + prometheus-pushgateway-http-tcp = [9091, 9091, "tcp", "Prometheus Pushgateway"] + prometheus-node-exporter-http-tcp = [9100, 9100, "tcp", "Prometheus Node Exporter"] + + promtail-http = [9080, 9080, "tcp", "Promtail endpoint"] + + oracle-db-tcp = [1521, 1521, "tcp", "Oracle"] + + octopus-tentacle-tcp = [10933, 10933, "tcp", "Octopus Tentacle"] + + rabbitmq-4369-tcp = [4369, 4369, "tcp", "RabbitMQ epmd"] + rabbitmq-5671-tcp = [5671, 5671, "tcp", "RabbitMQ"] + rabbitmq-5672-tcp = [5672, 5672, "tcp", "RabbitMQ"] + rabbitmq-15672-tcp = [15672, 15672, "tcp", "RabbitMQ"] + rabbitmq-25672-tcp = [25672, 25672, "tcp", "RabbitMQ"] + + rdp-tcp = [3389, 3389, "tcp", "Remote Desktop"] + rdp-udp = [3389, 3389, "udp", "Remote Desktop"] + + redis-tcp = [6379, 6379, "tcp", "Redis"] + + redshift-tcp = [5439, 5439, "tcp", "Redshift"] + + saltstack-tcp = [4505, 4506, "tcp", "SaltStack"] + + smtp-tcp = [25, 25, "tcp", "SMTP"] + smtp-submission-587-tcp = [587, 587, "tcp", "SMTP Submission"] + smtp-submission-2587-tcp = [2587, 2587, "tcp", "SMTP Submission"] + smtps-465-tcp = [465, 465, "tcp", "SMTPS"] + smtps-2456-tcp = [2465, 2465, "tcp", "SMTPS"] + + solr-tcp = [8983, 8987, "tcp", "Solr"] + + splunk-indexer-tcp = [9997, 9997, "tcp", "Splunk indexer"] + splunk-web-tcp = [8000, 8000, "tcp", "Splunk Web"] + splunk-splunkd-tcp = [8089, 8089, "tcp", "Splunkd"] + splunk-hec-tcp = [8088, 8088, "tcp", "Splunk HEC"] + + squid-proxy-tcp = [3128, 3128, "tcp", "Squid default proxy"] + + ssh-tcp = [22, 22, "tcp", "SSH"] + + storm-nimbus-tcp = [6627, 6627, "tcp", "Nimbus"] + storm-ui-tcp = [8080, 8080, "tcp", "Storm UI"] + storm-supervisor-tcp = [6700, 6703, "tcp", "Supervisor"] + + vault-tcp = [8200, 8200, "tcp", "Vault"] + + wazuh-server-agent-connection-tcp = [1514, 1514, "tcp", "Agent connection service(TCP)"] + wazuh-server-agent-connection-udp = [1514, 1514, "udp", "Agent connection service(UDP)"] + wazuh-server-agent-enrollment = [1515, 1515, "tcp", "Agent enrollment service"] + wazuh-server-agent-cluster-daemon = [1516, 1516, "tcp", "Wazuh cluster daemon"] + wazuh-server-syslog-collector-tcp = [514, 514, "tcp", "Wazuh Syslog collector(TCP)"] + wazuh-server-syslog-collector-udp = [514, 514, "udp", "Wazuh Syslog collector(UDP)"] + wazuh-server-restful-api = [55000, 55000, "tcp", "Wazuh server RESTful API"] + wazuh-indexer-restful-api = [9200, 9200, "tcp", "Wazuh indexer RESTful API"] + wazuh-dashboard = [443, 443, "tcp", "Wazuh web user interface"] + + web-jmx-tcp = [1099, 1099, "tcp", "JMX"] + + winrm-http-tcp = [5985, 5985, "tcp", "WinRM HTTP"] + winrm-https-tcp = [5986, 5986, "tcp", "WinRM HTTPS"] + + zabbix-server = [10051, 10051, "tcp", "Zabbix Server"] + zabbix-proxy = [10051, 10051, "tcp", "Zabbix Proxy"] + zabbix-agent = [10050, 10050, "tcp", "Zabbix Agent"] + + zipkin-admin-tcp = [9990, 9990, "tcp", "Zipkin Admin port collector"] + zipkin-admin-query-tcp = [9901, 9901, "tcp", "Zipkin Admin port query"] + zipkin-admin-web-tcp = [9991, 9991, "tcp", "Zipkin Admin port web"] + zipkin-query-tcp = [9411, 9411, "tcp", "Zipkin query port"] + zipkin-web-tcp = [8080, 8080, "tcp", "Zipkin web port"] + + zookeeper-2181-tcp = [2181, 2181, "tcp", "Zookeeper"] + zookeeper-2182-tls-tcp = [2182, 2182, "tcp", "Zookeeper TLS (MSK specific)"] + zookeeper-2888-tcp = [2888, 2888, "tcp", "Zookeeper"] + zookeeper-3888-tcp = [3888, 3888, "tcp", "Zookeeper"] + zookeeper-jmx-tcp = [7199, 7199, "tcp", "JMX"] + + all-all = [-1, -1, "-1", "All protocols"] + all-tcp = [0, 65535, "tcp", "All TCP ports"] + all-udp = [0, 65535, "udp", "All UDP ports"] + all-icmp = [-1, -1, "icmp", "All IPV4 ICMP"] + all-ipv6-icmp = [-1, -1, 58, "All IPV6 ICMP"] + + _ = ["", "", ""] + }) + security_group_id = try(each.value.security_group_id, var.defaults.security_group_id, null) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id, null) +} diff --git a/wrappers/memcached/README.md b/wrappers/memcached/README.md new file mode 100644 index 0000000..5e78d04 --- /dev/null +++ b/wrappers/memcached/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/memcached` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/memcached" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/memcached?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/memcached" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/memcached/main.tf b/wrappers/memcached/main.tf new file mode 100644 index 0000000..b184df6 --- /dev/null +++ b/wrappers/memcached/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/memcached" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["memcached-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/memcached/outputs.tf b/wrappers/memcached/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/memcached/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/memcached/variables.tf b/wrappers/memcached/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/memcached/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/memcached/versions.tf b/wrappers/memcached/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/memcached/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/minio/README.md b/wrappers/minio/README.md new file mode 100644 index 0000000..f1bd88f --- /dev/null +++ b/wrappers/minio/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/minio` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/minio" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/minio?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/minio" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/minio/main.tf b/wrappers/minio/main.tf new file mode 100644 index 0000000..3941aa1 --- /dev/null +++ b/wrappers/minio/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/minio" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["minio-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/minio/outputs.tf b/wrappers/minio/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/minio/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/minio/variables.tf b/wrappers/minio/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/minio/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/minio/versions.tf b/wrappers/minio/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/minio/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/mongodb/README.md b/wrappers/mongodb/README.md new file mode 100644 index 0000000..f6707c2 --- /dev/null +++ b/wrappers/mongodb/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/mongodb` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/mongodb" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/mongodb?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/mongodb" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/mongodb/main.tf b/wrappers/mongodb/main.tf new file mode 100644 index 0000000..eca4acb --- /dev/null +++ b/wrappers/mongodb/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/mongodb" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["mongodb-27017-tcp", "mongodb-27018-tcp", "mongodb-27019-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/mongodb/outputs.tf b/wrappers/mongodb/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/mongodb/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/mongodb/variables.tf b/wrappers/mongodb/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/mongodb/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/mongodb/versions.tf b/wrappers/mongodb/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/mongodb/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/mssql/README.md b/wrappers/mssql/README.md new file mode 100644 index 0000000..afff182 --- /dev/null +++ b/wrappers/mssql/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/mssql` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/mssql" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/mssql?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/mssql" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/mssql/main.tf b/wrappers/mssql/main.tf new file mode 100644 index 0000000..2d2fdd7 --- /dev/null +++ b/wrappers/mssql/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/mssql" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["mssql-tcp", "mssql-udp", "mssql-analytics-tcp", "mssql-broker-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/mssql/outputs.tf b/wrappers/mssql/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/mssql/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/mssql/variables.tf b/wrappers/mssql/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/mssql/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/mssql/versions.tf b/wrappers/mssql/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/mssql/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/mysql/README.md b/wrappers/mysql/README.md new file mode 100644 index 0000000..eb96341 --- /dev/null +++ b/wrappers/mysql/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/mysql` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/mysql" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/mysql?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/mysql" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/mysql/main.tf b/wrappers/mysql/main.tf new file mode 100644 index 0000000..6468a27 --- /dev/null +++ b/wrappers/mysql/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/mysql" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["mysql-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/mysql/outputs.tf b/wrappers/mysql/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/mysql/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/mysql/variables.tf b/wrappers/mysql/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/mysql/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/mysql/versions.tf b/wrappers/mysql/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/mysql/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/nfs/README.md b/wrappers/nfs/README.md new file mode 100644 index 0000000..9e79427 --- /dev/null +++ b/wrappers/nfs/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/nfs` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/nfs" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/nfs?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/nfs" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/nfs/main.tf b/wrappers/nfs/main.tf new file mode 100644 index 0000000..598d3e9 --- /dev/null +++ b/wrappers/nfs/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/nfs" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["nfs-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/nfs/outputs.tf b/wrappers/nfs/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/nfs/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/nfs/variables.tf b/wrappers/nfs/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/nfs/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/nfs/versions.tf b/wrappers/nfs/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/nfs/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/nomad/README.md b/wrappers/nomad/README.md new file mode 100644 index 0000000..9561dd8 --- /dev/null +++ b/wrappers/nomad/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/nomad` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/nomad" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/nomad?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/nomad" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/nomad/main.tf b/wrappers/nomad/main.tf new file mode 100644 index 0000000..44a6177 --- /dev/null +++ b/wrappers/nomad/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/nomad" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["nomad-http-tcp", "nomad-rpc-tcp", "nomad-serf-tcp", "nomad-serf-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/nomad/outputs.tf b/wrappers/nomad/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/nomad/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/nomad/variables.tf b/wrappers/nomad/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/nomad/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/nomad/versions.tf b/wrappers/nomad/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/nomad/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ntp/README.md b/wrappers/ntp/README.md new file mode 100644 index 0000000..baa0099 --- /dev/null +++ b/wrappers/ntp/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ntp` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ntp" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ntp?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ntp" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ntp/main.tf b/wrappers/ntp/main.tf new file mode 100644 index 0000000..83ae843 --- /dev/null +++ b/wrappers/ntp/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ntp" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ntp-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ntp/outputs.tf b/wrappers/ntp/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ntp/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ntp/variables.tf b/wrappers/ntp/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ntp/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ntp/versions.tf b/wrappers/ntp/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ntp/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/openvpn/README.md b/wrappers/openvpn/README.md new file mode 100644 index 0000000..ec932d9 --- /dev/null +++ b/wrappers/openvpn/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/openvpn` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/openvpn" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/openvpn?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/openvpn" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/openvpn/main.tf b/wrappers/openvpn/main.tf new file mode 100644 index 0000000..7e9e33b --- /dev/null +++ b/wrappers/openvpn/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/openvpn" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["openvpn-udp", "openvpn-tcp", "openvpn-https-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/openvpn/outputs.tf b/wrappers/openvpn/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/openvpn/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/openvpn/variables.tf b/wrappers/openvpn/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/openvpn/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/openvpn/versions.tf b/wrappers/openvpn/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/openvpn/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/oracle-db/README.md b/wrappers/oracle-db/README.md new file mode 100644 index 0000000..aac1f55 --- /dev/null +++ b/wrappers/oracle-db/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/oracle-db` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/oracle-db" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/oracle-db?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/oracle-db" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/oracle-db/main.tf b/wrappers/oracle-db/main.tf new file mode 100644 index 0000000..87947bb --- /dev/null +++ b/wrappers/oracle-db/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/oracle-db" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["oracle-db-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/oracle-db/outputs.tf b/wrappers/oracle-db/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/oracle-db/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/oracle-db/variables.tf b/wrappers/oracle-db/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/oracle-db/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/oracle-db/versions.tf b/wrappers/oracle-db/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/oracle-db/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/outputs.tf b/wrappers/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/postgresql/README.md b/wrappers/postgresql/README.md new file mode 100644 index 0000000..1279873 --- /dev/null +++ b/wrappers/postgresql/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/postgresql` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/postgresql" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/postgresql?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/postgresql" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/postgresql/main.tf b/wrappers/postgresql/main.tf new file mode 100644 index 0000000..8e7e486 --- /dev/null +++ b/wrappers/postgresql/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/postgresql" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["postgresql-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/postgresql/outputs.tf b/wrappers/postgresql/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/postgresql/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/postgresql/variables.tf b/wrappers/postgresql/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/postgresql/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/postgresql/versions.tf b/wrappers/postgresql/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/postgresql/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/prometheus/README.md b/wrappers/prometheus/README.md new file mode 100644 index 0000000..58ad4c6 --- /dev/null +++ b/wrappers/prometheus/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/prometheus` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/prometheus" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/prometheus?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/prometheus" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/prometheus/main.tf b/wrappers/prometheus/main.tf new file mode 100644 index 0000000..49cabf9 --- /dev/null +++ b/wrappers/prometheus/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/prometheus" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["prometheus-http-tcp", "prometheus-pushgateway-http-tcp", "prometheus-node-exporter-http-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/prometheus/outputs.tf b/wrappers/prometheus/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/prometheus/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/prometheus/variables.tf b/wrappers/prometheus/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/prometheus/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/prometheus/versions.tf b/wrappers/prometheus/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/prometheus/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/promtail/README.md b/wrappers/promtail/README.md new file mode 100644 index 0000000..8cc5b56 --- /dev/null +++ b/wrappers/promtail/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/promtail` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/promtail" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/promtail?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/promtail" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/promtail/main.tf b/wrappers/promtail/main.tf new file mode 100644 index 0000000..fee81db --- /dev/null +++ b/wrappers/promtail/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/promtail" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["promtail-http"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/promtail/outputs.tf b/wrappers/promtail/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/promtail/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/promtail/variables.tf b/wrappers/promtail/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/promtail/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/promtail/versions.tf b/wrappers/promtail/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/promtail/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/puppet/README.md b/wrappers/puppet/README.md new file mode 100644 index 0000000..16bb597 --- /dev/null +++ b/wrappers/puppet/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/puppet` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/puppet" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/puppet?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/puppet" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/puppet/main.tf b/wrappers/puppet/main.tf new file mode 100644 index 0000000..e41800d --- /dev/null +++ b/wrappers/puppet/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/puppet" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["puppet-tcp", "puppetdb-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/puppet/outputs.tf b/wrappers/puppet/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/puppet/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/puppet/variables.tf b/wrappers/puppet/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/puppet/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/puppet/versions.tf b/wrappers/puppet/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/puppet/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/rabbitmq/README.md b/wrappers/rabbitmq/README.md new file mode 100644 index 0000000..84cf6c9 --- /dev/null +++ b/wrappers/rabbitmq/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/rabbitmq` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/rabbitmq" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/rabbitmq?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/rabbitmq" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/rabbitmq/main.tf b/wrappers/rabbitmq/main.tf new file mode 100644 index 0000000..8cd5e87 --- /dev/null +++ b/wrappers/rabbitmq/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/rabbitmq" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["rabbitmq-4369-tcp", "rabbitmq-5671-tcp", "rabbitmq-5672-tcp", "rabbitmq-15672-tcp", "rabbitmq-25672-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/rabbitmq/outputs.tf b/wrappers/rabbitmq/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/rabbitmq/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/rabbitmq/variables.tf b/wrappers/rabbitmq/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/rabbitmq/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/rabbitmq/versions.tf b/wrappers/rabbitmq/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/rabbitmq/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/rdp/README.md b/wrappers/rdp/README.md new file mode 100644 index 0000000..db850a0 --- /dev/null +++ b/wrappers/rdp/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/rdp` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/rdp" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/rdp?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/rdp" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/rdp/main.tf b/wrappers/rdp/main.tf new file mode 100644 index 0000000..1e385c5 --- /dev/null +++ b/wrappers/rdp/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/rdp" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["rdp-tcp", "rdp-udp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/rdp/outputs.tf b/wrappers/rdp/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/rdp/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/rdp/variables.tf b/wrappers/rdp/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/rdp/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/rdp/versions.tf b/wrappers/rdp/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/rdp/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/redis/README.md b/wrappers/redis/README.md new file mode 100644 index 0000000..0e19554 --- /dev/null +++ b/wrappers/redis/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/redis` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/redis" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/redis?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/redis" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/redis/main.tf b/wrappers/redis/main.tf new file mode 100644 index 0000000..e1e3a0e --- /dev/null +++ b/wrappers/redis/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/redis" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["redis-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/redis/outputs.tf b/wrappers/redis/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/redis/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/redis/variables.tf b/wrappers/redis/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/redis/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/redis/versions.tf b/wrappers/redis/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/redis/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/redshift/README.md b/wrappers/redshift/README.md new file mode 100644 index 0000000..2e1666f --- /dev/null +++ b/wrappers/redshift/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/redshift` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/redshift" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/redshift?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/redshift" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/redshift/main.tf b/wrappers/redshift/main.tf new file mode 100644 index 0000000..b871c6b --- /dev/null +++ b/wrappers/redshift/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/redshift" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["redshift-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/redshift/outputs.tf b/wrappers/redshift/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/redshift/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/redshift/variables.tf b/wrappers/redshift/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/redshift/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/redshift/versions.tf b/wrappers/redshift/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/redshift/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/smtp-submission/README.md b/wrappers/smtp-submission/README.md new file mode 100644 index 0000000..57a3afc --- /dev/null +++ b/wrappers/smtp-submission/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/smtp-submission` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/smtp-submission" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/smtp-submission?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/smtp-submission" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/smtp-submission/main.tf b/wrappers/smtp-submission/main.tf new file mode 100644 index 0000000..90ba7df --- /dev/null +++ b/wrappers/smtp-submission/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/smtp-submission" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["smtp-submission-587-tcp", "smtp-submission-2587-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/smtp-submission/outputs.tf b/wrappers/smtp-submission/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/smtp-submission/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/smtp-submission/variables.tf b/wrappers/smtp-submission/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/smtp-submission/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/smtp-submission/versions.tf b/wrappers/smtp-submission/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/smtp-submission/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/smtp/README.md b/wrappers/smtp/README.md new file mode 100644 index 0000000..236e26c --- /dev/null +++ b/wrappers/smtp/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/smtp` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/smtp" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/smtp?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/smtp" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/smtp/main.tf b/wrappers/smtp/main.tf new file mode 100644 index 0000000..0a5a1d8 --- /dev/null +++ b/wrappers/smtp/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/smtp" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["smtp-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/smtp/outputs.tf b/wrappers/smtp/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/smtp/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/smtp/variables.tf b/wrappers/smtp/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/smtp/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/smtp/versions.tf b/wrappers/smtp/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/smtp/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/smtps/README.md b/wrappers/smtps/README.md new file mode 100644 index 0000000..daa032f --- /dev/null +++ b/wrappers/smtps/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/smtps` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/smtps" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/smtps?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/smtps" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/smtps/main.tf b/wrappers/smtps/main.tf new file mode 100644 index 0000000..08a1328 --- /dev/null +++ b/wrappers/smtps/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/smtps" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["smtps-465-tcp", "smtps-2465-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/smtps/outputs.tf b/wrappers/smtps/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/smtps/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/smtps/variables.tf b/wrappers/smtps/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/smtps/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/smtps/versions.tf b/wrappers/smtps/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/smtps/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/solr/README.md b/wrappers/solr/README.md new file mode 100644 index 0000000..6b3c68d --- /dev/null +++ b/wrappers/solr/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/solr` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/solr" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/solr?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/solr" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/solr/main.tf b/wrappers/solr/main.tf new file mode 100644 index 0000000..444c0c6 --- /dev/null +++ b/wrappers/solr/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/solr" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["solr-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/solr/outputs.tf b/wrappers/solr/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/solr/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/solr/variables.tf b/wrappers/solr/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/solr/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/solr/versions.tf b/wrappers/solr/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/solr/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/splunk/README.md b/wrappers/splunk/README.md new file mode 100644 index 0000000..37285de --- /dev/null +++ b/wrappers/splunk/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/splunk` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/splunk" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/splunk?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/splunk" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/splunk/main.tf b/wrappers/splunk/main.tf new file mode 100644 index 0000000..eb89495 --- /dev/null +++ b/wrappers/splunk/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/splunk" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["splunk-indexer-tcp", "splunk-web-tcp", "splunk-splunkd-tcp", "splunk-hec-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/splunk/outputs.tf b/wrappers/splunk/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/splunk/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/splunk/variables.tf b/wrappers/splunk/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/splunk/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/splunk/versions.tf b/wrappers/splunk/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/splunk/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/squid/README.md b/wrappers/squid/README.md new file mode 100644 index 0000000..3ba84b2 --- /dev/null +++ b/wrappers/squid/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/squid` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/squid" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/squid?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/squid" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/squid/main.tf b/wrappers/squid/main.tf new file mode 100644 index 0000000..71f444a --- /dev/null +++ b/wrappers/squid/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/squid" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["squid-proxy-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/squid/outputs.tf b/wrappers/squid/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/squid/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/squid/variables.tf b/wrappers/squid/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/squid/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/squid/versions.tf b/wrappers/squid/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/squid/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/ssh/README.md b/wrappers/ssh/README.md new file mode 100644 index 0000000..9bdb7fd --- /dev/null +++ b/wrappers/ssh/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/ssh` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/ssh" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/ssh?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/ssh" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/ssh/main.tf b/wrappers/ssh/main.tf new file mode 100644 index 0000000..aeda225 --- /dev/null +++ b/wrappers/ssh/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/ssh" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["ssh-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/ssh/outputs.tf b/wrappers/ssh/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/ssh/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/ssh/variables.tf b/wrappers/ssh/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/ssh/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/ssh/versions.tf b/wrappers/ssh/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/ssh/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/storm/README.md b/wrappers/storm/README.md new file mode 100644 index 0000000..9bbfa58 --- /dev/null +++ b/wrappers/storm/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/storm` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/storm" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/storm?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/storm" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/storm/main.tf b/wrappers/storm/main.tf new file mode 100644 index 0000000..bf49d85 --- /dev/null +++ b/wrappers/storm/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/storm" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["storm-nimbus-tcp", "storm-ui-tcp", "storm-supervisor-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/storm/outputs.tf b/wrappers/storm/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/storm/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/storm/variables.tf b/wrappers/storm/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/storm/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/storm/versions.tf b/wrappers/storm/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/storm/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/variables.tf b/wrappers/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/vault/README.md b/wrappers/vault/README.md new file mode 100644 index 0000000..c323058 --- /dev/null +++ b/wrappers/vault/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/vault` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/vault" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/vault?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/vault" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/vault/main.tf b/wrappers/vault/main.tf new file mode 100644 index 0000000..35bbf6f --- /dev/null +++ b/wrappers/vault/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/vault" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["vault-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/vault/outputs.tf b/wrappers/vault/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/vault/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/vault/variables.tf b/wrappers/vault/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/vault/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/vault/versions.tf b/wrappers/vault/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/vault/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/versions.tf b/wrappers/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/wazuh/README.md b/wrappers/wazuh/README.md new file mode 100644 index 0000000..de9751d --- /dev/null +++ b/wrappers/wazuh/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/wazuh` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/wazuh" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/wazuh?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/wazuh" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/wazuh/main.tf b/wrappers/wazuh/main.tf new file mode 100644 index 0000000..a9d76b0 --- /dev/null +++ b/wrappers/wazuh/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/wazuh" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["wazuh-server-agent-connection-tcp", "wazuh-server-agent-connection-udp", "wazuh-server-agent-enrollment", "wazuh-server-agent-cluster-daemon", "wazuh-server-syslog-collector-tcp", "wazuh-server-syslog-collector-udp", "wazuh-server-restful-api", "wazuh-indexer-restful-api", "wazuh-dashboard"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/wazuh/outputs.tf b/wrappers/wazuh/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/wazuh/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/wazuh/variables.tf b/wrappers/wazuh/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/wazuh/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/wazuh/versions.tf b/wrappers/wazuh/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/wazuh/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/web/README.md b/wrappers/web/README.md new file mode 100644 index 0000000..bd9132b --- /dev/null +++ b/wrappers/web/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/web` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/web" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/web?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/web" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/web/main.tf b/wrappers/web/main.tf new file mode 100644 index 0000000..7a3b94d --- /dev/null +++ b/wrappers/web/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/web" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["http-80-tcp", "http-8080-tcp", "https-443-tcp", "web-jmx-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/web/outputs.tf b/wrappers/web/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/web/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/web/variables.tf b/wrappers/web/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/web/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/web/versions.tf b/wrappers/web/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/web/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/winrm/README.md b/wrappers/winrm/README.md new file mode 100644 index 0000000..13f2d7e --- /dev/null +++ b/wrappers/winrm/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/winrm` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/winrm" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/winrm?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/winrm" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/winrm/main.tf b/wrappers/winrm/main.tf new file mode 100644 index 0000000..1ec169d --- /dev/null +++ b/wrappers/winrm/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/winrm" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["winrm-http-tcp", "winrm-https-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/winrm/outputs.tf b/wrappers/winrm/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/winrm/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/winrm/variables.tf b/wrappers/winrm/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/winrm/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/winrm/versions.tf b/wrappers/winrm/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/winrm/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/zabbix/README.md b/wrappers/zabbix/README.md new file mode 100644 index 0000000..873f673 --- /dev/null +++ b/wrappers/zabbix/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/zabbix` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/zabbix" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/zabbix?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/zabbix" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/zabbix/main.tf b/wrappers/zabbix/main.tf new file mode 100644 index 0000000..c16af08 --- /dev/null +++ b/wrappers/zabbix/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/zabbix" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["zabbix-server", "zabbix-proxy", "zabbix-agent"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/zabbix/outputs.tf b/wrappers/zabbix/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/zabbix/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/zabbix/variables.tf b/wrappers/zabbix/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/zabbix/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/zabbix/versions.tf b/wrappers/zabbix/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/zabbix/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/zipkin/README.md b/wrappers/zipkin/README.md new file mode 100644 index 0000000..5928acc --- /dev/null +++ b/wrappers/zipkin/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/zipkin` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/zipkin" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/zipkin?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/zipkin" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/zipkin/main.tf b/wrappers/zipkin/main.tf new file mode 100644 index 0000000..48e2a09 --- /dev/null +++ b/wrappers/zipkin/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/zipkin" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["zipkin-admin-tcp", "zipkin-admin-query-tcp", "zipkin-admin-web-tcp", "zipkin-query-tcp", "zipkin-web-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/zipkin/outputs.tf b/wrappers/zipkin/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/zipkin/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/zipkin/variables.tf b/wrappers/zipkin/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/zipkin/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/zipkin/versions.tf b/wrappers/zipkin/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/zipkin/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +} diff --git a/wrappers/zookeeper/README.md b/wrappers/zookeeper/README.md new file mode 100644 index 0000000..dea3cdb --- /dev/null +++ b/wrappers/zookeeper/README.md @@ -0,0 +1,100 @@ +# Wrapper for module: `modules/zookeeper` + +The configuration in this directory contains an implementation of a single module wrapper pattern, which allows managing several copies of a module in places where using the native Terraform 0.13+ `for_each` feature is not feasible (e.g., with Terragrunt). + +You may want to use a single Terragrunt configuration file to manage multiple resources without duplicating `terragrunt.hcl` files for each copy of the same module. + +This wrapper does not implement any extra functionality. + +## Usage with Terragrunt + +`terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/security-group/aws//wrappers/zookeeper" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-security-group.git//wrappers/zookeeper?ref=master" +} + +inputs = { + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Usage with Terraform + +```hcl +module "wrapper" { + source = "terraform-aws-modules/security-group/aws//wrappers/zookeeper" + + defaults = { # Default values + create = true + tags = { + Terraform = "true" + Environment = "dev" + } + } + + items = { + my-item = { + # omitted... can be any argument supported by the module + } + my-second-item = { + # omitted... can be any argument supported by the module + } + # omitted... + } +} +``` + +## Example: Manage multiple S3 buckets in one Terragrunt layer + +`eu-west-1/s3-buckets/terragrunt.hcl`: + +```hcl +terraform { + source = "tfr:///terraform-aws-modules/s3-bucket/aws//wrappers" + # Alternative source: + # source = "git::git@github.com:terraform-aws-modules/terraform-aws-s3-bucket.git//wrappers?ref=master" +} + +inputs = { + defaults = { + force_destroy = true + + attach_elb_log_delivery_policy = true + attach_lb_log_delivery_policy = true + attach_deny_insecure_transport_policy = true + attach_require_latest_tls_policy = true + } + + items = { + bucket1 = { + bucket = "my-random-bucket-1" + } + bucket2 = { + bucket = "my-random-bucket-2" + tags = { + Secure = "probably" + } + } + } +} +``` diff --git a/wrappers/zookeeper/main.tf b/wrappers/zookeeper/main.tf new file mode 100644 index 0000000..e391c5d --- /dev/null +++ b/wrappers/zookeeper/main.tf @@ -0,0 +1,79 @@ +module "wrapper" { + source = "../../modules/zookeeper" + + for_each = var.items + + auto_computed_egress_rules = try(each.value.auto_computed_egress_rules, var.defaults.auto_computed_egress_rules, []) + auto_computed_egress_with_self = try(each.value.auto_computed_egress_with_self, var.defaults.auto_computed_egress_with_self, []) + auto_computed_ingress_rules = try(each.value.auto_computed_ingress_rules, var.defaults.auto_computed_ingress_rules, []) + auto_computed_ingress_with_self = try(each.value.auto_computed_ingress_with_self, var.defaults.auto_computed_ingress_with_self, []) + auto_egress_rules = try(each.value.auto_egress_rules, var.defaults.auto_egress_rules, ["all-all"]) + auto_egress_with_self = try(each.value.auto_egress_with_self, var.defaults.auto_egress_with_self, []) + auto_ingress_rules = try(each.value.auto_ingress_rules, var.defaults.auto_ingress_rules, ["zookeeper-2181-tcp", "zookeeper-2182-tls-tcp", "zookeeper-2888-tcp", "zookeeper-3888-tcp", "zookeeper-jmx-tcp"]) + auto_ingress_with_self = try(each.value.auto_ingress_with_self, var.defaults.auto_ingress_with_self, [{ "rule" = "all-all" }]) + auto_number_of_computed_egress_rules = try(each.value.auto_number_of_computed_egress_rules, var.defaults.auto_number_of_computed_egress_rules, 0) + auto_number_of_computed_egress_with_self = try(each.value.auto_number_of_computed_egress_with_self, var.defaults.auto_number_of_computed_egress_with_self, 0) + auto_number_of_computed_ingress_rules = try(each.value.auto_number_of_computed_ingress_rules, var.defaults.auto_number_of_computed_ingress_rules, 0) + auto_number_of_computed_ingress_with_self = try(each.value.auto_number_of_computed_ingress_with_self, var.defaults.auto_number_of_computed_ingress_with_self, 0) + computed_egress_cidr_blocks = try(each.value.computed_egress_cidr_blocks, var.defaults.computed_egress_cidr_blocks, ["0.0.0.0/0"]) + computed_egress_ipv6_cidr_blocks = try(each.value.computed_egress_ipv6_cidr_blocks, var.defaults.computed_egress_ipv6_cidr_blocks, ["::/0"]) + computed_egress_prefix_list_ids = try(each.value.computed_egress_prefix_list_ids, var.defaults.computed_egress_prefix_list_ids, []) + computed_egress_rules = try(each.value.computed_egress_rules, var.defaults.computed_egress_rules, []) + computed_egress_with_cidr_blocks = try(each.value.computed_egress_with_cidr_blocks, var.defaults.computed_egress_with_cidr_blocks, []) + computed_egress_with_ipv6_cidr_blocks = try(each.value.computed_egress_with_ipv6_cidr_blocks, var.defaults.computed_egress_with_ipv6_cidr_blocks, []) + computed_egress_with_prefix_list_ids = try(each.value.computed_egress_with_prefix_list_ids, var.defaults.computed_egress_with_prefix_list_ids, []) + computed_egress_with_self = try(each.value.computed_egress_with_self, var.defaults.computed_egress_with_self, []) + computed_egress_with_source_security_group_id = try(each.value.computed_egress_with_source_security_group_id, var.defaults.computed_egress_with_source_security_group_id, []) + computed_ingress_cidr_blocks = try(each.value.computed_ingress_cidr_blocks, var.defaults.computed_ingress_cidr_blocks, []) + computed_ingress_ipv6_cidr_blocks = try(each.value.computed_ingress_ipv6_cidr_blocks, var.defaults.computed_ingress_ipv6_cidr_blocks, []) + computed_ingress_prefix_list_ids = try(each.value.computed_ingress_prefix_list_ids, var.defaults.computed_ingress_prefix_list_ids, []) + computed_ingress_rules = try(each.value.computed_ingress_rules, var.defaults.computed_ingress_rules, []) + computed_ingress_with_cidr_blocks = try(each.value.computed_ingress_with_cidr_blocks, var.defaults.computed_ingress_with_cidr_blocks, []) + computed_ingress_with_ipv6_cidr_blocks = try(each.value.computed_ingress_with_ipv6_cidr_blocks, var.defaults.computed_ingress_with_ipv6_cidr_blocks, []) + computed_ingress_with_prefix_list_ids = try(each.value.computed_ingress_with_prefix_list_ids, var.defaults.computed_ingress_with_prefix_list_ids, []) + computed_ingress_with_self = try(each.value.computed_ingress_with_self, var.defaults.computed_ingress_with_self, []) + computed_ingress_with_source_security_group_id = try(each.value.computed_ingress_with_source_security_group_id, var.defaults.computed_ingress_with_source_security_group_id, []) + create = try(each.value.create, var.defaults.create, true) + description = try(each.value.description, var.defaults.description, "Security Group managed by Terraform") + egress_cidr_blocks = try(each.value.egress_cidr_blocks, var.defaults.egress_cidr_blocks, ["0.0.0.0/0"]) + egress_ipv6_cidr_blocks = try(each.value.egress_ipv6_cidr_blocks, var.defaults.egress_ipv6_cidr_blocks, ["::/0"]) + egress_prefix_list_ids = try(each.value.egress_prefix_list_ids, var.defaults.egress_prefix_list_ids, []) + egress_rules = try(each.value.egress_rules, var.defaults.egress_rules, []) + egress_with_cidr_blocks = try(each.value.egress_with_cidr_blocks, var.defaults.egress_with_cidr_blocks, []) + egress_with_ipv6_cidr_blocks = try(each.value.egress_with_ipv6_cidr_blocks, var.defaults.egress_with_ipv6_cidr_blocks, []) + egress_with_prefix_list_ids = try(each.value.egress_with_prefix_list_ids, var.defaults.egress_with_prefix_list_ids, []) + egress_with_self = try(each.value.egress_with_self, var.defaults.egress_with_self, []) + egress_with_source_security_group_id = try(each.value.egress_with_source_security_group_id, var.defaults.egress_with_source_security_group_id, []) + ingress_cidr_blocks = try(each.value.ingress_cidr_blocks, var.defaults.ingress_cidr_blocks, []) + ingress_ipv6_cidr_blocks = try(each.value.ingress_ipv6_cidr_blocks, var.defaults.ingress_ipv6_cidr_blocks, []) + ingress_prefix_list_ids = try(each.value.ingress_prefix_list_ids, var.defaults.ingress_prefix_list_ids, []) + ingress_rules = try(each.value.ingress_rules, var.defaults.ingress_rules, []) + ingress_with_cidr_blocks = try(each.value.ingress_with_cidr_blocks, var.defaults.ingress_with_cidr_blocks, []) + ingress_with_ipv6_cidr_blocks = try(each.value.ingress_with_ipv6_cidr_blocks, var.defaults.ingress_with_ipv6_cidr_blocks, []) + ingress_with_prefix_list_ids = try(each.value.ingress_with_prefix_list_ids, var.defaults.ingress_with_prefix_list_ids, []) + ingress_with_self = try(each.value.ingress_with_self, var.defaults.ingress_with_self, []) + ingress_with_source_security_group_id = try(each.value.ingress_with_source_security_group_id, var.defaults.ingress_with_source_security_group_id, []) + name = try(each.value.name, var.defaults.name) + number_of_computed_egress_cidr_blocks = try(each.value.number_of_computed_egress_cidr_blocks, var.defaults.number_of_computed_egress_cidr_blocks, 0) + number_of_computed_egress_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_ipv6_cidr_blocks, 0) + number_of_computed_egress_prefix_list_ids = try(each.value.number_of_computed_egress_prefix_list_ids, var.defaults.number_of_computed_egress_prefix_list_ids, 0) + number_of_computed_egress_rules = try(each.value.number_of_computed_egress_rules, var.defaults.number_of_computed_egress_rules, 0) + number_of_computed_egress_with_cidr_blocks = try(each.value.number_of_computed_egress_with_cidr_blocks, var.defaults.number_of_computed_egress_with_cidr_blocks, 0) + number_of_computed_egress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_egress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_egress_with_ipv6_cidr_blocks, 0) + number_of_computed_egress_with_prefix_list_ids = try(each.value.number_of_computed_egress_with_prefix_list_ids, var.defaults.number_of_computed_egress_with_prefix_list_ids, 0) + number_of_computed_egress_with_self = try(each.value.number_of_computed_egress_with_self, var.defaults.number_of_computed_egress_with_self, 0) + number_of_computed_egress_with_source_security_group_id = try(each.value.number_of_computed_egress_with_source_security_group_id, var.defaults.number_of_computed_egress_with_source_security_group_id, 0) + number_of_computed_ingress_cidr_blocks = try(each.value.number_of_computed_ingress_cidr_blocks, var.defaults.number_of_computed_ingress_cidr_blocks, 0) + number_of_computed_ingress_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_ipv6_cidr_blocks, 0) + number_of_computed_ingress_prefix_list_ids = try(each.value.number_of_computed_ingress_prefix_list_ids, var.defaults.number_of_computed_ingress_prefix_list_ids, 0) + number_of_computed_ingress_rules = try(each.value.number_of_computed_ingress_rules, var.defaults.number_of_computed_ingress_rules, 0) + number_of_computed_ingress_with_cidr_blocks = try(each.value.number_of_computed_ingress_with_cidr_blocks, var.defaults.number_of_computed_ingress_with_cidr_blocks, 0) + number_of_computed_ingress_with_ipv6_cidr_blocks = try(each.value.number_of_computed_ingress_with_ipv6_cidr_blocks, var.defaults.number_of_computed_ingress_with_ipv6_cidr_blocks, 0) + number_of_computed_ingress_with_prefix_list_ids = try(each.value.number_of_computed_ingress_with_prefix_list_ids, var.defaults.number_of_computed_ingress_with_prefix_list_ids, 0) + number_of_computed_ingress_with_self = try(each.value.number_of_computed_ingress_with_self, var.defaults.number_of_computed_ingress_with_self, 0) + number_of_computed_ingress_with_source_security_group_id = try(each.value.number_of_computed_ingress_with_source_security_group_id, var.defaults.number_of_computed_ingress_with_source_security_group_id, 0) + revoke_rules_on_delete = try(each.value.revoke_rules_on_delete, var.defaults.revoke_rules_on_delete, false) + tags = try(each.value.tags, var.defaults.tags, {}) + use_name_prefix = try(each.value.use_name_prefix, var.defaults.use_name_prefix, true) + vpc_id = try(each.value.vpc_id, var.defaults.vpc_id) +} diff --git a/wrappers/zookeeper/outputs.tf b/wrappers/zookeeper/outputs.tf new file mode 100644 index 0000000..ec6da5f --- /dev/null +++ b/wrappers/zookeeper/outputs.tf @@ -0,0 +1,5 @@ +output "wrapper" { + description = "Map of outputs of a wrapper." + value = module.wrapper + # sensitive = false # No sensitive module output found +} diff --git a/wrappers/zookeeper/variables.tf b/wrappers/zookeeper/variables.tf new file mode 100644 index 0000000..a6ea096 --- /dev/null +++ b/wrappers/zookeeper/variables.tf @@ -0,0 +1,11 @@ +variable "defaults" { + description = "Map of default values which will be used for each item." + type = any + default = {} +} + +variable "items" { + description = "Maps of items to create a wrapper from. Values are passed through to the module." + type = any + default = {} +} diff --git a/wrappers/zookeeper/versions.tf b/wrappers/zookeeper/versions.tf new file mode 100644 index 0000000..c4f23b0 --- /dev/null +++ b/wrappers/zookeeper/versions.tf @@ -0,0 +1,10 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 3.29" + } + } +}