Skip to content

Commit

Permalink
Fixed Sagemaker resource name in VPC endpoint (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 authored and antonbabenko committed Sep 3, 2019
1 parent 0e459d2 commit 203db3d
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 5 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ These types of resources are supported:
* [VPC Endpoint](https://www.terraform.io/docs/providers/aws/r/vpc_endpoint.html):
* Gateway: S3, DynamoDB
* Interface: EC2, SSM, EC2 Messages, SSM Messages, SQS, ECR API, ECR DKR, API Gateway, KMS, ECS, ECS Agent, ECS
Telemetry, SNS, CloudWatch(Monitoring, Logs, Events), Elastic Load Balancing, CloudTrail-
Telemetry, SNS, CloudWatch(Monitoring, Logs, Events), Elastic Load Balancing, CloudTrail, SageMaker(Notebook, Runtime, API),
Cloudformation, CodeBuild, CodeCommit, CodePipeline, Storage Gateway, SFTP(Transfer Server), Service Catalog,
AppMesh, STS, Glue, Kinesis(Firehose & Streams), Config, Secrets Manager
* [RDS DB Subnet Group](https://www.terraform.io/docs/providers/aws/r/db_subnet_group.html)
* [ElastiCache Subnet Group](https://www.terraform.io/docs/providers/aws/r/elasticache_subnet_group.html)
* [Redshift Subnet Group](https://www.terraform.io/docs/providers/aws/r/redshift_subnet_group.html)
Expand Down Expand Up @@ -522,6 +524,11 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
| vpc\_endpoint\_apigw\_dns\_entry | The DNS entries for the VPC Endpoint for APIGW. |
| vpc\_endpoint\_apigw\_id | The ID of VPC endpoint for APIGW |
| vpc\_endpoint\_apigw\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for APIGW. |
| vpc\_endpoint\_appmesh\_envoy\_management\_dns\_entry | The DNS entries for the VPC Endpoint for AppMesh. |
| vpc\_endpoint\_appmesh\_envoy\_management\_id | The ID of VPC endpoint for AppMesh |
| vpc\_endpoint\_appmesh\_envoy\_management\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for AppMesh. |
| vpc\_endpoint\_cloudformation\_dns\_entry | The DNS entries for the VPC Endpoint for Cloudformation. |
| vpc\_endpoint\_cloudformation\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Cloudformation. |
| vpc\_endpoint\_cloudtrail\_dns\_entry | The DNS entries for the VPC Endpoint for CloudTrail. |
| vpc\_endpoint\_cloudtrail\_id | The ID of VPC endpoint for CloudTrail |
| vpc\_endpoint\_cloudtrail\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for CloudTrail. |
Expand All @@ -531,6 +538,9 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
| vpc\_endpoint\_codecommit\_dns\_entry | The DNS entries for the VPC Endpoint for CodeCommit. |
| vpc\_endpoint\_codecommit\_id | The ID of VPC endpoint for CodeCommit |
| vpc\_endpoint\_codecommit\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for CodeCommit. |
| vpc\_endpoint\_codepipeline\_dns\_entry | The DNS entries for the VPC Endpoint for CodePipeline. |
| vpc\_endpoint\_codepipeline\_id | The ID of VPC endpoint for CodePipeline |
| vpc\_endpoint\_codepipeline\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for CodePipeline. |
| vpc\_endpoint\_config\_dns\_entry | The DNS entries for the VPC Endpoint for Config. |
| vpc\_endpoint\_config\_id | The ID of VPC endpoint for Config |
| vpc\_endpoint\_config\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Config. |
Expand Down Expand Up @@ -586,12 +596,21 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
| vpc\_endpoint\_monitoring\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for CloudWatch Monitoring. |
| vpc\_endpoint\_s3\_id | The ID of VPC endpoint for S3 |
| vpc\_endpoint\_s3\_pl\_id | The prefix list for the S3 VPC endpoint. |
| vpc\_endpoint\_sagemaker\_api\_dns\_entry | The DNS entries for the VPC Endpoint for SageMaker API. |
| vpc\_endpoint\_sagemaker\_api\_id | The ID of VPC endpoint for SageMaker API |
| vpc\_endpoint\_sagemaker\_api\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for SageMaker API. |
| vpc\_endpoint\_sagemaker\_notebook\_dns\_entry | The DNS entries for the VPC Endpoint for SageMaker Notebook. |
| vpc\_endpoint\_sagemaker\_notebook\_id | The ID of VPC endpoint for SageMaker Notebook |
| vpc\_endpoint\_sagemaker\_notebook\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for SageMaker Notebook. |
| vpc\_endpoint\_sagemaker\_runtime\_dns\_entry | The DNS entries for the VPC Endpoint for SageMaker Runtime. |
| vpc\_endpoint\_sagemaker\_runtime\_id | The ID of VPC endpoint for SageMaker Runtime |
| vpc\_endpoint\_sagemaker\_runtime\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for SageMaker Runtime. |
| vpc\_endpoint\_secretsmanager\_dns\_entry | The DNS entries for the VPC Endpoint for Secrets Manager. |
| vpc\_endpoint\_secretsmanager\_id | The ID of VPC endpoint for Secrets Manager |
| vpc\_endpoint\_secretsmanager\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Secrets Manager. |
| vpc\_endpoint\_servicecatalog\_dns\_entry | The DNS entries for the VPC Endpoint for Service Catalog. |
| vpc\_endpoint\_servicecatalog\_id | The ID of VPC endpoint for Service Catalog |
| vpc\_endpoint\_servicecatalog\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Service Catalog. |
| vpc\_endpoint\_sns\_dns\_entry | The DNS entries for the VPC Endpoint for SNS. |
| vpc\_endpoint\_sns\_id | The ID of VPC endpoint for SNS |
| vpc\_endpoint\_sns\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for SNS. |
Expand All @@ -604,9 +623,15 @@ Sometimes it is handy to have public access to Redshift clusters (for example if
| vpc\_endpoint\_ssmmessages\_dns\_entry | The DNS entries for the VPC Endpoint for SSMMESSAGES. |
| vpc\_endpoint\_ssmmessages\_id | The ID of VPC endpoint for SSMMESSAGES |
| vpc\_endpoint\_ssmmessages\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for SSMMESSAGES. |
| vpc\_endpoint\_storagegateway\_dns\_entry | The DNS entries for the VPC Endpoint for Storage Gateway. |
| vpc\_endpoint\_storagegateway\_id | The ID of VPC endpoint for Storage Gateway |
| vpc\_endpoint\_storagegateway\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Storage Gateway. |
| vpc\_endpoint\_sts\_dns\_entry | The DNS entries for the VPC Endpoint for STS. |
| vpc\_endpoint\_sts\_id | The ID of VPC endpoint for STS |
| vpc\_endpoint\_sts\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for STS. |
| vpc\_endpoint\_transfer\_dns\_entry | The DNS entries for the VPC Endpoint for Transfer. |
| vpc\_endpoint\_transfer\_id | The ID of VPC endpoint for Transfer |
| vpc\_endpoint\_transfer\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Transfer. |
| vpc\_endpoint\_transferserver\_dns\_entry | The DNS entries for the VPC Endpoint for Transfer Server. |
| vpc\_endpoint\_transferserver\_id | The ID of VPC endpoint for Transfer Server |
| vpc\_endpoint\_transferserver\_network\_interface\_ids | One or more network interfaces for the VPC Endpoint for Transfer Server. |
Expand Down
115 changes: 115 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,121 @@ output "vpc_endpoint_sts_dns_entry" {
value = "${flatten(aws_vpc_endpoint.sts.*.dns_entry)}"
}

output "vpc_endpoint_cloudformation_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for Cloudformation."
value = "${flatten(aws_vpc_endpoint.cloudformation.*.network_interface_ids)}"
}

output "vpc_endpoint_cloudformation_dns_entry" {
description = "The DNS entries for the VPC Endpoint for Cloudformation."
value = "${flatten(aws_vpc_endpoint.cloudformation.*.dns_entry)}"
}

output "vpc_endpoint_codepipeline_id" {
description = "The ID of VPC endpoint for CodePipeline"
value = "${element(concat(aws_vpc_endpoint.codepipeline.*.id, list("")), 0)}"
}

output "vpc_endpoint_codepipeline_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for CodePipeline."
value = "${flatten(aws_vpc_endpoint.codepipeline.*.network_interface_ids)}"
}

output "vpc_endpoint_codepipeline_dns_entry" {
description = "The DNS entries for the VPC Endpoint for CodePipeline."
value = "${flatten(aws_vpc_endpoint.codepipeline.*.dns_entry)}"
}

output "vpc_endpoint_appmesh_envoy_management_id" {
description = "The ID of VPC endpoint for AppMesh"
value = "${element(concat(aws_vpc_endpoint.appmesh_envoy_management.*.id, list("")), 0)}"
}

output "vpc_endpoint_appmesh_envoy_management_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for AppMesh."
value = "${flatten(aws_vpc_endpoint.appmesh_envoy_management.*.network_interface_ids)}"
}

output "vpc_endpoint_appmesh_envoy_management_dns_entry" {
description = "The DNS entries for the VPC Endpoint for AppMesh."
value = "${flatten(aws_vpc_endpoint.appmesh_envoy_management.*.dns_entry)}"
}

output "vpc_endpoint_servicecatalog_id" {
description = "The ID of VPC endpoint for Service Catalog"
value = "${element(concat(aws_vpc_endpoint.servicecatalog.*.id, list("")), 0)}"
}

output "vpc_endpoint_servicecatalog_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for Service Catalog."
value = "${flatten(aws_vpc_endpoint.servicecatalog.*.network_interface_ids)}"
}

output "vpc_endpoint_servicecatalog_dns_entry" {
description = "The DNS entries for the VPC Endpoint for Service Catalog."
value = "${flatten(aws_vpc_endpoint.servicecatalog.*.dns_entry)}"
}

output "vpc_endpoint_storagegateway_id" {
description = "The ID of VPC endpoint for Storage Gateway"
value = "${element(concat(aws_vpc_endpoint.storagegateway.*.id, list("")), 0)}"
}

output "vpc_endpoint_storagegateway_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for Storage Gateway."
value = "${flatten(aws_vpc_endpoint.storagegateway.*.network_interface_ids)}"
}

output "vpc_endpoint_storagegateway_dns_entry" {
description = "The DNS entries for the VPC Endpoint for Storage Gateway."
value = "${flatten(aws_vpc_endpoint.storagegateway.*.dns_entry)}"
}

output "vpc_endpoint_transfer_id" {
description = "The ID of VPC endpoint for Transfer"
value = "${element(concat(aws_vpc_endpoint.transfer.*.id, list("")), 0)}"
}

output "vpc_endpoint_transfer_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for Transfer."
value = "${flatten(aws_vpc_endpoint.transfer.*.network_interface_ids)}"
}

output "vpc_endpoint_transfer_dns_entry" {
description = "The DNS entries for the VPC Endpoint for Transfer."
value = "${flatten(aws_vpc_endpoint.transfer.*.dns_entry)}"
}

output "vpc_endpoint_sagemaker_api_id" {
description = "The ID of VPC endpoint for SageMaker API"
value = "${element(concat(aws_vpc_endpoint.sagemaker_api.*.id, list("")), 0)}"
}

output "vpc_endpoint_sagemaker_api_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for SageMaker API."
value = "${flatten(aws_vpc_endpoint.sagemaker_api.*.network_interface_ids)}"
}

output "vpc_endpoint_sagemaker_api_dns_entry" {
description = "The DNS entries for the VPC Endpoint for SageMaker API."
value = "${flatten(aws_vpc_endpoint.sagemaker_api.*.dns_entry)}"
}

output "vpc_endpoint_sagemaker_runtime_id" {
description = "The ID of VPC endpoint for SageMaker Runtime"
value = "${element(concat(aws_vpc_endpoint.sagemaker_runtime.*.id, list("")), 0)}"
}

output "vpc_endpoint_sagemaker_runtime_network_interface_ids" {
description = "One or more network interfaces for the VPC Endpoint for SageMaker Runtime."
value = "${flatten(aws_vpc_endpoint.sagemaker_runtime.*.network_interface_ids)}"
}

output "vpc_endpoint_sagemaker_runtime_dns_entry" {
description = "The DNS entries for the VPC Endpoint for SageMaker Runtime."
value = "${flatten(aws_vpc_endpoint.sagemaker_runtime.*.dns_entry)}"
}

# Static values (arguments)
output "azs" {
description = "A list of availability zones specified as argument to this module"
Expand Down
8 changes: 4 additions & 4 deletions vpc-endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -882,12 +882,12 @@ resource "aws_vpc_endpoint" "transfer" {
}

#######################
# VPC Endpoint for Sagemaker API
# VPC Endpoint for SageMaker API
#######################
data "aws_vpc_endpoint_service" "sagemaker_api" {
count = "${var.create_vpc && var.enable_sagemaker_api_endpoint ? 1 : 0}"

service = "sagemaker_api"
service = "sagemaker.api"
}

resource "aws_vpc_endpoint" "sagemaker_api" {
Expand All @@ -905,15 +905,15 @@ resource "aws_vpc_endpoint" "sagemaker_api" {
}

#######################
# VPC Endpoint for SAGEMAKER.RUNTIME
# VPC Endpoint for SageMaker Runtime
#######################
data "aws_vpc_endpoint_service" "sagemaker_runtime" {
count = "${var.create_vpc && var.enable_sagemaker_runtime_endpoint ? 1 : 0}"

service = "sagemaker.runtime"
}

resource "aws_vpc_endpoint" "sagemaker.runtime" {
resource "aws_vpc_endpoint" "sagemaker_runtime" {
count = "${var.create_vpc && var.enable_sagemaker_runtime_endpoint ? 1 : 0}"

vpc_id = "${local.vpc_id}"
Expand Down

0 comments on commit 203db3d

Please sign in to comment.