Skip to content

Commit

Permalink
chore: Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrauneck committed May 13, 2024
2 parents 3fd8e49 + 927c604 commit 0515417
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v1.2.0
rev: v3.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -32,24 +32,20 @@ repos:
args:
- -b main
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.0
rev: v1.89.1
hooks:
- id: terraform_fmt
- id: terraform_docs
args:
- --hook-config=--path-to-file=README.md
- --hook-config=--add-to-existing-file=true
- --hook-config=--create-file-if-not-exist=true
- repo: https://github.com/Checkmarx/kics
rev: v1.5.4
hooks:
- id: kics
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.13.0
rev: 0.28.3
hooks:
- id: check-github-workflows
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
rev: v4.0.0-alpha.8
hooks:
- id: prettier
stages: [commit]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Please be aware that this is mainly a copy operation which means all your curren

| Name | Source | Version |
|------|--------|---------|
| <a name="module_sg_endpoints"></a> [sg\_endpoints](#module\_sg\_endpoints) | git::github.com/xoap-io/terraform-aws-compute-security-group.git | n/a |
| <a name="module_this_label"></a> [this\_label](#module\_this\_label) | git::github.com/xoap-io/terraform-aws-misc-label | v0.1.0 |
| <a name="module_this_subnets"></a> [this\_subnets](#module\_this\_subnets) | ./modules/subnet | n/a |

Expand All @@ -137,13 +138,17 @@ Please be aware that this is mainly a copy operation which means all your curren
| [aws_vpc.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |
| [aws_vpc_dhcp_options.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_dhcp_options) | resource |
| [aws_vpc_dhcp_options_association.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_dhcp_options_association) | resource |
| [aws_vpc_endpoint.dynamodb](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource |
| [aws_vpc_endpoint.s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource |
| [aws_vpc_endpoint.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource |
| [aws_organizations_organization.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/organizations_organization) | data source |
| [aws_region.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_config"></a> [config](#input\_config) | Configuration parameters for the vpc. Per default the vpc is provisioned with the subnet cidr 10.10.0.0.0/16 and full dns support | <pre>object({<br> cidr = string<br> dns_support = bool<br> ipv6_support = bool<br> classic_link_support = bool<br> enable_nat_gateway = bool<br> nat_gateway_subnet = string<br> })</pre> | <pre>{<br> "cidr": "10.10.0.0/16",<br> "classic_link_support": false,<br> "dns_support": true,<br> "enable_nat_gateway": true,<br> "ipv6_support": false,<br> "nat_gateway_subnet": "public"<br>}</pre> | no |
| <a name="input_config"></a> [config](#input\_config) | Configuration parameters for the vpc. Per default the vpc is provisioned with the subnet cidr 10.10.0.0.0/16 and full dns support | <pre>object({<br> cidr = string<br> dns_support = bool<br> ipv6_support = bool<br> enable_nat_gateway = bool<br> nat_gateway_subnet = string<br> })</pre> | <pre>{<br> "cidr": "10.10.0.0/16",<br> "classic_link_support": false,<br> "dns_support": true,<br> "enable_nat_gateway": true,<br> "ipv6_support": false,<br> "nat_gateway_subnet": "public"<br>}</pre> | no |
| <a name="input_context"></a> [context](#input\_context) | Default context for naming and tagging purpose | <pre>object({<br> organization = string<br> environment = string<br> account = string<br> product = string<br> tags = map(string)<br> })</pre> | n/a | yes |
| <a name="input_dhcp_options"></a> [dhcp\_options](#input\_dhcp\_options) | Configuration parameters for dhcp. Per default this features are disabled | <pre>object({<br> domain_name = string<br> domain_name_servers = list(string)<br> ntp_servers = list(string)<br> netbios_name_servers = list(string)<br> netbios_node_type = string<br> })</pre> | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | Name of the vpc to create | `string` | n/a | yes |
Expand All @@ -166,6 +171,7 @@ Please be aware that this is mainly a copy operation which means all your curren
| <a name="output_subnet_cidrs"></a> [subnet\_cidrs](#output\_subnet\_cidrs) | list of all associated subnet cidrs |
| <a name="output_subnet_ids"></a> [subnet\_ids](#output\_subnet\_ids) | map of output from resource aws\_subnet according to https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet |
| <a name="output_subnets"></a> [subnets](#output\_subnets) | map of output from resource aws\_subnet according to https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet |
| <a name="output_temp"></a> [temp](#output\_temp) | n/a |
| <a name="output_transit_gateway_routes"></a> [transit\_gateway\_routes](#output\_transit\_gateway\_routes) | map of output from resource aws\_subnet according to https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet |
| <a name="output_vpc"></a> [vpc](#output\_vpc) | Map of aws\_vpc according to https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Expand Down
30 changes: 15 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ module "sg_endpoints" {
}
}
locals {
routes_services = toset([ "ecr.dkr", "ecr.api" ])
all_non_public_subnet_ids = setproduct(flatten([for k, v in module.this_subnets : v.all_subnet_ids if v.operation_mode != "public" ]), [for k,v in aws_vpc_endpoint.this : v.id])
routes_services = toset(["ecr.dkr", "ecr.api"])
all_non_public_subnet_ids = setproduct(flatten([for k, v in module.this_subnets : v.all_subnet_ids if v.operation_mode != "public"]), [for k, v in aws_vpc_endpoint.this : v.id])
}
resource "aws_vpc_endpoint" "this" {
for_each = local.routes_services
for_each = local.routes_services
private_dns_enabled = true
service_name = join(".", ["com.amazonaws", data.aws_region.this.name, each.key])
vpc_endpoint_type = "Interface"
Expand All @@ -182,15 +182,15 @@ resource "aws_vpc_endpoint" "this" {
]
subnet_ids = module.this_subnets["public"].all_subnet_ids
}
resource aws_vpc_endpoint "s3"{
vpc_id = aws_vpc.this.id
service_name = "com.amazonaws.${data.aws_region.this.name}.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = [for k, v in module.this_subnets : v.route_table.id if v.operation_mode != "public" ]
}
resource aws_vpc_endpoint "dynamodb"{
vpc_id = aws_vpc.this.id
service_name = "com.amazonaws.${data.aws_region.this.name}.dynamodb"
vpc_endpoint_type = "Gateway"
route_table_ids = [for k, v in module.this_subnets : v.route_table.id if v.operation_mode != "public" ]
}
resource "aws_vpc_endpoint" "s3" {
vpc_id = aws_vpc.this.id
service_name = "com.amazonaws.${data.aws_region.this.name}.s3"
vpc_endpoint_type = "Gateway"
route_table_ids = [for k, v in module.this_subnets : v.route_table.id if v.operation_mode != "public"]
}
resource "aws_vpc_endpoint" "dynamodb" {
vpc_id = aws_vpc.this.id
service_name = "com.amazonaws.${data.aws_region.this.name}.dynamodb"
vpc_endpoint_type = "Gateway"
route_table_ids = [for k, v in module.this_subnets : v.route_table.id if v.operation_mode != "public"]
}
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ output "transit_gateway_routes" {

output "temp" {
value = local.all_non_public_subnet_ids
}
}
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ variable "name" {

variable "config" {
type = object({
cidr = string
dns_support = bool
ipv6_support = bool
enable_nat_gateway = bool
nat_gateway_subnet = string
cidr = string
dns_support = bool
ipv6_support = bool
enable_nat_gateway = bool
nat_gateway_subnet = string
})
default = {
cidr = "10.10.0.0/16"
Expand Down

0 comments on commit 0515417

Please sign in to comment.