You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/vpc-endpoint-consumer/README.md
+94-2Lines changed: 94 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,86 @@
1
1
# VPC Endpoint Consumer Module
2
2
3
+
This module creates VPC interface endpoints to connect to partner MPC services and optionally creates Kubernetes services for easy consumption within an EKS cluster.
4
+
5
+
## Features
6
+
7
+
-**VPC Interface Endpoints**: Create VPC endpoints to privately connect to partner services
8
+
-**Kubernetes Service Integration**: Automatically create Kubernetes ExternalName services pointing to VPC endpoints
9
+
-**Security Group Management**: Option to create a security group with default ingress rules or use existing security groups
10
+
-**Custom DNS**: Optional Route53 private hosted zone records for custom DNS names
11
+
-**S3 Bucket Sync**: Sync public buckets between partners for data exchange
12
+
13
+
## Usage
14
+
15
+
### Basic Usage with Auto-Created Security Group
16
+
17
+
```terraform
18
+
module "vpc_endpoint_consumer" {
19
+
source = "./modules/vpc-endpoint-consumer"
20
+
21
+
cluster_name = "my-eks-cluster"
22
+
23
+
# Create a security group with default ingress rules
24
+
create_security_group = true
25
+
security_group_name = "mpc-vpc-endpoint-sg"
26
+
27
+
# Default ingress rules allow traffic on gRPC (50100), peer (50001), and metrics (9646) ports
28
+
# You can customize these rules using security_group_ingress_rules variable
When `create_security_group = true`, the module automatically creates ingress rules based on the `default_mpc_ports` configuration:
68
+
69
+
-**gRPC Port (50100)**: Created only if `enable_grpc_port = true` (default)
70
+
-**Peer Port (50001)**: Always created
71
+
-**Metrics Port (9646)**: Always created
72
+
73
+
The module automatically adds a default egress rule that allows all outbound traffic (0.0.0.0/0).
74
+
75
+
### Customizing Ingress Rules
76
+
77
+
You can customize who can access the VPC endpoints using:
78
+
79
+
-**`security_group_ingress_cidr_blocks`**: List of CIDR blocks to allow (default: `["0.0.0.0/0"]`)
80
+
-**`security_group_ingress_source_sg_id`**: Source security group ID (takes precedence over CIDR blocks)
81
+
82
+
The ports used for ingress rules are automatically derived from `default_mpc_ports`, ensuring consistency between your Kubernetes services and security group rules.
| <aname="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name)| Name of the EKS cluster to lookup VPC, subnet, and security group details (Mode 1). If provided, vpc\_id, subnet\_ids, and security\_group\_ids will be ignored. |`string`|`null`| no |
44
128
| <aname="input_create_custom_dns_records"></a> [create\_custom\_dns\_records](#input\_create\_custom\_dns\_records)| Whether to create custom DNS records for the VPC interface endpoints |`bool`|`false`| no |
45
129
| <aname="input_create_namespace"></a> [create\_namespace](#input\_create\_namespace)| Whether to create the namespace if it doesn't exist |`bool`|`false`| no |
130
+
| <aname="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group)| Whether to create a security group for VPC endpoints with default ingress rules |`bool`|`true`| no |
46
131
| <a name="input_default_mpc_ports"></a> [default\_mpc\_ports](#input\_default\_mpc\_ports) | Default port configurations for MPC services. These can be overridden per service in party\_services configuration. | <pre>object({<br/> grpc = object({<br/> name = string<br/> port = number<br/> target_port = number<br/> protocol = string<br/> })<br/> peer = object({<br/> name = string<br/> port = number<br/> target_port = number<br/> protocol = string<br/> })<br/> metrics = object({<br/> name = string<br/> port = number<br/> target_port = number<br/> protocol = string<br/> })<br/> })</pre> | <pre>{<br/> "grpc": {<br/> "name": "grpc",<br/> "port": 50100,<br/> "protocol": "TCP",<br/> "target_port": 50100<br/> },<br/> "metrics": {<br/> "name": "metrics",<br/> "port": 9646,<br/> "protocol": "TCP",<br/> "target_port": 9646<br/> },<br/> "peer": {<br/> "name": "peer",<br/> "port": 50001,<br/> "protocol": "TCP",<br/> "target_port": 50001<br/> }<br/>}</pre> | no |
47
132
| <aname="input_dns_domain"></a> [dns\_domain](#input\_dns\_domain)| DNS domain for custom DNS records |`string`|`"mpc-partners.local"`| no |
48
133
| <aname="input_enable_grpc_port"></a> [enable\_grpc\_port](#input\_enable\_grpc\_port)| Whether to enable and expose the gRPC port in the load balancer service |`bool`|`true`| no |
49
134
| <aname="input_endpoint_create_timeout"></a> [endpoint\_create\_timeout](#input\_endpoint\_create\_timeout)| Timeout for creating VPC interface endpoints |`string`|`"10m"`| no |
50
135
| <aname="input_endpoint_delete_timeout"></a> [endpoint\_delete\_timeout](#input\_endpoint\_delete\_timeout)| Timeout for deleting VPC interface endpoints |`string`|`"10m"`| no |
51
136
| <aname="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix)| Prefix for naming VPC interface endpoint resources |`string`|`"mpc-partner"`| no |
52
137
| <aname="input_namespace"></a> [namespace](#input\_namespace)| Kubernetes namespace where partner services will be created |`string`|`"kms-decentralized"`| no |
| <aname="input_private_dns_enabled"></a> [private\_dns\_enabled](#input\_private\_dns\_enabled)| Whether to enable private DNS for the VPC interface endpoints |`bool`|`false`| no |
55
140
| <aname="input_private_zone_id"></a> [private\_zone\_id](#input\_private\_zone\_id)| Route53 private hosted zone ID for custom DNS records |`string`|`""`| no |
56
141
| <aname="input_route_table_ids"></a> [route\_table\_ids](#input\_route\_table\_ids)| List of route table IDs to associate with the VPC interface endpoints |`list(string)`|`[]`| no |
57
-
| <aname="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids)| List of security group IDs to associate with the VPC interface endpoints (Mode 2). Required if cluster\_name is not provided. |`list(string)`|`null`| no |
142
+
| <aname="input_security_group_description"></a> [security\_group\_description](#input\_security\_group\_description)| Description for the security group |`string`|`"Security group for MPC VPC endpoint consumer"`| no |
143
+
| <aname="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids)| List of security group IDs to associate with the VPC interface endpoints (Mode 2). Required if cluster\_name is not provided and create\_security\_group is false. |`list(string)`|`null`| no |
144
+
| <aname="input_security_group_ingress_cidr_blocks"></a> [security\_group\_ingress\_cidr\_blocks](#input\_security\_group\_ingress\_cidr\_blocks)| CIDR blocks to allow ingress traffic from for MPC ports (when create\_security\_group is true) |`list(string)`| <pre>[<br/> "0.0.0.0/0"<br/>]</pre> | no |
145
+
| <aname="input_security_group_ingress_source_sg_id"></a> [security\_group\_ingress\_source\_sg\_id](#input\_security\_group\_ingress\_source\_sg\_id)| Source security group ID to allow ingress traffic from for MPC ports (when create\_security\_group is true). If set, this takes precedence over cidr\_blocks. |`string`|`null`| no |
146
+
| <aname="input_security_group_name"></a> [security\_group\_name](#input\_security\_group\_name)| Name of the security group to create (if create\_security\_group is true) |`string`|`"mpc-vpc-endpoint-consumer-sg"`| no |
58
147
| <aname="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids)| List of subnet IDs where the VPC interface endpoints will be created (Mode 2). Required if cluster\_name is not provided. |`list(string)`|`null`| no |
59
148
| <aname="input_sync_public_bucket"></a> [sync\_public\_bucket](#input\_sync\_public\_bucket)| Sync public bucket between partners | <pre>object({<br/> enabled = optional(bool, true)<br/> configmap_name = optional(string, "mpc-party")<br/> })</pre> | <pre>{<br/> "configmap_name": "mpc-party",<br/> "enabled": true<br/>}</pre> | no |
60
149
| <aname="input_tags"></a> [tags](#input\_tags)| Tags to apply to VPC interface endpoint resources |`map(string)`|`{}`| no |
@@ -72,6 +161,9 @@ No modules.
72
161
| <aname="output_namespace_name"></a> [namespace\_name](#output\_namespace\_name)| Name of the namespace where partner services are deployed |
73
162
| <aname="output_partner_connection_endpoints"></a> [partner\_connection\_endpoints](#output\_partner\_connection\_endpoints)| Connection endpoints for applications to use when connecting to partner services |
74
163
| <aname="output_partner_service_details"></a> [partner\_service\_details](#output\_partner\_service\_details)| Detailed information about the partner services and their connections |
164
+
| <aname="output_security_group_arn"></a> [security\_group\_arn](#output\_security\_group\_arn)| ARN of the created security group (if create\_security\_group is true) |
165
+
| <aname="output_security_group_id"></a> [security\_group\_id](#output\_security\_group\_id)| ID of the created security group (if create\_security\_group is true) |
166
+
| <aname="output_security_group_name"></a> [security\_group\_name](#output\_security\_group\_name)| Name of the created security group (if create\_security\_group is true) |
75
167
| <aname="output_vpc_interface_endpoint_dns_names"></a> [vpc\_interface\_endpoint\_dns\_names](#output\_vpc\_interface\_endpoint\_dns\_names)| DNS names of the created VPC interface endpoints |
76
168
| <aname="output_vpc_interface_endpoint_hosted_zone_ids"></a> [vpc\_interface\_endpoint\_hosted\_zone\_ids](#output\_vpc\_interface\_endpoint\_hosted\_zone\_ids)| Hosted zone IDs of the created VPC interface endpoints |
77
169
| <aname="output_vpc_interface_endpoint_ids"></a> [vpc\_interface\_endpoint\_ids](#output\_vpc\_interface\_endpoint\_ids)| IDs of the created VPC interface endpoints |
0 commit comments