You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module creates a basic EC2 bastion host (Single or ASG) in a private subnet of a VPC and connects it to AWS Systems Manager.
This Bastion host can be used to access other private resources in the VPC via SSM.
There is no need to expose it via a public IP for SSH access since we're using SSM as a first transport.
module"bastion" {
source="hazelops/ec2-bastion/aws"version="~> 4.0"env="dev"vpc_id="vpc-1234567890"private_subnets=["subnet-1234567890", "subnet-1234567891"]
ec2_key_pair_name="my-key-pair"tags={
# Optionally add atun.io-compatible configuration here for Tunnel Discovery "atun.io/env"="dev""atun.io/version"="1"## Forwarding RDS to a local port 15432 "atun.io/host/${module.rds_api.cluster_endpoint}"=jsonencode({
"proto"="ssm""local"=15432"remote"= module.rds_api.api.cluster_port
}),
## Forwarding Redis to a local port 16379"atun.io/host/${module.redis_api.cache_nodes.0.address}"=jsonencode({
"proto"="ssm""local"=16379"remote"= module.redis_api.cache_nodes.0.port
}),
## Forwarding OpenSearch to a local port 10443"atun.io/host/${module.opensearch_api.endpoint}"=jsonencode({
"proto"="ssm""local"=10443"remote"=443
}),
}
}
### Modules Omitted ###module"rds_api" {
source="terraform-aws-modules/rds/aws"# Omitted for brevity
}
module"redis_api" {
source="terraform-aws-modules/elasticache/aws"# Omitted for brevity
}
module"opensearch_api" {
source="terraform-aws-modules/opensearch/aws"# Omitted for brevity
}
#######################