Skip to content

Commit 16d5f0e

Browse files
wardviaeneantonbabenko
authored andcommitted
Added Kinesis streams and firehose VPC endpoints (#301)
1 parent 1d5f04c commit 16d5f0e

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
294294
| enable\_ecs\_telemetry\_endpoint | Should be true if you want to provision a ECS Telemetry endpoint to the VPC | bool | `"false"` | no |
295295
| enable\_elasticloadbalancing\_endpoint | Should be true if you want to provision a Elastic Load Balancing endpoint to the VPC | bool | `"false"` | no |
296296
| enable\_events\_endpoint | Should be true if you want to provision a CloudWatch Events endpoint to the VPC | bool | `"false"` | no |
297+
| enable\_kinesis\_firehose\_endpoint | Should be true if you want to provision a Kinesis Firehose endpoint to the VPC | bool | `"false"` | no |
298+
| enable\_kinesis\_streams\_endpoint | Should be true if you want to provision a Kinesis Streams endpoint to the VPC | bool | `"false"` | no |
297299
| enable\_kms\_endpoint | Should be true if you want to provision a KMS endpoint to the VPC | bool | `"false"` | no |
298300
| enable\_logs\_endpoint | Should be true if you want to provision a CloudWatch Logs endpoint to the VPC | bool | `"false"` | no |
299301
| enable\_monitoring\_endpoint | Should be true if you want to provision a CloudWatch Monitoring endpoint to the VPC | bool | `"false"` | no |
@@ -319,6 +321,12 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
319321
| intra\_subnet\_suffix | Suffix to append to intra subnets name | string | `"intra"` | no |
320322
| intra\_subnet\_tags | Additional tags for the intra subnets | map(string) | `{}` | no |
321323
| intra\_subnets | A list of intra subnets | list(string) | `[]` | no |
324+
| kinesis\_firehose\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for Kinesis Firehose endpoint | bool | `"false"` | no |
325+
| kinesis\_firehose\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for Kinesis Firehose endpoint | list(string) | `[]` | no |
326+
| kinesis\_firehose\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for Kinesis Firehose endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | list(string) | `[]` | no |
327+
| kinesis\_streams\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for Kinesis Streams endpoint | bool | `"false"` | no |
328+
| kinesis\_streams\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for Kinesis Streams endpoint | list(string) | `[]` | no |
329+
| kinesis\_streams\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for Kinesis Streams endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | list(string) | `[]` | no |
322330
| kms\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for KMS endpoint | bool | `"false"` | no |
323331
| kms\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for KMS endpoint | list(string) | `[]` | no |
324332
| kms\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for KMS endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | list(string) | `[]` | no |

main.tf

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,50 @@ resource "aws_vpc_endpoint" "cloudtrail" {
12861286
}
12871287

12881288

1289+
#######################
1290+
# VPC Endpoint for Kinesis Streams
1291+
#######################
1292+
data "aws_vpc_endpoint_service" "kinesis_streams" {
1293+
count = var.create_vpc && var.enable_kinesis_streams_endpoint ? 1 : 0
1294+
1295+
service = "kinesis-streams"
1296+
}
1297+
1298+
resource "aws_vpc_endpoint" "kinesis_streams" {
1299+
count = var.create_vpc && var.enable_kinesis_streams_endpoint ? 1 : 0
1300+
1301+
vpc_id = local.vpc_id
1302+
service_name = data.aws_vpc_endpoint_service.kinesis_streams[0].service_name
1303+
vpc_endpoint_type = "Interface"
1304+
1305+
security_group_ids = var.kinesis_streams_endpoint_security_group_ids
1306+
subnet_ids = coalescelist(var.kinesis_streams_endpoint_subnet_ids, aws_subnet.private.*.id)
1307+
private_dns_enabled = var.kinesis_streams_endpoint_private_dns_enabled
1308+
}
1309+
1310+
1311+
#######################
1312+
# VPC Endpoint for Kinesis Firehose
1313+
#######################
1314+
data "aws_vpc_endpoint_service" "kinesis_firehose" {
1315+
count = var.create_vpc && var.enable_kinesis_firehose_endpoint ? 1 : 0
1316+
1317+
service = "kinesis-firehose"
1318+
}
1319+
1320+
resource "aws_vpc_endpoint" "kinesis_firehose" {
1321+
count = var.create_vpc && var.enable_kinesis_firehose_endpoint ? 1 : 0
1322+
1323+
vpc_id = local.vpc_id
1324+
service_name = data.aws_vpc_endpoint_service.kinesis_firehose[0].service_name
1325+
vpc_endpoint_type = "Interface"
1326+
1327+
security_group_ids = var.kinesis_firehose_endpoint_security_group_ids
1328+
subnet_ids = coalescelist(var.kinesis_firehose_endpoint_subnet_ids, aws_subnet.private.*.id)
1329+
private_dns_enabled = var.kinesis_firehose_endpoint_private_dns_enabled
1330+
}
1331+
1332+
12891333
##########################
12901334
# Route table association
12911335
##########################

variables.tf

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,54 @@ variable "cloudtrail_endpoint_private_dns_enabled" {
646646
default = false
647647
}
648648

649+
variable "enable_kinesis_streams_endpoint" {
650+
description = "Should be true if you want to provision a Kinesis Streams endpoint to the VPC"
651+
type = bool
652+
default = false
653+
}
654+
655+
variable "kinesis_streams_endpoint_security_group_ids" {
656+
description = "The ID of one or more security groups to associate with the network interface for Kinesis Streams endpoint"
657+
type = list(string)
658+
default = []
659+
}
660+
661+
variable "kinesis_streams_endpoint_subnet_ids" {
662+
description = "The ID of one or more subnets in which to create a network interface for Kinesis Streams endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used."
663+
type = list(string)
664+
default = []
665+
}
666+
667+
variable "kinesis_streams_endpoint_private_dns_enabled" {
668+
description = "Whether or not to associate a private hosted zone with the specified VPC for Kinesis Streams endpoint"
669+
type = bool
670+
default = false
671+
}
672+
673+
variable "enable_kinesis_firehose_endpoint" {
674+
description = "Should be true if you want to provision a Kinesis Firehose endpoint to the VPC"
675+
type = bool
676+
default = false
677+
}
678+
679+
variable "kinesis_firehose_endpoint_security_group_ids" {
680+
description = "The ID of one or more security groups to associate with the network interface for Kinesis Firehose endpoint"
681+
type = list(string)
682+
default = []
683+
}
684+
685+
variable "kinesis_firehose_endpoint_subnet_ids" {
686+
description = "The ID of one or more subnets in which to create a network interface for Kinesis Firehose endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used."
687+
type = list(string)
688+
default = []
689+
}
690+
691+
variable "kinesis_firehose_endpoint_private_dns_enabled" {
692+
description = "Whether or not to associate a private hosted zone with the specified VPC for Kinesis Firehose endpoint"
693+
type = bool
694+
default = false
695+
}
696+
649697
variable "map_public_ip_on_launch" {
650698
description = "Should be false if you do not want to auto-assign public IP on launch"
651699
type = bool

0 commit comments

Comments
 (0)