From 203db3d2f6fdc4f563224e1de7b89e1cf64666c0 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 3 Sep 2019 15:11:43 +0300 Subject: [PATCH] Fixed Sagemaker resource name in VPC endpoint (#323) --- README.md | 27 +++++++++++- outputs.tf | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ vpc-endpoint.tf | 8 ++-- 3 files changed, 145 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c161877f2..02b5a9359 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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. | @@ -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. | @@ -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. | @@ -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. | diff --git a/outputs.tf b/outputs.tf index d29b1429a..af1a68622 100644 --- a/outputs.tf +++ b/outputs.tf @@ -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" diff --git a/vpc-endpoint.tf b/vpc-endpoint.tf index 7305abee8..85aeb87ba 100644 --- a/vpc-endpoint.tf +++ b/vpc-endpoint.tf @@ -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" { @@ -905,7 +905,7 @@ 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}" @@ -913,7 +913,7 @@ data "aws_vpc_endpoint_service" "sagemaker_runtime" { 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}"