Skip to content

Compliance Class ​

Settings that compliance frameworks like HIPAA, PCI DSS, and NIST 800-53 ask for, applied to everything this library creates in a scope.

The scope can be an app, a stage, a stack, or a single construct like a runner provider. Settings of the closest scope win, so you can set a key for a whole stack and a stricter one for a single provider. Resources you create yourself are not changed.

Once anything uses Compliance, synth warns about runner resources in the same stage that no scope covers. Like other aspects, an app scope doesn't reach into nested stages, so call Compliance.of() on those stages too.

ts
Compliance.of(stack).encrypt({ key });
Compliance.of(gpuProvider).encrypt({ storage: gpuKey });
Compliance.of(stack).limitLambdaConcurrency();
python
Compliance.of(stack).encrypt(key=key)
Compliance.of(gpu_provider).encrypt(storage=gpu_key)
Compliance.of(stack).limit_lambda_concurrency()
java
Compliance.of(stack).encrypt(Map.of("key", key));
Compliance.of(gpuProvider).encrypt(Map.of("storage", gpuKey));
Compliance.of(stack).limitLambdaConcurrency();
csharp
Compliance.Of(stack).Encrypt(new Struct { Key = key });
Compliance.Of(gpuProvider).Encrypt(new Struct { Storage = gpuKey });
Compliance.Of(stack).LimitLambdaConcurrency();
go
compliance_Of(stack).encrypt(map[string]interface{}{
	"key": key,
})
compliance_Of(gpuProvider).encrypt(map[string]interface{}{
	"storage": gpuKey,
})
compliance_Of(stack).limitLambdaConcurrency()

Methods ​

encrypt()encrypt()encrypt()Encrypt()Encrypt() ​

Encrypt data at rest with your own KMS keys.

Keys created in the same app get the key policy they need. For imported keys, a warning lists the statements to add to the key policy.

ts
public encrypt(options: ComplianceEncryptionOptions): void
python
def encrypt(
  images: IKey = None,
  key: IKey = None,
  logs: IKey = None,
  messages: IKey = None,
  secrets: IKey = None,
  storage: IKey = None
) -> None
  • images?: IKey

    Key for ECR repositories holding runner images, and for AMIs built for EC2 runners.

    EC2 runner volumes are encrypted with the key of their AMI.

    Adding a key to an existing repository replaces it. The deployment waits for the image to be rebuilt in the new repository before runners use it.

    Default: key

  • key?: IKey

    Key for every type of resource that doesn't have its own key below.

    Default: only types with their own key are encrypted

  • logs?: IKey

    Key for CloudWatch log groups, including runner logs.

    Default: key

  • messages?: IKey

    Key for the Step Functions state machine, SQS queues, SNS topics and the DynamoDB table used to manage runners.

    Default: key

  • secrets?: IKey

    Key for Secrets Manager secrets holding GitHub credentials.

    Default: key

  • storage?: IKey

    Key for runner storage: EBS volumes of ECS instances, Fargate ephemeral storage, CodeBuild build output, and buckets used to build images.

    ECS clusters and capacity providers you pass in are not changed.

    Default: key

java
public void encrypt(ComplianceEncryptionOptions options)
csharp
private void Encrypt(ComplianceEncryptionOptions Options)
go
func Encrypt(options ComplianceEncryptionOptions)

limitLambdaConcurrency()limit_lambda_concurrency()limitLambdaConcurrency()LimitLambdaConcurrency()LimitLambdaConcurrency() ​

Set reserved concurrency on Lambda functions.

This reserves 5 x maxJobStarts for functions called on every job, maxLambdaJobs for every Lambda runner provider, and 5 for every other function. With the defaults, that's about 120 for a simple deployment and 190 for one using every feature. Reserved concurrency comes out of your account limit, and the account must keep 100 unreserved.

ts
public limitLambdaConcurrency(options?: ComplianceLambdaConcurrencyOptions): void
python
def limit_lambda_concurrency(
  max_job_starts: typing.Union[int, float] = None,
  max_lambda_jobs: typing.Union[int, float] = None
) -> None
  • max_job_starts?: typing.Union[int, float]

    How many jobs you expect to start at the same time.

    Functions called for every job, like the webhook handler, can run this many at once. If more jobs start at once, they wait a bit longer for a runner.

    Status, setup, warm runner and deployment helper functions are limited to 5.

    Default: 20

  • max_lambda_jobs?: typing.Union[int, float]

    How many jobs each Lambda runner provider can run at the same time.

    Default: 20

java
public void limitLambdaConcurrency()
public void limitLambdaConcurrency(ComplianceLambdaConcurrencyOptions options)
csharp
private void LimitLambdaConcurrency(ComplianceLambdaConcurrencyOptions Options = null)
go
func LimitLambdaConcurrency(options ComplianceLambdaConcurrencyOptions)

Static Functions ​

of()of()of()Of()Of() ​

Compliance settings for everything this library creates in the given scope.

ts
import { Compliance } from '@cloudsnorkel/cdk-github-runners'

Compliance.of(scope: IConstruct)
python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.Compliance.of(
  scope: IConstruct
)
java
import com.cloudsnorkel.cdk.github.runners.Compliance;

Compliance.of(IConstruct scope)
csharp
using CloudSnorkel;

Compliance.Of(IConstruct Scope);
go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

cloudsnorkelcdkgithubrunners.Compliance_Of(scope IConstruct) Compliance

Released under the Apache-2.0 License.