-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1629 from gravitational/sasha/deploy2
Improvements for AWS support deployments
- Loading branch information
Showing
18 changed files
with
375 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,61 @@ | ||
# AWS provisioning examples | ||
|
||
## Terraform provisioning example | ||
|
||
Terraform specifies example provisioning script | ||
for Teleport auth, proxy and nodes in HA mode. | ||
|
||
Use these examples as possible deployment patterns suggested | ||
by Teleport developers. | ||
|
||
Scripts set up letsencrypt certificates using DNS-01 challenge. | ||
This means users have to control DNS zone via route53. | ||
|
||
Teleport join tokens are distributed using SSM parameter store, | ||
and certificates are distributed using encrypted S3 bucket. | ||
|
||
There are a couple of tricks using DynamoDB locking to make sure | ||
there is only one auth server node rotating join token at a time, | ||
but those could be easilly replaced and are not critical for performance. | ||
|
||
Important bits are that auth servers and proxes are not running as root | ||
and are secured exposing absolute minimum of the ports to the other parts. | ||
|
||
```bash | ||
# Set variables for Terraform | ||
|
||
# This region should support EFS | ||
export TF_VAR_region="us-west-2" | ||
|
||
# Cluster name is a unique cluster name to use, better to use FQDN, e.g. cluster.example.com | ||
export TF_VAR_cluster_name=cluster.example.com | ||
|
||
# Teleport version to install, e.g. 2.4.0 | ||
export TF_VAR_teleport_version="2.5.0-alpha.5" | ||
|
||
# AWS SSH key name to provision in installed instances, should be available in the region | ||
export TF_VAR_key_name="example" | ||
|
||
# Full absolute path to the license file for Teleport enterprise or pro | ||
export TF_VAR_license_path="/path/to/license" | ||
|
||
# AMI name to use, could be public or private | ||
export TF_VAR_ami_name="debian-stretch-hvm-x86_64-gp2-2018-01-06-16218-572488bb-fc09-4638-8628-e1e1d26436f4-ami-628ad918.4" | ||
|
||
# Route 53 zone to use, should be the zone registered in AWS, | ||
# e.g. example.com | ||
export TF_VAR_route53_zone="example.com" | ||
|
||
# Subdomain to set up in the zone above, e.g. cluster.example.com | ||
# this will be used for internet access for users connecting to teleport proxy | ||
export TF_VAR_route53_domain="cluster.example.com" | ||
|
||
# Bucket name to store encrypted letsencrypt certificates. | ||
export TF_VAR_s3_bucket_name="teleport.example.com" | ||
|
||
# Email of your support org, uset for letsencrypt cert registration process. | ||
export TF_VAR_email="[email protected]" | ||
|
||
# plan | ||
make plan | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Locks is a dynamodb table used as a distributed lock | ||
// to make sure there is only one auth server doing | ||
// letsencrypt certificate renewal, this is not critical for teleport | ||
// and is purely for demonstration purposes | ||
resource "aws_dynamodb_table" "locks" { | ||
name = "${var.cluster_name}-locks" | ||
read_capacity = 10 | ||
write_capacity = 10 | ||
hash_key = "Lock" | ||
range_key = "Process" | ||
|
||
attribute { | ||
name = "Lock" | ||
type = "S" | ||
} | ||
|
||
attribute { | ||
name = "Process" | ||
type = "S" | ||
} | ||
|
||
ttl { | ||
attribute_name = "Expires" | ||
enabled = true | ||
} | ||
|
||
tags { | ||
TeleportCluster = "${var.cluster_name}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ variable "aws_max_retries" { | |
|
||
provider "aws" { | ||
version = "~> 1.7" | ||
region = "${var.region}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.