Skip to content

Commit 318b19c

Browse files
committed
feat: add a new setting for the FedRAMP environment
I've added a new variable to indicate that the pool is connecting to a Spacelift FedRAMP account. When this is enabled, a different launcher binary compatible with the FedRAMP environment is downloaded.
1 parent 1267942 commit 318b19c

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,49 @@ module "spacelift_workerpool" {
5656
}
5757
```
5858

59+
### FedRAMP Example
60+
61+
If your account is in the Spacelift FedRAMP environment, set the `is_fedramp` variable to `true`:
62+
63+
```hcl
64+
terraform {
65+
required_providers {
66+
aws = {
67+
source = "hashicorp/aws"
68+
version = "~> 5.0"
69+
}
70+
}
71+
}
72+
73+
provider "aws" {
74+
region = "us-west-1"
75+
}
76+
77+
module "spacelift_workerpool" {
78+
source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v4.4.3"
79+
80+
secure_env_vars = {
81+
SPACELIFT_TOKEN = var.worker_pool_config
82+
SPACELIFT_POOL_PRIVATE_KEY = var.worker_pool_private_key
83+
}
84+
85+
configuration = <<EOF
86+
export SPACELIFT_SENSITIVE_OUTPUT_UPLOAD_ENABLED=true
87+
EOF
88+
89+
min_size = 1
90+
max_size = 5
91+
worker_pool_id = var.worker_pool_id
92+
security_groups = var.security_groups
93+
vpc_subnets = var.subnets
94+
is_fedramp = true
95+
}
96+
```
97+
98+
**NOTE:** if you don't set the `is_fedramp` variable to `true` and attempt to connect to the Spacelift FedRAMP environment the launcher will exit on startup without connecting to Spacelift.
99+
100+
### Other Examples
101+
59102
For more examples covering specific use cases, please see the [examples directory](./examples/):
60103

61104
- [AMD64 deployment](./examples/amd64/)

asg.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ locals {
1616
saas_user_data = templatefile("${path.module}/user_data/saas.tftpl", {
1717
custom_user_data = join("\n", [local.secure_env_vars, var.configuration])
1818
domain_name = var.domain_name
19+
is_fedramp = var.is_fedramp
1920
poweroff_delay = var.poweroff_delay
2021
region = data.aws_region.this.region
2122
})

user_data/saas.tftpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spacelift () {(
1212
return 1
1313
fi
1414

15-
baseURL="https://downloads.${domain_name}/spacelift-launcher"
15+
baseURL="https://downloads.${domain_name}/spacelift-launcher${is_fedramp ? "-fedramp" : ""}"
1616
binaryURL=$(printf "%s-%s" "$baseURL" "$currentArch")
1717
shaSumURL=$(printf "%s-%s_%s" "$baseURL" "$currentArch" "SHA256SUMS")
1818
shaSumSigURL=$(printf "%s-%s_%s" "$baseURL" "$currentArch" "SHA256SUMS.sig")

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ variable "domain_name" {
8484
default = "spacelift.io"
8585
}
8686

87+
variable "is_fedramp" {
88+
type = bool
89+
description = "Indicates whether the worker pool is connecting to the FedRAMP Spacelift environment. When true a FedRAMP-specific version of the launcher binary will be downloaded."
90+
default = false
91+
}
92+
8793
variable "ec2_instance_type" {
8894
type = string
8995
description = "EC2 instance type for the workers. If an arm64-based AMI is used, this must be an arm64-based instance type."

0 commit comments

Comments
 (0)