Skip to content

Commit

Permalink
update docs, add example endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 18, 2022
1 parent b58a4fd commit 56c0310
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
32 changes: 32 additions & 0 deletions examples/vpc-interface-endpoint/datasync.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module "vpce_datasync" {
source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint"

service = "datasync"
private_dns_enabled = false
subnet_ids = tolist(data.aws_subnet_ids.subnets.ids)

security_group_ids = [module.sg_datasync.this_security_group_id]

vpc_id = local.vpc_id
vpc_full_name = var.vpc_full_name
vpc_environment = var.vpc_environment

tags = local.common_tags
}


module "agent_host" {
source = "git@github.e.it.census.gov:terraform-modules/dns-lookup.git"

hosts = [local.agent_hostname]
use_cidr_format = false
}

resource "aws_datasync_agent" "agent" {
name = "enterprise1"
ip_address = element(module.agent_host.addresses_ipv4, 0)
security_group_arns = [module.sg_datasync.this_security_group_arn]
subnet_arns = [for k, v in data.aws_subnet.datasync_subnets : v.arn if k == local.datasync_agent_subnet_id]
vpc_endpoint_id = module.vpce_datasync.vpce_service_info.id
private_link_endpoint = module.vpce_datasync.vpce_service_info.subnet_interface_ip_map[local.datasync_agent_subnet_id]
}
11 changes: 11 additions & 0 deletions vpc-interface-endpoint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ module "vpce_secretsmanager" {
tags = {}
}
```
# Outputs
This outputs an object with the following elements:

* name: name of the VPC endpoint
* service\_name: name of the VPC endpoint service
* id: VPC endpoint ID
* dns\_entry: DNS name for the VPC endpoint
* subnet\_ids: list of subnet IDs on which the VPC endpoint resides
* network\_interface\_ids: List of network interface IDs (ENIs), one per subnet
* subnet\_interface\_id\_map: map of subnet id to network interface ID
* subnet\_interface\_ip\_map: map of subnet id to network interface IPv4 address

## Requirements

Expand Down
12 changes: 12 additions & 0 deletions vpc-interface-endpoint/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
* tags = {}
* }
* ```
* # Outputs
* This outputs an object with the following elements:
*
* * name: name of the VPC endpoint
* * service_name: name of the VPC endpoint service
* * id: VPC endpoint ID
* * dns_entry: DNS name for the VPC endpoint
* * subnet_ids: list of subnet IDs on which the VPC endpoint resides
* * network_interface_ids: List of network interface IDs (ENIs), one per subnet
* * subnet_interface_id_map: map of subnet id to network interface ID
* * subnet_interface_ip_map: map of subnet id to network interface IPv4 address
*
*/

locals {
Expand Down

0 comments on commit 56c0310

Please sign in to comment.