Skip to content

Commit b874b38

Browse files
authored
fix: Split appstream to appstream_api and appstream_streaming (#508)
1 parent 4d50607 commit b874b38

File tree

4 files changed

+103
-35
lines changed

4 files changed

+103
-35
lines changed

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ These types of resources are supported:
2323
ECS, ECS Agent, ECS Telemetry, SES, SNS, STS, Glue, CloudWatch(Monitoring, Logs, Events),
2424
Elastic Load Balancing, CloudTrail, Secrets Manager, Config, CodeBuild, CodeCommit,
2525
Git-Codecommit, Transfer Server, Kinesis Streams, Kinesis Firehose, SageMaker(Notebook, Runtime, API),
26-
CloudFormation, CodePipeline, Storage Gateway, AppMesh, Transfer, Service Catalog, AppStream,
26+
CloudFormation, CodePipeline, Storage Gateway, AppMesh, Transfer, Service Catalog, AppStream API, AppStream Streaming,
2727
Athena, Rekognition, Elastic File System (EFS), Cloud Directory, Elastic Beanstalk (+ Health), Elastic Map Reduce(EMR),
2828
DataSync, EBS, SMS, Elastic Inference Runtime, QLDB Session, Step Functions, Access Analyzer, Auto Scaling Plans,
2929
Application Auto Scaling, Workspaces, ACM PCA, RDS, CodeDeploy, CodeDeploy Commands Secure
@@ -250,9 +250,12 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
250250
| appmesh\_envoy\_management\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for AppMesh endpoint | `bool` | `false` | no |
251251
| appmesh\_envoy\_management\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for AppMesh endpoint | `list(string)` | `[]` | no |
252252
| appmesh\_envoy\_management\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for AppMesh endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
253-
| appstream\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for AppStream endpoint | `bool` | `false` | no |
254-
| appstream\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for AppStream endpoint | `list(string)` | `[]` | no |
255-
| appstream\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for AppStream endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
253+
| appstream\_api\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for AppStream API endpoint | `bool` | `false` | no |
254+
| appstream\_api\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for AppStream API endpoint | `list(string)` | `[]` | no |
255+
| appstream\_api\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for AppStream API endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
256+
| appstream\_streaming\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for AppStream Streaming endpoint | `bool` | `false` | no |
257+
| appstream\_streaming\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for AppStream Streaming endpoint | `list(string)` | `[]` | no |
258+
| appstream\_streaming\_endpoint\_subnet\_ids | The ID of one or more subnets in which to create a network interface for AppStream Streaming endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used. | `list(string)` | `[]` | no |
256259
| assign\_ipv6\_address\_on\_creation | Assign IPv6 address on subnet, must be disabled to change IPv6 CIDRs. This is the IPv6 equivalent of map\_public\_ip\_on\_launch | `bool` | `false` | no |
257260
| athena\_endpoint\_private\_dns\_enabled | Whether or not to associate a private hosted zone with the specified VPC for Athena endpoint | `bool` | `false` | no |
258261
| athena\_endpoint\_security\_group\_ids | The ID of one or more security groups to associate with the network interface for Athena endpoint | `list(string)` | `[]` | no |
@@ -396,7 +399,8 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
396399
| enable\_acm\_pca\_endpoint | Should be true if you want to provision an ACM PCA endpoint to the VPC | `bool` | `false` | no |
397400
| enable\_apigw\_endpoint | Should be true if you want to provision an api gateway endpoint to the VPC | `bool` | `false` | no |
398401
| enable\_appmesh\_envoy\_management\_endpoint | Should be true if you want to provision a AppMesh endpoint to the VPC | `bool` | `false` | no |
399-
| enable\_appstream\_endpoint | Should be true if you want to provision a AppStream endpoint to the VPC | `bool` | `false` | no |
402+
| enable\_appstream\_api\_endpoint | Should be true if you want to provision a AppStream API endpoint to the VPC | `bool` | `false` | no |
403+
| enable\_appstream\_streaming\_endpoint | Should be true if you want to provision a AppStream Streaming endpoint to the VPC | `bool` | `false` | no |
400404
| enable\_athena\_endpoint | Should be true if you want to provision a Athena endpoint to the VPC | `bool` | `false` | no |
401405
| enable\_auto\_scaling\_plans\_endpoint | Should be true if you want to provision an Auto Scaling Plans endpoint to the VPC | `bool` | `false` | no |
402406
| enable\_classiclink | Should be true to enable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. | `bool` | `null` | no |
@@ -732,9 +736,12 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
732736
| vpc\_endpoint\_appmesh\_envoy\_management\_dns\_entry | The DNS entries for the VPC Endpoint for AppMesh. |
733737
| vpc\_endpoint\_appmesh\_envoy\_management\_id | The ID of VPC endpoint for AppMesh |
734738
| vpc\_endpoint\_appmesh\_envoy\_management\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for AppMesh. |
735-
| vpc\_endpoint\_appstream\_dns\_entry | The DNS entries for the VPC Endpoint for AppStream. |
736-
| vpc\_endpoint\_appstream\_id | The ID of VPC endpoint for AppStream |
737-
| vpc\_endpoint\_appstream\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for AppStream. |
739+
| vpc\_endpoint\_appstream\_api\_dns\_entry | The DNS entries for the VPC Endpoint for AppStream API. |
740+
| vpc\_endpoint\_appstream\_api\_id | The ID of VPC endpoint for AppStream API |
741+
| vpc\_endpoint\_appstream\_api\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for AppStream API. |
742+
| vpc\_endpoint\_appstream\_streaming\_dns\_entry | The DNS entries for the VPC Endpoint for AppStream Streaming. |
743+
| vpc\_endpoint\_appstream\_streaming\_id | The ID of VPC endpoint for AppStream Streaming |
744+
| vpc\_endpoint\_appstream\_streaming\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for AppStream Streaming. |
738745
| vpc\_endpoint\_athena\_dns\_entry | The DNS entries for the VPC Endpoint for Athena. |
739746
| vpc\_endpoint\_athena\_id | The ID of VPC endpoint for Athena |
740747
| vpc\_endpoint\_athena\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Athena. |

outputs.tf

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,19 +1047,34 @@ output "vpc_endpoint_sagemaker_runtime_dns_entry" {
10471047
value = flatten(aws_vpc_endpoint.sagemaker_runtime.*.dns_entry)
10481048
}
10491049

1050-
output "vpc_endpoint_appstream_id" {
1051-
description = "The ID of VPC endpoint for AppStream"
1052-
value = concat(aws_vpc_endpoint.appstream.*.id, [""])[0]
1050+
output "vpc_endpoint_appstream_api_id" {
1051+
description = "The ID of VPC endpoint for AppStream API"
1052+
value = concat(aws_vpc_endpoint.appstream_api.*.id, [""])[0]
10531053
}
10541054

1055-
output "vpc_endpoint_appstream_network_interface_ids" {
1056-
description = "One or more network interfaces for the VPC Endpoint for AppStream."
1057-
value = flatten(aws_vpc_endpoint.appstream.*.network_interface_ids)
1055+
output "vpc_endpoint_appstream_api_network_interface_ids" {
1056+
description = "One or more network interfaces for the VPC Endpoint for AppStream API."
1057+
value = flatten(aws_vpc_endpoint.appstream_api.*.network_interface_ids)
10581058
}
10591059

1060-
output "vpc_endpoint_appstream_dns_entry" {
1061-
description = "The DNS entries for the VPC Endpoint for AppStream."
1062-
value = flatten(aws_vpc_endpoint.appstream.*.dns_entry)
1060+
output "vpc_endpoint_appstream_api_dns_entry" {
1061+
description = "The DNS entries for the VPC Endpoint for AppStream API."
1062+
value = flatten(aws_vpc_endpoint.appstream_api.*.dns_entry)
1063+
}
1064+
1065+
output "vpc_endpoint_appstream_streaming_id" {
1066+
description = "The ID of VPC endpoint for AppStream Streaming"
1067+
value = concat(aws_vpc_endpoint.appstream_streaming.*.id, [""])[0]
1068+
}
1069+
1070+
output "vpc_endpoint_appstream_streaming_network_interface_ids" {
1071+
description = "One or more network interfaces for the VPC Endpoint for AppStream Streaming."
1072+
value = flatten(aws_vpc_endpoint.appstream_streaming.*.network_interface_ids)
1073+
}
1074+
1075+
output "vpc_endpoint_appstream_streaming_dns_entry" {
1076+
description = "The DNS entries for the VPC Endpoint for AppStream Streaming."
1077+
value = flatten(aws_vpc_endpoint.appstream_streaming.*.dns_entry)
10631078
}
10641079

10651080
output "vpc_endpoint_athena_id" {

variables.tf

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,26 +1235,50 @@ variable "sagemaker_runtime_endpoint_private_dns_enabled" {
12351235
default = false
12361236
}
12371237

1238-
variable "enable_appstream_endpoint" {
1239-
description = "Should be true if you want to provision a AppStream endpoint to the VPC"
1238+
variable "enable_appstream_api_endpoint" {
1239+
description = "Should be true if you want to provision a AppStream API endpoint to the VPC"
12401240
type = bool
12411241
default = false
12421242
}
12431243

1244-
variable "appstream_endpoint_security_group_ids" {
1245-
description = "The ID of one or more security groups to associate with the network interface for AppStream endpoint"
1244+
variable "appstream_api_endpoint_security_group_ids" {
1245+
description = "The ID of one or more security groups to associate with the network interface for AppStream API endpoint"
12461246
type = list(string)
12471247
default = []
12481248
}
12491249

1250-
variable "appstream_endpoint_subnet_ids" {
1251-
description = "The ID of one or more subnets in which to create a network interface for AppStream endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used."
1250+
variable "appstream_api_endpoint_subnet_ids" {
1251+
description = "The ID of one or more subnets in which to create a network interface for AppStream API endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used."
12521252
type = list(string)
12531253
default = []
12541254
}
12551255

1256-
variable "appstream_endpoint_private_dns_enabled" {
1257-
description = "Whether or not to associate a private hosted zone with the specified VPC for AppStream endpoint"
1256+
variable "appstream_api_endpoint_private_dns_enabled" {
1257+
description = "Whether or not to associate a private hosted zone with the specified VPC for AppStream API endpoint"
1258+
type = bool
1259+
default = false
1260+
}
1261+
1262+
variable "enable_appstream_streaming_endpoint" {
1263+
description = "Should be true if you want to provision a AppStream Streaming endpoint to the VPC"
1264+
type = bool
1265+
default = false
1266+
}
1267+
1268+
variable "appstream_streaming_endpoint_security_group_ids" {
1269+
description = "The ID of one or more security groups to associate with the network interface for AppStream Streaming endpoint"
1270+
type = list(string)
1271+
default = []
1272+
}
1273+
1274+
variable "appstream_streaming_endpoint_subnet_ids" {
1275+
description = "The ID of one or more subnets in which to create a network interface for AppStream Streaming endpoint. Only a single subnet within an AZ is supported. If omitted, private subnets will be used."
1276+
type = list(string)
1277+
default = []
1278+
}
1279+
1280+
variable "appstream_streaming_endpoint_private_dns_enabled" {
1281+
description = "Whether or not to associate a private hosted zone with the specified VPC for AppStream Streaming endpoint"
12581282
type = bool
12591283
default = false
12601284
}

vpc-endpoints.tf

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -916,24 +916,46 @@ resource "aws_vpc_endpoint" "sagemaker_runtime" {
916916
}
917917

918918
#############################
919-
# VPC Endpoint for AppStream
919+
# VPC Endpoint for AppStream API
920920
#############################
921-
data "aws_vpc_endpoint_service" "appstream" {
922-
count = var.create_vpc && var.enable_appstream_endpoint ? 1 : 0
921+
data "aws_vpc_endpoint_service" "appstream_api" {
922+
count = var.create_vpc && var.enable_appstream_streaming_endpoint ? 1 : 0
923923

924-
service = "appstream"
924+
service = "appstream.api"
925925
}
926926

927-
resource "aws_vpc_endpoint" "appstream" {
928-
count = var.create_vpc && var.enable_appstream_endpoint ? 1 : 0
927+
resource "aws_vpc_endpoint" "appstream_api" {
928+
count = var.create_vpc && var.enable_appstream_api_endpoint ? 1 : 0
929929

930930
vpc_id = local.vpc_id
931-
service_name = data.aws_vpc_endpoint_service.appstream[0].service_name
931+
service_name = data.aws_vpc_endpoint_service.appstream_api[0].service_name
932932
vpc_endpoint_type = "Interface"
933933

934-
security_group_ids = var.appstream_endpoint_security_group_ids
935-
subnet_ids = coalescelist(var.appstream_endpoint_subnet_ids, aws_subnet.private.*.id)
936-
private_dns_enabled = var.appstream_endpoint_private_dns_enabled
934+
security_group_ids = var.appstream_api_endpoint_security_group_ids
935+
subnet_ids = coalescelist(var.appstream_api_endpoint_subnet_ids, aws_subnet.private.*.id)
936+
private_dns_enabled = var.appstream_api_endpoint_private_dns_enabled
937+
tags = local.vpce_tags
938+
}
939+
940+
#############################
941+
# VPC Endpoint for AppStream STREAMING
942+
#############################
943+
data "aws_vpc_endpoint_service" "appstream_streaming" {
944+
count = var.create_vpc && var.enable_appstream_streaming_endpoint ? 1 : 0
945+
946+
service = "appstream.streaming"
947+
}
948+
949+
resource "aws_vpc_endpoint" "appstream_streaming" {
950+
count = var.create_vpc && var.enable_appstream_streaming_endpoint ? 1 : 0
951+
952+
vpc_id = local.vpc_id
953+
service_name = data.aws_vpc_endpoint_service.appstream_streaming[0].service_name
954+
vpc_endpoint_type = "Interface"
955+
956+
security_group_ids = var.appstream_streaming_endpoint_security_group_ids
957+
subnet_ids = coalescelist(var.appstream_streaming_endpoint_subnet_ids, aws_subnet.private.*.id)
958+
private_dns_enabled = var.appstream_streaming_endpoint_private_dns_enabled
937959
tags = local.vpce_tags
938960
}
939961

0 commit comments

Comments
 (0)