diff --git a/terraform-modules/aws/vpc-endpoint/README.md b/terraform-modules/aws/vpc-endpoint/README.md new file mode 100644 index 000000000..021852065 --- /dev/null +++ b/terraform-modules/aws/vpc-endpoint/README.md @@ -0,0 +1,34 @@ +## Requirements + +No requirements. + +## Providers + +| Name | Version | +|------|---------| +| [aws](#provider\_aws) | n/a | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_vpc_endpoint.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [service\_name](#input\_service\_name) | The service name for the VPC endpoint | `any` | n/a | yes | +| [vpc\_endpoint\_type](#input\_vpc\_endpoint\_type) | The type of VPC endpoint to create | `any` | n/a | yes | +| [vpc\_id](#input\_vpc\_id) | The ID of the VPC in which to create the VPC endpoint | `any` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [dns\_entry](#output\_dns\_entry) | Represents the fully qualified domain name (FQDN) of the VPC endpoint. | +| [dns\_name](#output\_dns\_name) | Represents the DNS name for the VPC endpoint service. | diff --git a/terraform-modules/aws/vpc-endpoint/main.tf b/terraform-modules/aws/vpc-endpoint/main.tf new file mode 100644 index 000000000..6f20b1bb3 --- /dev/null +++ b/terraform-modules/aws/vpc-endpoint/main.tf @@ -0,0 +1,9 @@ +resource "aws_vpc_endpoint" "this" { + count = var.exists == true ? 1 : 0 + vpc_id = var.vpc_id + service_name = var.service_name + vpc_endpoint_type = var.vpc_endpoint_type + private_dns_enabled = true +} + + diff --git a/terraform-modules/aws/vpc-endpoint/outputs.tf b/terraform-modules/aws/vpc-endpoint/outputs.tf new file mode 100644 index 000000000..eee6bbbff --- /dev/null +++ b/terraform-modules/aws/vpc-endpoint/outputs.tf @@ -0,0 +1,9 @@ +output "dns_entry" { + value = aws_vpc_endpoint.this[0].dns_entry + description = "Represents the fully qualified domain name (FQDN) of the VPC endpoint." +} + +output "dns_name" { + value = aws_vpc_endpoint.this[0].dns_name + description = "Represents the DNS name for the VPC endpoint service." +} \ No newline at end of file diff --git a/terraform-modules/aws/vpc-endpoint/variables.tf b/terraform-modules/aws/vpc-endpoint/variables.tf new file mode 100644 index 000000000..4d97aa9eb --- /dev/null +++ b/terraform-modules/aws/vpc-endpoint/variables.tf @@ -0,0 +1,11 @@ +variable "vpc_id" { + description = "The ID of the VPC in which to create the VPC endpoint" +} + +variable "service_name" { + description = "The service name for the VPC endpoint" +} + +variable "vpc_endpoint_type" { + description = "The type of VPC endpoint to create" +}