Skip to content

Terraform configurations to deploy a Remote Desktop Gateway solution in AWS

License

Notifications You must be signed in to change notification settings

RaduLupan/terraform-rdgateway-aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-rdgateway-aws

This repository contains Terraform configurations that deploy an Remote Desktop Gateway solution in an AWS account.

While AWS have published a Quick Start that uses CloudFormation to deploy the RD Gateway in various scenarios, they do not provide a solution for the SSL certificates that are required for each RD Gateway instance.

The solution presented here uses certbot running as a Lambda function that gets a Letsencrypt SSL certificate that is good for 90 days. The certbot Lambda function runs on a schedule and gets a new SSL certificate every 60 days and saves the certificate in an S3 bucket. Upon receiving a new SSL certificate, the S3 bucket notifies an SQS queue so that the RD Gateway that listenes to that SQS queue every day is able to download the new certificate from S3 and install it on the RD Gateway server. This workflow ensures that the RD Gateway instance has a valid SSL certificate that is renenwed forever.

Please check the wiki page for a step-by-step tutorial on this solution.

Pre-requisites

Quick start

  1. Configure your AWS access keys as environment variables:
$ export AWS_ACCESS_KEY_ID=(your access key id)
$ export AWS_SECRET_ACCESS_KEY=(your secret access key)
  1. Clone this repository:
$ git clone https://github.com/RaduLupan/terraform-rdgateway-aws.git
$ cd terraform-rdgateway-aws
  1. Optional: create a Virtual Private Cloud (VPC):
$ cd vpc
$ terraform init
$ terraform apply
  1. Optional: create a Simple AD or Microsoft AD directory:
$ cd ad
$ terraform init
$ terraform apply
  1. Create the letsencrypt-tls layer:
$ cd letsencrypt-tls
$ terraform init
$ terraform apply
  1. Create the rd-gateway layer:
$ cd rd-gateway
$ terraform init
$ terraform apply

Credits

Thank you kingsoftgames for your certbot-lambda implementation! I have found your code back in 2018 and have been running it at work ever since. Instead of manually renewing and installing the SSL certificates on a dozen RD Gateways we have in AWS, we have been receiving email notifications advising that the certificates have been renewed!

About

Terraform configurations to deploy a Remote Desktop Gateway solution in AWS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published