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.
Compliance.of(stack).encrypt({ key });
Compliance.of(gpuProvider).encrypt({ storage: gpuKey });
Compliance.of(stack).limitLambdaConcurrency();Compliance.of(stack).encrypt(key=key)
Compliance.of(gpu_provider).encrypt(storage=gpu_key)
Compliance.of(stack).limit_lambda_concurrency()Compliance.of(stack).encrypt(Map.of("key", key));
Compliance.of(gpuProvider).encrypt(Map.of("storage", gpuKey));
Compliance.of(stack).limitLambdaConcurrency();Compliance.Of(stack).Encrypt(new Struct { Key = key });
Compliance.Of(gpuProvider).Encrypt(new Struct { Storage = gpuKey });
Compliance.Of(stack).LimitLambdaConcurrency();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.
public encrypt(options: ComplianceEncryptionOptions): voidoptions:ComplianceEncryptionOptions
def encrypt(
images: IKey = None,
key: IKey = None,
logs: IKey = None,
messages: IKey = None,
secrets: IKey = None,
storage: IKey = None
) -> Noneimages?:IKeyKey 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:
keykey?:IKeyKey for every type of resource that doesn't have its own key below.
Default: only types with their own key are encrypted
logs?:IKeyKey for CloudWatch log groups, including runner logs.
Default:
keymessages?:IKeyKey for the Step Functions state machine, SQS queues, SNS topics and the DynamoDB table used to manage runners.
Default:
keysecrets?:IKeyKey for Secrets Manager secrets holding GitHub credentials.
Default:
keystorage?:IKeyKey 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
public void encrypt(ComplianceEncryptionOptions options)options:ComplianceEncryptionOptions
private void Encrypt(ComplianceEncryptionOptions Options)Options:ComplianceEncryptionOptions
func Encrypt(options ComplianceEncryptionOptions)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.
public limitLambdaConcurrency(options?: ComplianceLambdaConcurrencyOptions): voidoptions?:ComplianceLambdaConcurrencyOptions
def limit_lambda_concurrency(
max_job_starts: typing.Union[int, float] = None,
max_lambda_jobs: typing.Union[int, float] = None
) -> Nonemax_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
public void limitLambdaConcurrency()
public void limitLambdaConcurrency(ComplianceLambdaConcurrencyOptions options)options?:ComplianceLambdaConcurrencyOptions
private void LimitLambdaConcurrency(ComplianceLambdaConcurrencyOptions Options = null)Options?:ComplianceLambdaConcurrencyOptions
func LimitLambdaConcurrency(options ComplianceLambdaConcurrencyOptions)options?:ComplianceLambdaConcurrencyOptions
Static Functions
of()of()of()Of()Of()
Compliance settings for everything this library creates in the given scope.
import { Compliance } from '@cloudsnorkel/cdk-github-runners'
Compliance.of(scope: IConstruct)scope:IConstruct
import cloudsnorkel.cdk_github_runners
cloudsnorkel.cdk_github_runners.Compliance.of(
scope: IConstruct
)scope:IConstruct
import com.cloudsnorkel.cdk.github.runners.Compliance;
Compliance.of(IConstruct scope)scope:IConstruct
using CloudSnorkel;
Compliance.Of(IConstruct Scope);Scope:IConstruct
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
cloudsnorkelcdkgithubrunners.Compliance_Of(scope IConstruct) Compliancescope:IConstruct