diff --git a/API.md b/API.md index b0315a78..0c4d351d 100644 --- a/API.md +++ b/API.md @@ -2209,6 +2209,7 @@ Included components: | labels | string[] | Labels associated with this provider. | | logGroup | aws-cdk-lib.aws_logs.ILogGroup | Log group where provided runners will save their logs. | | retryableErrors | string[] | List of step functions errors that should be retried. | +| launchTemplate | aws-cdk-lib.aws_ec2.LaunchTemplate | Launch template for the created instance. | --- @@ -2286,6 +2287,18 @@ List of step functions errors that should be retried. --- +##### `launchTemplate`Optional + +```typescript +public readonly launchTemplate: LaunchTemplate; +``` + +- *Type:* aws-cdk-lib.aws_ec2.LaunchTemplate + +Launch template for the created instance. + +--- + ### FargateRunner @@ -6187,6 +6200,7 @@ const ecsRunnerProviderProps: EcsRunnerProviderProps = { ... } | securityGroups | aws-cdk-lib.aws_ec2.ISecurityGroup[] | Security groups to assign to the task. | | spot | boolean | Use spot capacity. | | spotMaxPrice | string | Maximum price for spot instances. | +| storageKey | aws-cdk-lib.aws_kms.IKey | Options for runner instance storage volume. | | storageOptions | StorageOptions | Options for runner instance storage volume. | | storageSize | aws-cdk-lib.Size | Size of volume available for launched cluster instances. | | subnetSelection | aws-cdk-lib.aws_ec2.SubnetSelection | Subnets to run the runners in. | @@ -6458,6 +6472,18 @@ Maximum price for spot instances. --- +##### `storageKey`Optional + +```typescript +public readonly storageKey: IKey; +``` + +- *Type:* aws-cdk-lib.aws_kms.IKey + +Options for runner instance storage volume. + +--- + ##### `storageOptions`Optional ```typescript diff --git a/src/providers/ecs.ts b/src/providers/ecs.ts index 12413fe5..1ae694d1 100644 --- a/src/providers/ecs.ts +++ b/src/providers/ecs.ts @@ -157,6 +157,11 @@ export interface EcsRunnerProviderProps extends RunnerProviderProps { */ readonly maxInstances?: number; + /** + * Options for runner instance storage volume. + */ + readonly storageKey?: cdk.aws_kms.IKey; + /** * Size of volume available for launched cluster instances. This modifies the boot volume size and doesn't add any additional volumes. * @@ -263,6 +268,12 @@ export class EcsRunnerProvider extends BaseProvider implements IRunnerProvider { }); } + /** + * Launch template for the created instance + */ + public launchTemplate?: ec2.LaunchTemplate; + + /** * Cluster hosting the task hosting the runner. */ @@ -395,6 +406,8 @@ export class EcsRunnerProvider extends BaseProvider implements IRunnerProvider { volumeType: props.storageOptions?.volumeType, iops: props.storageOptions?.iops, throughput: props.storageOptions?.throughput, + encrypted: props.storageKey ? true : undefined, + kmsKey: props.storageKey ?? undefined, }, }, },