Skip to content

Commit

Permalink
Merge pull request #263 from Uniswap/rcmpbell/add_kms_cosigner_work
Browse files Browse the repository at this point in the history
feat: add KMS stack
  • Loading branch information
rileydcampbell authored Feb 2, 2024
2 parents 38b7116 + d6a1c46 commit 2c3fae1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bin/stacks/kms-stack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as cdk from 'aws-cdk-lib';
import { CfnOutput, RemovalPolicy } from 'aws-cdk-lib';
import { KeySpec, KeyUsage } from 'aws-cdk-lib/aws-kms';
import { Construct } from 'constructs';

export class KmsStack extends cdk.NestedStack {
public readonly key: cdk.aws_kms.Key;

constructor(parent: Construct, name: string) {
super(parent, name);

/**
* Unless absolutely necessary, DO NOT change this construct.
* This uses the 'Retain' DeletionPolicy, which will cause the resource to be retained
* in the account, but orphaned from the stack if the Key construct is ever changed.
*/
this.key = new cdk.aws_kms.Key(this, name, {
removalPolicy: RemovalPolicy.RETAIN,
keySpec: KeySpec.ECC_SECG_P256K1,
keyUsage: KeyUsage.SIGN_VERIFY,
alias: name,
});

new CfnOutput(this, `${name}KeyId`, {
value: this.key.keyId,
});
}
}

0 comments on commit 2c3fae1

Please sign in to comment.