Search…
Terraform - Cased Shell on AWS
Module to setup Cased Shell on ECS, featuring end-to-end encryption, and using a Network Load Balancer.

terraform-aws-cased-shell-ecs

Module to setup Cased Shell on ECS, featuring end-to-end encryption, and using a Network Load Balancer. https://github.com/cased/terraform-aws-cased-shell-ecs

Example

1
module "cased-shell" {
2
source = "cased/terraform-aws-cased-shell-ecs"
3
version = "~> 0.3.0"
4
5
# The environment, and the id of the vpc and the cluster where the service will run
6
env = "prod"
7
vpc_id = vpc.id
8
cluster_id = mycluster.id
9
10
# Subnets and secgroups for the service
11
vpc_subnet_ids = [subnet1.id, subnet2.id]
12
security_group_ids = [securitygroup1.id, securitygroup2.id]
13
14
# The hostname for Cased Shell
15
hostname = "webshell.example.com"
16
17
# For security, this must be the ARN of an aws_secretsmanager_secret, not the actual secret string
18
cased_shell_secret_arn = your_shell_secret.arn
19
20
# Set up a hostname with route53 automatically
21
zone_id = your_zone.id
22
}
Copied!

Documentation

Host Auto-discovery

By default, the hosts a Cased Shell instance can be used to access are configured in the Cased App. Enabling host auto-discovery by setting host_autodiscovery to true grants the ECS task running Cased Shell access to the ec2:DescribeInstances API call in your account, allowing the Cased Shell instance to query the AWS API and dynamically update this set of hosts instead. The host_autodiscovery_descriptive_tag variable can be set to the name of a resource tag like Name or aws:autoscaling:groupName to include alongside the hostname, and the host_autodiscovery_tag_filters variable can be used to filter the set of instances displayed. By default, all instances in the same region as the Cased Shell instance are included.

Example

1
module "cased-shell" {
2
source = "cased/terraform-aws-cased-shell-ecs"
3
version = "~> 0.3.0"
4
5
# The environment, and the id of the vpc and the cluster where the service will run
6
env = "prod"
7
vpc_id = vpc.id
8
cluster_id = mycluster.id
9
10
# Subnets and secgroups for the service
11
vpc_subnet_ids = [subnet1.id, subnet2.id]
12
security_group_ids = [securitygroup1.id, securitygroup2.id]
13
14
# The hostname for Cased Shell
15
hostname = "webshell.example.com"
16
17
# For security, this must be the ARN of an aws_secretsmanager_secret, not the actual secret string
18
cased_shell_secret_arn = your_shell_secret.arn
19
20
# Set up a hostname with route53 automatically
21
zone_id = your_zone.id
22
23
# Automatically display all instances with a `cluster` tag that matches `*test*` in host dropdown list,
24
# including the value of `aws:autoscaling:groupName` to help users find the right instance.
25
host_autodiscovery = true
26
host_autodiscovery_descriptive_tag = "aws:autoscaling:groupName"
27
host_autodiscovery_tag_filters = [{
28
name = "cluster"
29
values = [
30
"*test*"
31
]
32
}]
33
34
}
Copied!

Development

make will generate docs, format source, and run tests.