agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

13
cdk/node_modules/aws-cdk-lib/aws-kms/.jsiirc.json generated vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.kms"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.KMS"
},
"python": {
"module": "aws_cdk.aws_kms"
}
}
}

318
cdk/node_modules/aws-cdk-lib/aws-kms/README.md generated vendored Normal file
View File

@@ -0,0 +1,318 @@
# AWS Key Management Service Construct Library
Define a KMS key:
```ts
new kms.Key(this, 'MyKey', {
enableKeyRotation: true,
rotationPeriod: Duration.days(180), // Default is 365 days
});
```
Define a KMS key with waiting period:
Specifies the number of days in the waiting period before AWS KMS deletes a CMK that has been removed from a CloudFormation stack.
```ts
const key = new kms.Key(this, 'MyKey', {
pendingWindow: Duration.days(10), // Default to 30 Days
});
```
Add a couple of aliases:
```ts
const key = new kms.Key(this, 'MyKey');
key.addAlias('alias/foo');
key.addAlias('alias/bar');
```
Define a key with specific key spec and key usage:
Valid `keySpec` values depends on `keyUsage` value.
```ts
const key = new kms.Key(this, 'MyKey', {
keySpec: kms.KeySpec.ECC_SECG_P256K1, // Default to SYMMETRIC_DEFAULT
keyUsage: kms.KeyUsage.SIGN_VERIFY, // and ENCRYPT_DECRYPT
});
```
Create a multi-Region primary key:
```ts
const key = new kms.Key(this, 'MyKey', {
multiRegion: true, // Default is false
});
```
## Sharing keys between stacks
To use a KMS key in a different stack in the same CDK application,
pass the construct to the other stack:
[sharing key between stacks](test/integ.key-sharing.lit.ts)
## Importing existing keys
### Import key by ARN
To use a KMS key that is not defined in this CDK app, but is created through other means, use
`Key.fromKeyArn(parent, name, ref)`:
```ts
const myKeyImported = kms.Key.fromKeyArn(this, 'MyImportedKey', 'arn:aws:...');
// you can do stuff with this imported key.
myKeyImported.addAlias('alias/foo');
```
Note that a call to `.addToResourcePolicy(statement)` on `myKeyImported` will not have
an affect on the key's policy because it is not owned by your stack. The call
will be a no-op.
### Import key by alias
If a Key has an associated Alias, the Alias can be imported by name and used in place
of the Key as a reference. A common scenario for this is in referencing AWS managed keys.
```ts
import * as cloudtrail from 'aws-cdk-lib/aws-cloudtrail';
const myKeyAlias = kms.Alias.fromAliasName(this, 'myKey', 'alias/aws/s3');
const trail = new cloudtrail.Trail(this, 'myCloudTrail', {
sendToCloudWatchLogs: true,
encryptionKey: myKeyAlias,
});
```
Note that calls to `addToResourcePolicy` method on `myKeyAlias` will be a no-op, `addAlias` and `aliasTargetKey` will fail.
The grant methods (i.e., methods in `KeyGrants`) will not modify the key policy, as the imported alias does not have a reference to the underlying KMS Key.
For the grant methods to modify the principal's IAM policy, the feature flag `@aws-cdk/aws-kms:applyImportedAliasPermissionsToPrincipal`
must be set to `true`. By default, this flag is `false` and grant calls on an imported alias are a no-op.
### Lookup key by alias
If you can't use a KMS key imported by alias (e.g. because you need access to the key id), you can lookup the key with `Key.fromLookup()`.
In general, the preferred method would be to use `Alias.fromAliasName()` which returns an `IAlias` object which extends `IKey`. However, some services need to have access to the underlying key id. In this case, `Key.fromLookup()` allows to lookup the key id.
The result of the `Key.fromLookup()` operation will be written to a file
called `cdk.context.json`. You must commit this file to source control so
that the lookup values are available in non-privileged environments such
as CI build steps, and to ensure your template builds are repeatable.
Here's how `Key.fromLookup()` can be used:
```ts
const myKeyLookup = kms.Key.fromLookup(this, 'MyKeyLookup', {
aliasName: 'alias/KeyAlias',
});
const role = new iam.Role(this, 'MyRole', {
assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),
});
myKeyLookup.grantEncryptDecrypt(role);
```
Note that a call to `.addToResourcePolicy(statement)` on `myKeyLookup` will not have
an affect on the key's policy because it is not owned by your stack. The call
will be a no-op.
If the target key is not found in your account, an error will be thrown.
To prevent the error in the case, you can receive a dummy key without the error
by setting `returnDummyKeyOnMissing` to `true`. The dummy key has a `keyId` of
`1234abcd-12ab-34cd-56ef-1234567890ab`. The value of the dummy key id can also be
referenced using the `Key.DEFAULT_DUMMY_KEY_ID` variable, and you can check if the
key is a dummy key by using the `Key.isLookupDummy()` method.
```ts
const dummy = kms.Key.fromLookup(this, 'MyKeyLookup', {
aliasName: 'alias/NonExistentAlias',
returnDummyKeyOnMissing: true,
});
if (kms.Key.isLookupDummy(dummy)) {
// alternative process
}
```
## Key Policies
Controlling access and usage of KMS Keys requires the use of key policies (resource-based policies attached to the key);
this is in contrast to most other AWS resources where access can be entirely controlled with IAM policies,
and optionally complemented with resource policies. For more in-depth understanding of KMS key access and policies, see
* https://docs.aws.amazon.com/kms/latest/developerguide/control-access-overview.html
* https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html
KMS keys can be created to trust IAM policies. This is the default behavior for both the KMS APIs and in
the console. This behavior is enabled by the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag,
which is set for all new projects; for existing projects, this same behavior can be enabled by
passing the `trustAccountIdentities` property as `true` when creating the key:
```ts
new kms.Key(this, 'MyKey', { trustAccountIdentities: true });
```
With either the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag set,
or the `trustAccountIdentities` prop set, the Key will be given the following default key policy:
```json
{
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::111122223333:root"},
"Action": "kms:*",
"Resource": "*"
}
```
This policy grants full access to the key to the root account user.
This enables the root account user -- via IAM policies -- to grant access to other IAM principals.
With the above default policy, future permissions can be added to either the key policy or IAM principal policy.
```ts
const key = new kms.Key(this, 'MyKey');
const user = new iam.User(this, 'MyUser');
key.grants.encrypt(user); // Adds encrypt permissions to user policy; key policy is unmodified.
```
Adopting the default KMS key policy (and so trusting account identities)
solves many issues around cyclic dependencies between stacks.
Without this default key policy, future permissions must be added to both the key policy and IAM principal policy,
which can cause cyclic dependencies if the permissions cross stack boundaries.
(For example, an encrypted bucket in one stack, and Lambda function that accesses it in another.)
### Appending to or replacing the default key policy
The default key policy can be amended or replaced entirely, depending on your use case and requirements.
A common addition to the key policy would be to add other key admins that are allowed to administer the key
(e.g., change permissions, revoke, delete). Additional key admins can be specified at key creation or after
via the `key.grants.admin` method.
```ts
const myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');
const key = new kms.Key(this, 'MyKey', {
admins: [myTrustedAdminRole],
});
const secondKey = new kms.Key(this, 'MyKey2');
secondKey.grants.admin(myTrustedAdminRole);
```
Alternatively, a custom key policy can be specified, which will replace the default key policy.
> **Note**: In applications without the '@aws-cdk/aws-kms:defaultKeyPolicies' feature flag set
and with `trustedAccountIdentities` set to false (the default), specifying a policy at key creation _appends_ the
provided policy to the default key policy, rather than _replacing_ the default policy.
```ts
const myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');
// Creates a limited admin policy and assigns to the account root.
const myCustomPolicy = new iam.PolicyDocument({
statements: [new iam.PolicyStatement({
actions: [
'kms:Create*',
'kms:Describe*',
'kms:Enable*',
'kms:List*',
'kms:Put*',
],
principals: [new iam.AccountRootPrincipal()],
resources: ['*'],
})],
});
const key = new kms.Key(this, 'MyKey', {
policy: myCustomPolicy,
});
```
> **Warning:** Replacing the default key policy with one that only grants access to a specific user or role
runs the risk of the key becoming unmanageable if that user or role is deleted.
It is highly recommended that the key policy grants access to the account root, rather than specific principals.
See https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html for more information.
### Signing and Verification key policies
Creating signatures and verifying them with KMS requires specific permissions.
The respective policies can be attached to a principal via the `key.grants.sign` and `key.grants.verify` methods.
```ts
const key = new kms.Key(this, 'MyKey');
const user = new iam.User(this, 'MyUser');
key.grants.sign(user); // Adds 'kms:Sign' to the principal's policy
key.grants.verify(user); // Adds 'kms:Verify' to the principal's policy
```
If both sign and verify permissions are required, they can be applied with one method in `KeyGrants` called `signVerify`.
```ts
const key = new kms.Key(this, 'MyKey');
const user = new iam.User(this, 'MyUser');
key.grants.signVerify(user); // Adds 'kms:Sign' and 'kms:Verify' to the principal's policy
```
### HMAC specific key policies
HMAC keys have a different key policy than other KMS keys. They have a policy for generating and for verifying a MAC.
The respective policies can be attached to a principal via the `generateMac` and `verifyMac` methods in `KeyGrants`.
```ts
const key = new kms.Key(this, 'MyKey');
const user = new iam.User(this, 'MyUser');
key.grants.generateMac(user); // Adds 'kms:GenerateMac' to the principal's policy
key.grants.verifyMac(user); // Adds 'kms:VerifyMac' to the principal's policy
```
### Granting permissions for L1s
The examples above show how to use the `KeyGrants` methods to grant permissions to principals.
If you are using L1 constructs that require permissions to be granted to a principal, you can
use the `KeyGrants` utility class:
```ts
declare const principal: iam.IPrincipal;
declare const key: kms.IKeyRef; // can be either an L1 or L2
kms.KeyGrants.fromKey(key).sign(principal);
```
If `key` is an instance of `CfnKey`, and the grants process involves adding statements
to the key policy, then the `KeyGrants` class will, by default, do the same thing it
would do for an instance of `Key`: add statements to the `keyPolicy` property.
But if you want to customize this behavior, you can register an instance of `IResourcePolicyFactory`
for the `AWS::KMS::Key` CloudFormation type:
```ts nofixture
import { CfnResource } from 'aws-cdk-lib';
import { IResourcePolicyFactory, IResourceWithPolicyV2, PolicyStatement, ResourceWithPolicies } from 'aws-cdk-lib/aws-iam';
import { Construct, IConstruct } from 'constructs';
declare const scope: Construct;
class MyFactory implements IResourcePolicyFactory {
forResource(resource: CfnResource): IResourceWithPolicyV2 {
return {
env: resource.env,
addToResourcePolicy(statement: PolicyStatement) {
// custom implementation to add the statement to the resource policy
return { statementAdded: true, policyDependable: resource };
}
}
}
}
ResourceWithPolicies.register(scope, 'AWS::KMS::Key', new MyFactory());
```
`IResourcePolicyFactory` is responsible for converting a construct into a `IResourceWithPolicyV2`,
effectively providing an ad-hoc way to extend the behavior of L1s to support grants the same way
as L2s do.

1
cdk/node_modules/aws-cdk-lib/aws-kms/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './lib';

1
cdk/node_modules/aws-cdk-lib/aws-kms/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.KeySpec=void 0,Object.defineProperty(exports,_noFold="KeySpec",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").KeySpec;return Object.defineProperty(exports,_noFold="KeySpec",{enumerable:!0,configurable:!0,value}),value}}),exports.KeyUsage=void 0,Object.defineProperty(exports,_noFold="KeyUsage",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").KeyUsage;return Object.defineProperty(exports,_noFold="KeyUsage",{enumerable:!0,configurable:!0,value}),value}}),exports.Key=void 0,Object.defineProperty(exports,_noFold="Key",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").Key;return Object.defineProperty(exports,_noFold="Key",{enumerable:!0,configurable:!0,value}),value}}),exports.KeyGrants=void 0,Object.defineProperty(exports,_noFold="KeyGrants",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").KeyGrants;return Object.defineProperty(exports,_noFold="KeyGrants",{enumerable:!0,configurable:!0,value}),value}}),exports.Alias=void 0,Object.defineProperty(exports,_noFold="Alias",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").Alias;return Object.defineProperty(exports,_noFold="Alias",{enumerable:!0,configurable:!0,value}),value}}),exports.ViaServicePrincipal=void 0,Object.defineProperty(exports,_noFold="ViaServicePrincipal",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").ViaServicePrincipal;return Object.defineProperty(exports,_noFold="ViaServicePrincipal",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnAlias=void 0,Object.defineProperty(exports,_noFold="CfnAlias",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnAlias;return Object.defineProperty(exports,_noFold="CfnAlias",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnKey=void 0,Object.defineProperty(exports,_noFold="CfnKey",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnKey;return Object.defineProperty(exports,_noFold="CfnKey",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnReplicaKey=void 0,Object.defineProperty(exports,_noFold="CfnReplicaKey",{enumerable:!0,configurable:!0,get:()=>{var value=require("./lib").CfnReplicaKey;return Object.defineProperty(exports,_noFold="CfnReplicaKey",{enumerable:!0,configurable:!0,value}),value}});

162
cdk/node_modules/aws-cdk-lib/aws-kms/lib/alias.d.ts generated vendored Normal file
View File

@@ -0,0 +1,162 @@
import type { Construct } from 'constructs';
import type { IKey } from './key';
import type { AliasReference, IAliasRef, KeyReference } from './kms.generated';
import * as iam from '../../aws-iam';
import type { RemovalPolicy } from '../../core';
import { Resource } from '../../core';
/**
* A KMS Key alias.
* An alias can be used in all places that expect a key.
*/
export interface IAlias extends IKey, IAliasRef {
/**
* The name of the alias.
*
* @attribute
*/
readonly aliasName: string;
/**
* The Key to which the Alias refers.
*
* @attribute
*/
readonly aliasTargetKey: IKey;
}
/**
* Construction properties for a KMS Key Alias object.
*/
export interface AliasProps {
/**
* The name of the alias. The name must start with alias followed by a
* forward slash, such as alias/. You can't specify aliases that begin with
* alias/AWS. These aliases are reserved.
*/
readonly aliasName: string;
/**
* The ID of the key for which you are creating the alias. Specify the key's
* globally unique identifier or Amazon Resource Name (ARN). You can't
* specify another alias.
*/
readonly targetKey: IKey;
/**
* Policy to apply when the alias is removed from this stack.
*
* @default - The alias will be deleted
*/
readonly removalPolicy?: RemovalPolicy;
}
declare abstract class AliasBase extends Resource implements IAlias {
abstract readonly aliasName: string;
abstract readonly aliasTargetKey: IKey;
get aliasRef(): AliasReference;
get keyRef(): KeyReference;
/**
* The ARN of the alias.
*
* @attribute
* @deprecated use `aliasArn` instead
*/
get keyArn(): string;
/**
* The ARN of the alias.
*
* @attribute
*/
get aliasArn(): string;
get keyId(): string;
addAlias(alias: string): Alias;
addToResourcePolicy(statement: iam.PolicyStatement, allowNoOp?: boolean): iam.AddToResourcePolicyResult;
/**
* [disable-awslint:no-grants]
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantEncrypt(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantEncryptDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantSign(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantVerify(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantSignVerify(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantGenerateMac(grantee: iam.IGrantable): iam.Grant;
/**
* [disable-awslint:no-grants]
*/
grantVerifyMac(grantee: iam.IGrantable): iam.Grant;
}
/**
* Properties of a reference to an existing KMS Alias
*/
export interface AliasAttributes {
/**
* Specifies the alias name. This value must begin with alias/ followed by a name (i.e. alias/ExampleAlias)
*/
readonly aliasName: string;
/**
* The customer master key (CMK) to which the Alias refers.
*/
readonly aliasTargetKey: IKey;
}
/**
* Defines a display name for a customer master key (CMK) in AWS Key Management
* Service (AWS KMS). Using an alias to refer to a key can help you simplify key
* management. For example, when rotating keys, you can just update the alias
* mapping instead of tracking and changing key IDs. For more information, see
* Working with Aliases in the AWS Key Management Service Developer Guide.
*
* You can also add an alias for a key by calling `key.addAlias(alias)`.
*
* @resource AWS::KMS::Alias
*/
export declare class Alias extends AliasBase {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Import an existing KMS Alias defined outside the CDK app.
*
* @param scope The parent creating construct (usually `this`).
* @param id The construct's name.
* @param attrs the properties of the referenced KMS Alias
*/
static fromAliasAttributes(scope: Construct, id: string, attrs: AliasAttributes): IAlias;
/**
* Import an existing KMS Alias defined outside the CDK app, by the alias name. This method should be used
* instead of 'fromAliasAttributes' when the underlying KMS Key ARN is not available.
* This Alias will not have a direct reference to the KMS Key, so addAlias method is not supported.
*
* If the `@aws-cdk/aws-kms:applyImportedAliasPermissionsToPrincipal` feature flag is set to `true`,
* the grant* methods will use the kms:ResourceAliases condition to grant permissions to the specific alias name.
* They will only modify the principal policy, not the key resource policy.
* Without the feature flag `grant*` methods will be a no-op.
*
* @param scope The parent creating construct (usually `this`).
* @param id The construct's name.
* @param aliasName The full name of the KMS Alias (e.g., 'alias/aws/s3', 'alias/myKeyAlias').
*/
static fromAliasName(scope: Construct, id: string, aliasName: string): IAlias;
private readonly resource;
readonly aliasTargetKey: IKey;
get aliasName(): string;
constructor(scope: Construct, id: string, props: AliasProps);
protected generatePhysicalName(): string;
}
export {};

1
cdk/node_modules/aws-cdk-lib/aws-kms/lib/alias.js generated vendored Normal file

File diff suppressed because one or more lines are too long

7
cdk/node_modules/aws-cdk-lib/aws-kms/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import './private/default-traits';
export * from './key';
export * from './key-grants';
export * from './key-lookup';
export * from './alias';
export * from './via-service-principal';
export * from './kms.generated';

1
cdk/node_modules/aws-cdk-lib/aws-kms/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),require("./private/default-traits");var _noFold;exports.KeySpec=void 0,Object.defineProperty(exports,_noFold="KeySpec",{enumerable:!0,configurable:!0,get:()=>{var value=require("./key").KeySpec;return Object.defineProperty(exports,_noFold="KeySpec",{enumerable:!0,configurable:!0,value}),value}}),exports.KeyUsage=void 0,Object.defineProperty(exports,_noFold="KeyUsage",{enumerable:!0,configurable:!0,get:()=>{var value=require("./key").KeyUsage;return Object.defineProperty(exports,_noFold="KeyUsage",{enumerable:!0,configurable:!0,value}),value}}),exports.Key=void 0,Object.defineProperty(exports,_noFold="Key",{enumerable:!0,configurable:!0,get:()=>{var value=require("./key").Key;return Object.defineProperty(exports,_noFold="Key",{enumerable:!0,configurable:!0,value}),value}}),exports.KeyGrants=void 0,Object.defineProperty(exports,_noFold="KeyGrants",{enumerable:!0,configurable:!0,get:()=>{var value=require("./key-grants").KeyGrants;return Object.defineProperty(exports,_noFold="KeyGrants",{enumerable:!0,configurable:!0,value}),value}}),exports.Alias=void 0,Object.defineProperty(exports,_noFold="Alias",{enumerable:!0,configurable:!0,get:()=>{var value=require("./alias").Alias;return Object.defineProperty(exports,_noFold="Alias",{enumerable:!0,configurable:!0,value}),value}}),exports.ViaServicePrincipal=void 0,Object.defineProperty(exports,_noFold="ViaServicePrincipal",{enumerable:!0,configurable:!0,get:()=>{var value=require("./via-service-principal").ViaServicePrincipal;return Object.defineProperty(exports,_noFold="ViaServicePrincipal",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnAlias=void 0,Object.defineProperty(exports,_noFold="CfnAlias",{enumerable:!0,configurable:!0,get:()=>{var value=require("./kms.generated").CfnAlias;return Object.defineProperty(exports,_noFold="CfnAlias",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnKey=void 0,Object.defineProperty(exports,_noFold="CfnKey",{enumerable:!0,configurable:!0,get:()=>{var value=require("./kms.generated").CfnKey;return Object.defineProperty(exports,_noFold="CfnKey",{enumerable:!0,configurable:!0,value}),value}}),exports.CfnReplicaKey=void 0,Object.defineProperty(exports,_noFold="CfnReplicaKey",{enumerable:!0,configurable:!0,get:()=>{var value=require("./kms.generated").CfnReplicaKey;return Object.defineProperty(exports,_noFold="CfnReplicaKey",{enumerable:!0,configurable:!0,value}),value}});

View File

@@ -0,0 +1,75 @@
import type { IGrantable } from '../../aws-iam';
import * as iam from '../../aws-iam';
import type { IKeyRef } from '../../interfaces/generated/aws-kms-interfaces.generated';
/**
* Collection of grant methods for an IKey
*/
export declare class KeyGrants {
/**
* Creates grants for an IKeyRef
*/
static fromKey(resource: IKeyRef, trustAccountIdentities?: boolean): KeyGrants;
protected readonly resource: IKeyRef;
private readonly trustAccountIdentities?;
private readonly policyResource?;
private constructor();
/**
* Grant the indicated permissions on this key to the given principal
*
* This modifies both the principal's policy as well as the resource policy,
* since the default CloudFormation setup for KMS keys is that the policy
* must not be empty and so default grants won't work.
*
*/
actions(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant admins permissions using this key to the given principal
*
* Key administrators have permissions to manage the key (e.g., change permissions, revoke), but do not have permissions
* to use the key in cryptographic operations (e.g., encrypt, decrypt).
*/
admin(grantee: IGrantable): iam.Grant;
/**
* Grant decryption permissions using this key to the given principal
*
*/
decrypt(grantee: IGrantable): iam.Grant;
/**
* Grant encryption permissions using this key to the given principal
*
*/
encrypt(grantee: IGrantable): iam.Grant;
/**
* Grant encryption and decryption permissions using this key to the given principal
*
*/
encryptDecrypt(grantee: IGrantable): iam.Grant;
/**
* Grant sign permissions using this key to the given principal
*
*/
sign(grantee: IGrantable): iam.Grant;
/**
* Grant verify permissions using this key to the given principal
*
*/
verify(grantee: IGrantable): iam.Grant;
/**
* Grant sign and verify permissions using this key to the given principal
*
*/
signVerify(grantee: IGrantable): iam.Grant;
/**
* Grant permissions to generating MACs to the given principal
*
*/
generateMac(grantee: IGrantable): iam.Grant;
/**
* Grant permissions to verifying MACs to the given principal
*
*/
verifyMac(grantee: IGrantable): iam.Grant;
private granteeStackDependsOnKeyStack;
private isGranteeFromAnotherRegion;
private isGranteeFromAnotherAccount;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
/**
* Properties for looking up an existing Key.
*/
export interface KeyLookupOptions {
/**
* The alias name of the Key
*
* Must be in the format `alias/<AliasName>`.
*/
readonly aliasName: string;
/**
* Whether to return a dummy key if the key was not found.
*
* If it is set to `true` and the key was not found, a dummy
* key with a key id '1234abcd-12ab-34cd-56ef-1234567890ab'
* will be returned. The value of the dummy key id can also
* be referenced using the `Key.DEFAULT_DUMMY_KEY_ID` variable,
* and you can check if the key is a dummy key by using the
* `Key.isLookupDummy()` method.
*
* @default false
*/
readonly returnDummyKeyOnMissing?: boolean;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});

531
cdk/node_modules/aws-cdk-lib/aws-kms/lib/key.d.ts generated vendored Normal file
View File

@@ -0,0 +1,531 @@
import type { Construct } from 'constructs';
import { Alias } from './alias';
import { KeyGrants } from './key-grants';
import type { KeyLookupOptions } from './key-lookup';
import type { IKeyRef, KeyReference } from './kms.generated';
import { CfnKey } from './kms.generated';
import * as iam from '../../aws-iam';
import type { Duration, IResource, RemovalPolicy, ResourceProps } from '../../core';
import { Resource } from '../../core';
/**
* A KMS Key, either managed by this CDK app, or imported.
*
* This interface does double duty: it represents an actual KMS keys, but it
* also represents things that can behave like KMS keys, like a key alias.
*/
export interface IKey extends IResource, IKeyRef {
/**
* The ARN of the key.
*
* @attribute
*/
readonly keyArn: string;
/**
* The ID of the key
* (the part that looks something like: 1234abcd-12ab-34cd-56ef-1234567890ab).
*
* @attribute
*/
readonly keyId: string;
/**
* Defines a new alias for the key.
*/
addAlias(alias: string): Alias;
/**
* Adds a statement to the KMS key resource policy.
* @param statement The policy statement to add
* @param allowNoOp If this is set to `false` and there is no policy
* defined (i.e. external key), the operation will fail. Otherwise, it will
* no-op.
*/
addToResourcePolicy(statement: iam.PolicyStatement, allowNoOp?: boolean): iam.AddToResourcePolicyResult;
/**
* Grant the indicated permissions on this key to the given principal
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant decryption permissions using this key to the given principal
*/
grantDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant encryption permissions using this key to the given principal
*/
grantEncrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant encryption and decryption permissions using this key to the given principal
*/
grantEncryptDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant sign permissions using this key to the given principal
*/
grantSign(grantee: iam.IGrantable): iam.Grant;
/**
* Grant verify permissions using this key to the given principal
*/
grantVerify(grantee: iam.IGrantable): iam.Grant;
/**
* Grant sign and verify permissions using this key to the given principal
*/
grantSignVerify(grantee: iam.IGrantable): iam.Grant;
/**
* Grant permissions to generating MACs to the given principal
*/
grantGenerateMac(grantee: iam.IGrantable): iam.Grant;
/**
* Grant permissions to verifying MACs to the given principal
*/
grantVerifyMac(grantee: iam.IGrantable): iam.Grant;
}
declare abstract class KeyBase extends Resource implements IKey {
/**
* The ARN of the key.
*/
abstract readonly keyArn: string;
abstract readonly keyId: string;
/**
* Optional policy document that represents the resource policy of this key.
*
* If specified, addToResourcePolicy can be used to edit this policy.
* Otherwise this method will no-op.
*/
protected abstract readonly policy?: iam.PolicyDocument;
/**
* Optional property to control trusting account identities.
*
* If specified, grants will default identity policies instead of to both
* resource and identity policies. This matches the default behavior when creating
* KMS keys via the API or console.
*/
protected abstract readonly trustAccountIdentities: boolean;
/**
* Collection of aliases added to the key
*
* Tracked to determine whether or not the aliasName should be added to the end of its ID
*/
private readonly aliases;
constructor(scope: Construct, id: string, props?: ResourceProps);
get keyRef(): KeyReference;
/**
* Collection of grant methods for a Key
*/
get grants(): KeyGrants;
/**
* Defines a new alias for the key.
*/
addAlias(aliasName: string): Alias;
/**
* Adds a statement to the KMS key resource policy.
* @param statement The policy statement to add
* @param allowNoOp If this is set to `false` and there is no policy
* defined (i.e. external key), the operation will fail. Otherwise, it will
* no-op.
*/
addToResourcePolicy(statement: iam.PolicyStatement, allowNoOp?: boolean): iam.AddToResourcePolicyResult;
/**
* Grant the indicated permissions on this key to the given principal
*
* This modifies both the principal's policy as well as the resource policy,
* since the default CloudFormation setup for KMS keys is that the policy
* must not be empty and so default grants won't work.
*
* [disable-awslint:no-grants]
*/
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant decryption permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant encryption permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantEncrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant encryption and decryption permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantEncryptDecrypt(grantee: iam.IGrantable): iam.Grant;
/**
* Grant sign permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantSign(grantee: iam.IGrantable): iam.Grant;
/**
* Grant verify permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantVerify(grantee: iam.IGrantable): iam.Grant;
/**
* Grant sign and verify permissions using this key to the given principal
*
* [disable-awslint:no-grants]
*/
grantSignVerify(grantee: iam.IGrantable): iam.Grant;
/**
* Grant permissions to generating MACs to the given principal
*
* [disable-awslint:no-grants]
*/
grantGenerateMac(grantee: iam.IGrantable): iam.Grant;
/**
* Grant permissions to verifying MACs to the given principal
*
* [disable-awslint:no-grants]
*/
grantVerifyMac(grantee: iam.IGrantable): iam.Grant;
}
/**
* The key spec, represents the cryptographic configuration of keys.
*/
export declare enum KeySpec {
/**
* The default key spec.
*
* Valid usage: ENCRYPT_DECRYPT
*/
SYMMETRIC_DEFAULT = "SYMMETRIC_DEFAULT",
/**
* RSA with 2048 bits of key.
*
* Valid usage: ENCRYPT_DECRYPT and SIGN_VERIFY
*/
RSA_2048 = "RSA_2048",
/**
* RSA with 3072 bits of key.
*
* Valid usage: ENCRYPT_DECRYPT and SIGN_VERIFY
*/
RSA_3072 = "RSA_3072",
/**
* RSA with 4096 bits of key.
*
* Valid usage: ENCRYPT_DECRYPT and SIGN_VERIFY
*/
RSA_4096 = "RSA_4096",
/**
* NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and
* SHA-256 for the message digest.
*
* Valid usage: SIGN_VERIFY
*/
ECC_NIST_P256 = "ECC_NIST_P256",
/**
* NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and
* SHA-384 for the message digest.
*
* Valid usage: SIGN_VERIFY
*/
ECC_NIST_P384 = "ECC_NIST_P384",
/**
* NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and
* SHA-512 for the message digest.
*
* Valid usage: SIGN_VERIFY
*/
ECC_NIST_P521 = "ECC_NIST_P521",
/**
* Standards for Efficient Cryptography 2, Section 2.4.1, ECDSA signature on the Koblitz curve.
*
* Valid usage: SIGN_VERIFY
*/
ECC_SECG_P256K1 = "ECC_SECG_P256K1",
/**
* Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA224.
*
* Valid usage: GENERATE_VERIFY_MAC
*/
HMAC_224 = "HMAC_224",
/**
* Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA256.
*
* Valid usage: GENERATE_VERIFY_MAC
*/
HMAC_256 = "HMAC_256",
/**
* Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA384.
*
* Valid usage: GENERATE_VERIFY_MAC
*/
HMAC_384 = "HMAC_384",
/**
* Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA512.
*
* Valid usage: GENERATE_VERIFY_MAC
*/
HMAC_512 = "HMAC_512",
/**
* Elliptic curve key spec available only in China Regions.
*
* Valid usage: ENCRYPT_DECRYPT and SIGN_VERIFY
*/
SM2 = "SM2",
/**
* ML-DSA-44 lattice-based digital signature algorithm.
*
* Valid usage: SIGN_VERIFY
*/
ML_DSA_44 = "ML_DSA_44",
/**
* ML-DSA-65 lattice-based digital signature algorithm.
*
* Valid usage: SIGN_VERIFY
*/
ML_DSA_65 = "ML_DSA_65",
/**
* ML-DSA-87 lattice-based digital signature algorithm.
*
* Valid usage: SIGN_VERIFY
*/
ML_DSA_87 = "ML_DSA_87",
/**
* NIST-standard Edwards25519 (ed25519) elliptic curve key pair.
*
* Valid usage: SIGN_VERIFY
*/
ECC_NIST_EDWARDS25519 = "ECC_NIST_EDWARDS25519"
}
/**
* The key usage, represents the cryptographic operations of keys.
*/
export declare enum KeyUsage {
/**
* Encryption and decryption.
*/
ENCRYPT_DECRYPT = "ENCRYPT_DECRYPT",
/**
* Signing and verification
*/
SIGN_VERIFY = "SIGN_VERIFY",
/**
* Generating and verifying MACs
*/
GENERATE_VERIFY_MAC = "GENERATE_VERIFY_MAC",
/**
* Deriving shared secrets
*/
KEY_AGREEMENT = "KEY_AGREEMENT"
}
/**
* Construction properties for a KMS Key object
*/
export interface KeyProps {
/**
* A description of the key. Use a description that helps your users decide
* whether the key is appropriate for a particular task.
*
* @default - No description.
*/
readonly description?: string;
/**
* Initial alias to add to the key
*
* More aliases can be added later by calling `addAlias`.
*
* @default - No alias is added for the key.
*/
readonly alias?: string;
/**
* Indicates whether AWS KMS rotates the key.
*
* @default false
*/
readonly enableKeyRotation?: boolean;
/**
* The period between each automatic rotation.
*
* @default - set by CFN to 365 days.
*/
readonly rotationPeriod?: Duration;
/**
* Indicates whether the key is available for use.
*
* @default - Key is enabled.
*/
readonly enabled?: boolean;
/**
* The cryptographic configuration of the key. The valid value depends on usage of the key.
*
* IMPORTANT: If you change this property of an existing key, the existing key is scheduled for deletion
* and a new key is created with the specified value.
*
* @default KeySpec.SYMMETRIC_DEFAULT
*/
readonly keySpec?: KeySpec;
/**
* The cryptographic operations for which the key can be used.
*
* IMPORTANT: If you change this property of an existing key, the existing key is scheduled for deletion
* and a new key is created with the specified value.
*
* @default KeyUsage.ENCRYPT_DECRYPT
*/
readonly keyUsage?: KeyUsage;
/**
* Creates a multi-Region primary key that you can replicate in other AWS Regions.
*
* You can't change the `multiRegion` value after the KMS key is created.
*
* IMPORTANT: If you change the value of the `multiRegion` property on an existing KMS key, the update request fails,
* regardless of the value of the UpdateReplacePolicy attribute.
* This prevents you from accidentally deleting a KMS key by changing an immutable property value.
*
* @default false
* @see https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html
*/
readonly multiRegion?: boolean;
/**
* Custom policy document to attach to the KMS key.
*
* NOTE - If the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag is set (the default for new projects),
* this policy will *override* the default key policy and become the only key policy for the key. If the
* feature flag is not set, this policy will be appended to the default key policy.
*
* @default - A policy document with permissions for the account root to
* administer the key will be created.
*/
readonly policy?: iam.PolicyDocument;
/**
* A list of principals to add as key administrators to the key policy.
*
* Key administrators have permissions to manage the key (e.g., change permissions, revoke), but do not have permissions
* to use the key in cryptographic operations (e.g., encrypt, decrypt).
*
* These principals will be added to the default key policy (if none specified), or to the specified policy (if provided).
*
* @default []
*/
readonly admins?: iam.IPrincipal[];
/**
* Whether the encryption key should be retained when it is removed from the Stack. This is useful when one wants to
* retain access to data that was encrypted with a key that is being retired.
*
* @default RemovalPolicy.Retain
*/
readonly removalPolicy?: RemovalPolicy;
/**
* Specifies the number of days in the waiting period before
* AWS KMS deletes a CMK that has been removed from a CloudFormation stack.
*
* When you remove a customer master key (CMK) from a CloudFormation stack, AWS KMS schedules the CMK for deletion
* and starts the mandatory waiting period. The PendingWindowInDays property determines the length of waiting period.
* During the waiting period, the key state of CMK is Pending Deletion, which prevents the CMK from being used in
* cryptographic operations. When the waiting period expires, AWS KMS permanently deletes the CMK.
*
* Enter a value between 7 and 30 days.
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-pendingwindowindays
* @default - 30 days
*/
readonly pendingWindow?: Duration;
}
/**
* Defines a KMS key.
*
* @resource AWS::KMS::Key
*/
export declare class Key extends KeyBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* The default key id of the dummy key.
*
* This value is used as a dummy key id if the key was not found
* by the `Key.fromLookup()` method.
*/
static readonly DEFAULT_DUMMY_KEY_ID = "1234abcd-12ab-34cd-56ef-1234567890ab";
/**
* Import an externally defined KMS Key using its ARN.
*
* @param scope the construct that will "own" the imported key.
* @param id the id of the imported key in the construct tree.
* @param keyArn the ARN of an existing KMS key.
*/
static fromKeyArn(scope: Construct, id: string, keyArn: string): IKey;
/**
* Create a mutable `IKey` based on a low-level `CfnKey`.
* This is most useful when combined with the cloudformation-include module.
* This method is different than `fromKeyArn()` because the `IKey`
* returned from this method is mutable;
* meaning, calling any mutating methods on it,
* like `IKey.addToResourcePolicy()`,
* will actually be reflected in the resulting template,
* as opposed to the object returned from `fromKeyArn()`,
* on which calling those methods would have no effect.
*/
static fromCfnKey(cfnKey: CfnKey): IKey;
/**
* Import an existing Key by querying the AWS environment this stack is deployed to.
*
* This function only needs to be used to use Keys not defined in your CDK
* application. If you are looking to share a Key between stacks, you can
* pass the `Key` object between stacks and use it as normal. In addition,
* it's not necessary to use this method if an interface accepts an `IKey`.
* In this case, `Alias.fromAliasName()` can be used which returns an alias
* that extends `IKey`.
*
* Calling this method will lead to a lookup when the CDK CLI is executed.
* You can therefore not use any values that will only be available at
* CloudFormation execution time (i.e., Tokens).
*
* If you set `returnDummyKeyOnMissing` to `true` in `options` and the key was not found,
* this method will return a dummy key with a key id '1234abcd-12ab-34cd-56ef-1234567890ab'.
* The value of the dummy key id can also be referenced using the `Key.DEFAULT_DUMMY_KEY_ID`
* variable, and you can check if the key is a dummy key by using the `Key.isLookupDummy()`
* method.
*
* The Key information will be cached in `cdk.context.json` and the same Key
* will be used on future runs. To refresh the lookup, you will have to
* evict the value from the cache using the `cdk context` command. See
* https://docs.aws.amazon.com/cdk/latest/guide/context.html for more information.
*/
static fromLookup(scope: Construct, id: string, options: KeyLookupOptions): IKey;
/**
* Checks if the key returned by the `Key.fromLookup()` method is a dummy key,
* i.e., a key that was not found.
*
* This method can only be used if the `returnDummyKeyOnMissing` option
* is set to `true` in the `options` for the `Key.fromLookup()` method.
*/
static isLookupDummy(key: IKeyRef): boolean;
readonly keyArn: string;
readonly keyId: string;
protected readonly policy?: iam.PolicyDocument;
protected readonly trustAccountIdentities: boolean;
private readonly enableKeyRotation?;
constructor(scope: Construct, id: string, props?: KeyProps);
/**
* Grant admins permissions using this key to the given principal
*
* Key administrators have permissions to manage the key (e.g., change permissions, revoke), but do not have permissions
* to use the key in cryptographic operations (e.g., encrypt, decrypt).
*
* [disable-awslint:no-grants]
*/
grantAdmin(grantee: iam.IGrantable): iam.Grant;
/**
* Adds the default key policy to the key. This policy gives the AWS account (root user) full access to the CMK,
* which reduces the risk of the CMK becoming unmanageable and enables IAM policies to allow access to the CMK.
* This is the same policy that is default when creating a Key via the KMS API or Console.
* @see https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
*/
private addDefaultAdminPolicy;
/**
* Grants the account admin privileges -- not full account access -- plus the GenerateDataKey action.
* The GenerateDataKey action was added for interop with S3 in https://github.com/aws/aws-cdk/issues/3458.
*
* This policy is discouraged and deprecated by the `@aws-cdk/aws-kms:defaultKeyPolicies` feature flag.
*
* @link https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default
* @deprecated
*/
private addLegacyAdminPolicy;
}
export {};

1
cdk/node_modules/aws-cdk-lib/aws-kms/lib/key.js generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
export interface MetricWithDims<D> {
readonly namespace: string;
readonly metricName: string;
readonly statistic: string;
readonly dimensionsMap: D;
}
export declare class KMSMetrics {
static secondsUntilKeyMaterialExpirationAverage(this: void, dimensions: {
KeyId: string;
}): MetricWithDims<{
KeyId: string;
}>;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KMSMetrics=void 0;class KMSMetrics{static secondsUntilKeyMaterialExpirationAverage(dimensions){return{namespace:"AWS/KMS",metricName:"SecondsUntilKeyMaterialExpiration",dimensionsMap:dimensions,statistic:"Average"}}}exports.KMSMetrics=KMSMetrics;

View File

@@ -0,0 +1,841 @@
import * as cdk from "../../core/lib";
import * as constructs from "constructs";
import * as cfn_parse from "../../core/lib/helpers-internal";
import { aws_kms as kmsRefs } from "../../interfaces";
import { AliasReference, IAliasRef, IKeyRef, IReplicaKeyRef, KeyReference, ReplicaKeyReference } from "../../interfaces/generated/aws-kms-interfaces.generated";
/**
* The `AWS::KMS::Alias` resource specifies a display name for a [KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys) . You can use an alias to identify a KMS key in the AWS console, in the [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html) operation, and in [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) , such as [Decrypt](https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html) and [GenerateDataKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html) .
*
* > Adding, deleting, or updating an alias can allow or deny permission to the KMS key. For details, see [ABAC for AWS](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the *AWS Key Management Service Developer Guide* .
*
* Using an alias to refer to a KMS key can help you simplify key management. For example, an alias in your code can be associated with different KMS keys in different AWS Regions . For more information, see [Using aliases](https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) in the *AWS Key Management Service Developer Guide* .
*
* When specifying an alias, observe the following rules.
*
* - Each alias is associated with one KMS key, but multiple aliases can be associated with the same KMS key.
* - The alias and its associated KMS key must be in the same AWS account and Region.
* - The alias name must be unique in the AWS account and Region. However, you can create aliases with the same name in different AWS Regions . For example, you can have an `alias/projectKey` in multiple Regions, each of which is associated with a KMS key in its Region.
* - Each alias name must begin with `alias/` followed by a name, such as `alias/exampleKey` . The alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). Alias names cannot begin with `alias/aws/` . That alias name prefix is reserved for [AWS managed keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) .
*
* *Regions*
*
* AWS CloudFormation resources are available in all AWS Regions in which AWS and CloudFormation are supported.
*
* @cloudformationResource AWS::KMS::Alias
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html
*/
export declare class CfnAlias extends cdk.CfnResource implements cdk.IInspectable, IAliasRef {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME: string;
/**
* Build a CfnAlias from CloudFormation properties
*
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnAlias;
/**
* Checks whether the given object is a CfnAlias
*/
static isCfnAlias(x: any): x is CfnAlias;
/**
* Specifies the alias name. This value must begin with `alias/` followed by a name, such as `alias/ExampleAlias` .
*/
private _aliasName;
/**
* Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) . The KMS key must be in the same AWS account and Region.
*/
private _targetKeyId;
protected readonly cfnPropertyNames: Record<string, string>;
/**
* Create a new `AWS::KMS::Alias`.
*
* @param scope Scope in which this resource is defined
* @param id Construct identifier for this resource (unique in its scope)
* @param props Resource properties
*/
constructor(scope: constructs.Construct, id: string, props: CfnAliasProps);
get aliasRef(): AliasReference;
/**
* Specifies the alias name. This value must begin with `alias/` followed by a name, such as `alias/ExampleAlias` .
*/
get aliasName(): string;
/**
* Specifies the alias name. This value must begin with `alias/` followed by a name, such as `alias/ExampleAlias` .
*/
set aliasName(value: string);
/**
* Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) . The KMS key must be in the same AWS account and Region.
*/
get targetKeyId(): string;
/**
* Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) . The KMS key must be in the same AWS account and Region.
*/
set targetKeyId(value: string);
protected get cfnProperties(): Record<string, any>;
/**
* Examines the CloudFormation resource and discloses attributes
*
* @param inspector tree inspector to collect and process attributes
*/
inspect(inspector: cdk.TreeInspector): void;
protected renderProperties(props: Record<string, any>): Record<string, any>;
}
/**
* Properties for defining a `CfnAlias`
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html
*/
export interface CfnAliasProps {
/**
* Specifies the alias name. This value must begin with `alias/` followed by a name, such as `alias/ExampleAlias` .
*
* > If you change the value of the `AliasName` property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC).
*
* The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin with `alias/aws/` . The `alias/aws/` prefix is reserved for [AWS managed keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-aliasname
*/
readonly aliasName: string;
/**
* Associates the alias with the specified [customer managed key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) . The KMS key must be in the same AWS account and Region.
*
* A valid key ID is required. If you supply a null or empty string value, this operation returns an error.
*
* For help finding the key ID and ARN, see [Finding the key ID and ARN](https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) in the *AWS Key Management Service Developer Guide* .
*
* Specify the key ID or the key ARN of the KMS key.
*
* For example:
*
* - Key ID: `1234abcd-12ab-34cd-56ef-1234567890ab`
* - Key ARN: `arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`
*
* To get the key ID and key ARN for a KMS key, use [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) or [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html) .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-alias.html#cfn-kms-alias-targetkeyid
*/
readonly targetKeyId: kmsRefs.IKeyRef | kmsRefs.IReplicaKeyRef | string;
}
/**
* The `AWS::KMS::Key` resource specifies an [KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys) in AWS Key Management Service . You can use this resource to create symmetric encryption KMS keys, asymmetric KMS keys for encryption or signing, and symmetric HMAC KMS keys. You can use `AWS::KMS::Key` to create [multi-Region primary keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-primary-key) of all supported types. To replicate a multi-Region key, use the `AWS::KMS::ReplicaKey` resource.
*
* > If you change the value of the `KeySpec` , `KeyUsage` , `Origin` , or `MultiRegion` properties of an existing KMS key, the update request fails, regardless of the value of the [`UpdateReplacePolicy` attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) . This prevents you from accidentally deleting a KMS key by changing any of its immutable property values. > AWS replaced the term *customer master key (CMK)* with *AWS KMS key* and *KMS key* . The concept has not changed. To prevent breaking changes, AWS is keeping some variations of this term.
*
* You can use symmetric encryption KMS keys to encrypt and decrypt small amounts of data, but they are more commonly used to generate data keys and data key pairs. You can also use a symmetric encryption KMS key to encrypt data stored in AWS services that are [integrated with AWS](https://docs.aws.amazon.com//kms/features/#AWS_Service_Integration) . For more information, see [Symmetric encryption KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#symmetric-cmks) in the *AWS Key Management Service Developer Guide* .
*
* You can use asymmetric KMS keys to encrypt and decrypt data or sign messages and verify signatures. To create an asymmetric key, you must specify an asymmetric `KeySpec` value and a `KeyUsage` value. For details, see [Asymmetric keys in AWS](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) in the *AWS Key Management Service Developer Guide* .
*
* You can use HMAC KMS keys (which are also symmetric keys) to generate and verify hash-based message authentication codes. To create an HMAC key, you must specify an HMAC `KeySpec` value and a `KeyUsage` value of `GENERATE_VERIFY_MAC` . For details, see [HMAC keys in AWS](https://docs.aws.amazon.com/kms/latest/developerguide/hmac.html) in the *AWS Key Management Service Developer Guide* .
*
* You can also create symmetric encryption, asymmetric, and HMAC multi-Region primary keys. To create a multi-Region primary key, set the `MultiRegion` property to `true` . For information about multi-Region keys, see [Multi-Region keys in AWS](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *AWS Key Management Service Developer Guide* .
*
* You cannot use the `AWS::KMS::Key` resource to specify a KMS key with [imported key material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) or a KMS key in a [custom key store](https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) .
*
* *Regions*
*
* AWS CloudFormation resources are available in all Regions in which AWS and CloudFormation are supported. You can use the `AWS::KMS::Key` resource to create and manage all KMS key types that are supported in a Region.
*
* @cloudformationResource AWS::KMS::Key
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html
*/
export declare class CfnKey extends cdk.CfnResource implements cdk.IInspectable, IKeyRef, cdk.ITaggable {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME: string;
/**
* Build a CfnKey from CloudFormation properties
*
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnKey;
/**
* Checks whether the given object is a CfnKey
*/
static isCfnKey(x: any): x is CfnKey;
/**
* Creates a new IKeyRef from an ARN
*/
static fromKeyArn(scope: constructs.Construct, id: string, arn: string): IKeyRef;
/**
* Creates a new IKeyRef from a keyId
*/
static fromKeyId(scope: constructs.Construct, id: string, keyId: string): IKeyRef;
static arnForKey(resource: IKeyRef): string;
/**
* Skips ("bypasses") the key policy lockout safety check. The default value is false.
*/
private _bypassPolicyLockoutSafetyCheck?;
/**
* A description of the KMS key.
*/
private _description?;
/**
* Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
private _enabled?;
/**
* Enables automatic rotation of the key material for the specified KMS key.
*/
private _enableKeyRotation?;
/**
* The key policy to attach to the KMS key.
*/
private _keyPolicy?;
/**
* Specifies the type of KMS key to create.
*/
private _keySpec?;
/**
* Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key. The default value is `ENCRYPT_DECRYPT` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the `KeyUsage` value after the KMS key is created.
*/
private _keyUsage?;
/**
* Creates a multi-Region primary key that you can replicate in other AWS Regions .
*/
private _multiRegion?;
/**
* The source of the key material for the KMS key.
*/
private _origin?;
/**
* Specifies the number of days in the waiting period before AWS deletes a KMS key that has been removed from a CloudFormation stack.
*/
private _pendingWindowInDays?;
/**
* Specifies a custom period of time between each rotation date.
*/
private _rotationPeriodInDays?;
/**
* Tag Manager which manages the tags for this resource
*/
readonly tags: cdk.TagManager;
/**
* Assigns one or more tags to the replica key.
*/
private _tagsRaw?;
protected readonly cfnPropertyNames: Record<string, string>;
/**
* Create a new `AWS::KMS::Key`.
*
* @param scope Scope in which this resource is defined
* @param id Construct identifier for this resource (unique in its scope)
* @param props Resource properties
*/
constructor(scope: constructs.Construct, id: string, props?: CfnKeyProps);
get keyRef(): KeyReference;
/**
* Skips ("bypasses") the key policy lockout safety check. The default value is false.
*/
get bypassPolicyLockoutSafetyCheck(): boolean | cdk.IResolvable | undefined;
/**
* Skips ("bypasses") the key policy lockout safety check. The default value is false.
*/
set bypassPolicyLockoutSafetyCheck(value: boolean | cdk.IResolvable | undefined);
/**
* A description of the KMS key.
*/
get description(): string | undefined;
/**
* A description of the KMS key.
*/
set description(value: string | undefined);
/**
* Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
get enabled(): boolean | cdk.IResolvable | undefined;
/**
* Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
set enabled(value: boolean | cdk.IResolvable | undefined);
/**
* Enables automatic rotation of the key material for the specified KMS key.
*/
get enableKeyRotation(): boolean | cdk.IResolvable | undefined;
/**
* Enables automatic rotation of the key material for the specified KMS key.
*/
set enableKeyRotation(value: boolean | cdk.IResolvable | undefined);
/**
* The key policy to attach to the KMS key.
*/
get keyPolicy(): any | cdk.IResolvable | undefined;
/**
* The key policy to attach to the KMS key.
*/
set keyPolicy(value: any | cdk.IResolvable | undefined);
/**
* Specifies the type of KMS key to create.
*/
get keySpec(): string | undefined;
/**
* Specifies the type of KMS key to create.
*/
set keySpec(value: string | undefined);
/**
* Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key. The default value is `ENCRYPT_DECRYPT` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the `KeyUsage` value after the KMS key is created.
*/
get keyUsage(): string | undefined;
/**
* Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key. The default value is `ENCRYPT_DECRYPT` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the `KeyUsage` value after the KMS key is created.
*/
set keyUsage(value: string | undefined);
/**
* Creates a multi-Region primary key that you can replicate in other AWS Regions .
*/
get multiRegion(): boolean | cdk.IResolvable | undefined;
/**
* Creates a multi-Region primary key that you can replicate in other AWS Regions .
*/
set multiRegion(value: boolean | cdk.IResolvable | undefined);
/**
* The source of the key material for the KMS key.
*/
get origin(): string | undefined;
/**
* The source of the key material for the KMS key.
*/
set origin(value: string | undefined);
/**
* Specifies the number of days in the waiting period before AWS deletes a KMS key that has been removed from a CloudFormation stack.
*/
get pendingWindowInDays(): number | undefined;
/**
* Specifies the number of days in the waiting period before AWS deletes a KMS key that has been removed from a CloudFormation stack.
*/
set pendingWindowInDays(value: number | undefined);
/**
* Specifies a custom period of time between each rotation date.
*/
get rotationPeriodInDays(): number | undefined;
/**
* Specifies a custom period of time between each rotation date.
*/
set rotationPeriodInDays(value: number | undefined);
/**
* Assigns one or more tags to the replica key.
*/
get tagsRaw(): Array<cdk.CfnTag> | undefined;
/**
* Assigns one or more tags to the replica key.
*/
set tagsRaw(value: Array<cdk.CfnTag> | undefined);
/**
* The Amazon Resource Name (ARN) of the KMS key, such as `arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab` .
*
* For information about the key ARN of a KMS key, see [Key ARN](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-ARN) in the *AWS Key Management Service Developer Guide* .
*
* @cloudformationAttribute Arn
*/
get attrArn(): string;
/**
* The key ID of the KMS key, such as `1234abcd-12ab-34cd-56ef-1234567890ab` .
*
* For information about the key ID of a KMS key, see [Key ID](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#key-id-key-id) in the *AWS Key Management Service Developer Guide* .
*
* @cloudformationAttribute KeyId
*/
get attrKeyId(): string;
protected get cfnProperties(): Record<string, any>;
/**
* Examines the CloudFormation resource and discloses attributes
*
* @param inspector tree inspector to collect and process attributes
*/
inspect(inspector: cdk.TreeInspector): void;
protected renderProperties(props: Record<string, any>): Record<string, any>;
}
/**
* Properties for defining a `CfnKey`
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html
*/
export interface CfnKeyProps {
/**
* Skips ("bypasses") the key policy lockout safety check. The default value is false.
*
* > Setting this value to true increases the risk that the KMS key becomes unmanageable. Do not set this value to true indiscriminately.
* >
* > For more information, see [Default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key) in the *AWS Key Management Service Developer Guide* .
*
* Use this parameter only when you intend to prevent the principal that is making the request from making a subsequent [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key.
*
* @default - false
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-bypasspolicylockoutsafetycheck
*/
readonly bypassPolicyLockoutSafetyCheck?: boolean | cdk.IResolvable;
/**
* A description of the KMS key.
*
* Use a description that helps you to distinguish this KMS key from others in the account, such as its intended use.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-description
*/
readonly description?: string;
/**
* Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*
* When `Enabled` is `true` , the *key state* of the KMS key is `Enabled` . When `Enabled` is `false` , the key state of the KMS key is `Disabled` . The default value is `true` .
*
* The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html) , [DisableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html) , or [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operations.
*
* For information about the key states of a KMS key, see [Key state: Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *AWS Key Management Service Developer Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enabled
*/
readonly enabled?: boolean | cdk.IResolvable;
/**
* Enables automatic rotation of the key material for the specified KMS key.
*
* By default, automatic key rotation is not enabled.
*
* AWS supports automatic rotation only for symmetric encryption KMS keys ( `KeySpec` = `SYMMETRIC_DEFAULT` ). For asymmetric KMS keys, HMAC KMS keys, and KMS keys with Origin `EXTERNAL` , omit the `EnableKeyRotation` property or set it to `false` .
*
* To enable automatic key rotation of the key material for a multi-Region KMS key, set `EnableKeyRotation` to `true` on the primary key (created by using `AWS::KMS::Key` ). AWS copies the rotation status to all replica keys. For details, see [Rotating multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate) in the *AWS Key Management Service Developer Guide* .
*
* When you enable automatic rotation, AWS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see [Rotating KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) in the *AWS Key Management Service Developer Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-enablekeyrotation
*/
readonly enableKeyRotation?: boolean | cdk.IResolvable;
/**
* The key policy to attach to the KMS key.
*
* If you provide a key policy, it must meet the following criteria:
*
* - The key policy must allow the caller to make a subsequent [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, see [Default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) in the *AWS Key Management Service Developer Guide* . (To omit this condition, set `BypassPolicyLockoutSafetyCheck` to true.)
* - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS . For more information, see [Changes that I make are not always immediately visible](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) in the *AWS Identity and Access Management User Guide* .
*
* If you do not provide a key policy, AWS attaches a default key policy to the KMS key. For more information, see [Default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) in the *AWS Key Management Service Developer Guide* .
*
* A key policy document can include only the following characters:
*
* - Printable ASCII characters
* - Printable characters in the Basic Latin and Latin-1 Supplement character set
* - The tab ( `\u0009` ), line feed ( `\u000A` ), and carriage return ( `\u000D` ) special characters
*
* *Minimum* : `1`
*
* *Maximum* : `32768`
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keypolicy
*/
readonly keyPolicy?: any | cdk.IResolvable;
/**
* Specifies the type of KMS key to create.
*
* The default value, `SYMMETRIC_DEFAULT` , creates a KMS key with a 256-bit symmetric key for encryption and decryption. In China Regions, `SYMMETRIC_DEFAULT` creates a 128-bit symmetric key that uses SM4 encryption. You can't change the `KeySpec` value after the KMS key is created. For help choosing a key spec for your KMS key, see [Choosing a KMS key type](https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) in the *AWS Key Management Service Developer Guide* .
*
* The `KeySpec` property determines the type of key material in the KMS key and the algorithms that the KMS key supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM policy. For more information, see [AWS condition keys](https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms) in the *AWS Key Management Service Developer Guide* .
*
* > If you change the value of the `KeySpec` property on an existing KMS key, the update request fails, regardless of the value of the [`UpdateReplacePolicy` attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) . This prevents you from accidentally deleting a KMS key by changing an immutable property value. > [AWS services that are integrated with AWS](https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration) use symmetric encryption KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether a KMS key is asymmetric, see [Identifying asymmetric KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) in the *AWS Key Management Service Developer Guide* .
*
* AWS supports the following key specs for KMS keys:
*
* - Symmetric encryption key (default)
*
* - `SYMMETRIC_DEFAULT` (AES-256-GCM)
* - HMAC keys (symmetric)
*
* - `HMAC_224`
* - `HMAC_256`
* - `HMAC_384`
* - `HMAC_512`
* - Asymmetric RSA key pairs (encryption and decryption *or* signing and verification)
*
* - `RSA_2048`
* - `RSA_3072`
* - `RSA_4096`
* - Asymmetric NIST-recommended elliptic curve key pairs (signing and verification *or* deriving shared secrets)
*
* - `ECC_NIST_P256` (secp256r1)
* - `ECC_NIST_P384` (secp384r1)
* - `ECC_NIST_P521` (secp521r1)
* - `ECC_NIST_EDWARDS25519` (ed25519) - signing and verification only
*
* - *Note:* For ECC_NIST_EDWARDS25519 KMS keys, the ED25519_SHA_512 signing algorithm requires [`MessageType:RAW`](https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html#KMS-Sign-request-MessageType) , while ED25519_PH_SHA_512 requires [`MessageType:DIGEST`](https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html#KMS-Sign-request-MessageType) . These message types cannot be used interchangeably.
* - Other asymmetric elliptic curve key pairs (signing and verification)
*
* - `ECC_SECG_P256K1` (secp256k1), commonly used for cryptocurrencies.
* - Asymmetric ML-DSA key pairs (signing and verification)
*
* - `ML_DSA_44`
* - `ML_DSA_65`
* - `ML_DSA_87`
* - SM2 key pairs (encryption and decryption *or* signing and verification *or* deriving shared secrets)
*
* - `SM2` (China Regions only)
*
* @default - "SYMMETRIC_DEFAULT"
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keyspec
*/
readonly keySpec?: string;
/**
* Determines the [cryptographic operations](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) for which you can use the KMS key. The default value is `ENCRYPT_DECRYPT` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the `KeyUsage` value after the KMS key is created.
*
* > If you change the value of the `KeyUsage` property on an existing KMS key, the update request fails, regardless of the value of the [`UpdateReplacePolicy` attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) . This prevents you from accidentally deleting a KMS key by changing an immutable property value.
*
* Select only one valid value.
*
* - For symmetric encryption KMS keys, omit the parameter or specify `ENCRYPT_DECRYPT` .
* - For HMAC KMS keys (symmetric), specify `GENERATE_VERIFY_MAC` .
* - For asymmetric KMS keys with RSA key pairs, specify `ENCRYPT_DECRYPT` or `SIGN_VERIFY` .
* - For asymmetric KMS keys with NIST-recommended elliptic curve key pairs, specify `SIGN_VERIFY` or `KEY_AGREEMENT` .
* - For asymmetric KMS keys with `ECC_SECG_P256K1` key pairs, specify `SIGN_VERIFY` .
* - For asymmetric KMS keys with ML-DSA key pairs, specify `SIGN_VERIFY` .
* - For asymmetric KMS keys with SM2 key pairs (China Regions only), specify `ENCRYPT_DECRYPT` , `SIGN_VERIFY` , or `KEY_AGREEMENT` .
*
* @default - "ENCRYPT_DECRYPT"
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keyusage
*/
readonly keyUsage?: string;
/**
* Creates a multi-Region primary key that you can replicate in other AWS Regions .
*
* You can't change the `MultiRegion` value after the KMS key is created.
*
* For a list of AWS Regions in which multi-Region keys are supported, see [Multi-Region keys in AWS](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the ** .
*
* > If you change the value of the `MultiRegion` property on an existing KMS key, the update request fails, regardless of the value of the [`UpdateReplacePolicy` attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html) . This prevents you from accidentally deleting a KMS key by changing an immutable property value.
*
* For a multi-Region key, set to this property to `true` . For a single-Region key, omit this property or set it to `false` . The default value is `false` .
*
* *Multi-Region keys* are an AWS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see [Multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *AWS Key Management Service Developer Guide* .
*
* You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store.
*
* To create a replica of this primary key in a different AWS Region , create an [AWS::KMS::ReplicaKey](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html) resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key.
*
* @default - false
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-multiregion
*/
readonly multiRegion?: boolean | cdk.IResolvable;
/**
* The source of the key material for the KMS key.
*
* You cannot change the origin after you create the KMS key. The default is `AWS_KMS` , which means that AWS creates the key material.
*
* To [create a KMS key with no key material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html) (for imported key material), set this value to `EXTERNAL` . For more information about importing key material into AWS , see [Importing Key Material](https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) in the *AWS Key Management Service Developer Guide* .
*
* You can ignore `ENABLED` when Origin is `EXTERNAL` . When a KMS key with Origin `EXTERNAL` is created, the key state is `PENDING_IMPORT` and `ENABLED` is `false` . After you import the key material, `ENABLED` updated to `true` . The KMS key can then be used for Cryptographic Operations.
*
* > - CloudFormation doesn't support creating an `Origin` parameter of the `AWS_CLOUDHSM` or `EXTERNAL_KEY_STORE` values.
* > - `EXTERNAL` is not supported for ML-DSA keys.
*
* @default - "AWS_KMS"
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-origin
*/
readonly origin?: string;
/**
* Specifies the number of days in the waiting period before AWS deletes a KMS key that has been removed from a CloudFormation stack.
*
* Enter a value between 7 and 30 days. The default value is 30 days.
*
* When you remove a KMS key from a CloudFormation stack, AWS schedules the KMS key for deletion and starts the mandatory waiting period. The `PendingWindowInDays` property determines the length of waiting period. During the waiting period, the key state of KMS key is `Pending Deletion` or `Pending Replica Deletion` , which prevents the KMS key from being used in cryptographic operations. When the waiting period expires, AWS permanently deletes the KMS key.
*
* AWS will not delete a [multi-Region primary key](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) that has replica keys. If you remove a multi-Region primary key from a CloudFormation stack, its key state changes to `PendingReplicaDeletion` so it cannot be replicated or used in cryptographic operations. This state can persist indefinitely. When the last of its replica keys is deleted, the key state of the primary key changes to `PendingDeletion` and the waiting period specified by `PendingWindowInDays` begins. When this waiting period expires, AWS deletes the primary key. For details, see [Deleting multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *AWS Key Management Service Developer Guide* .
*
* You cannot use a CloudFormation template to cancel deletion of the KMS key after you remove it from the stack, regardless of the waiting period. If you specify a KMS key in your template, even one with the same name, CloudFormation creates a new KMS key. To cancel deletion of a KMS key, use the AWS console or the [CancelKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_CancelKeyDeletion.html) operation.
*
* For information about the `Pending Deletion` and `Pending Replica Deletion` key states, see [Key state: Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *AWS Key Management Service Developer Guide* . For more information about deleting KMS keys, see the [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operation in the *AWS Key Management Service API Reference* and [Deleting KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the *AWS Key Management Service Developer Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-pendingwindowindays
*/
readonly pendingWindowInDays?: number;
/**
* Specifies a custom period of time between each rotation date.
*
* If no value is specified, the default value is 365 days.
*
* The rotation period defines the number of days after you enable automatic key rotation that AWS will rotate your key material, and the number of days between each automatic rotation thereafter.
*
* You can use the [`kms:RotationPeriodInDays`](https://docs.aws.amazon.com/kms/latest/developerguide/conditions-kms.html#conditions-kms-rotation-period-in-days) condition key to further constrain the values that principals can specify in the `RotationPeriodInDays` parameter.
*
* For more information about rotating KMS keys and automatic rotation, see [Rotating keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) in the *AWS Key Management Service Developer Guide* .
*
* @default - 365
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-rotationperiodindays
*/
readonly rotationPeriodInDays?: number;
/**
* Assigns one or more tags to the replica key.
*
* > Tagging or untagging a KMS key can allow or deny permission to the KMS key. For details, see [ABAC for AWS](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the *AWS Key Management Service Developer Guide* .
*
* For information about tags in AWS , see [Tagging keys](https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) in the *AWS Key Management Service Developer Guide* . For information about tags in CloudFormation, see [Tag](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-tags
*/
readonly tags?: Array<cdk.CfnTag>;
}
/**
* The `AWS::KMS::ReplicaKey` resource specifies a multi-Region replica key that is based on a multi-Region primary key.
*
* *Multi-Region keys* are an AWS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see [Multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the *AWS Key Management Service Developer Guide* .
*
* A multi-Region *primary key* is a fully functional symmetric encryption KMS key, HMAC KMS key, or asymmetric KMS key that is also the model for replica keys in other AWS Regions . To create a multi-Region primary key, add an [AWS::KMS::Key](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html) resource to your CloudFormation stack. Set its `MultiRegion` property to true.
*
* A multi-Region *replica key* is a fully functional KMS key that has the same key ID and key material as a multi-Region primary key, but is located in a different AWS Region of the same AWS partition. There can be multiple replicas of a primary key, but each must be in a different AWS Region .
*
* When you create a replica key in CloudFormation , the replica key is created in the AWS Region represented by the endpoint you use for the request. If you try to replicate a multi-Region key into a Region in which the key type is not supported, the request will fail.
*
* A primary key and its replicas have the same key ID and key material. They also have the same key spec, key usage, key material origin, and automatic key rotation status. These properties are known as *shared properties* . If they change, AWS synchronizes the change to all related multi-Region keys. All other properties of a replica key can differ, including its key policy, tags, aliases, and key state. AWS does not synchronize these properties.
*
* *Regions*
*
* AWS CloudFormation resources are available in all AWS Regions in which AWS and CloudFormation are supported. You can use the `AWS::KMS::ReplicaKey` resource to create replica keys in all Regions that support multi-Region KMS keys. For details, see [Multi-Region keys in AWS](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) in the ** .
*
* @cloudformationResource AWS::KMS::ReplicaKey
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html
*/
export declare class CfnReplicaKey extends cdk.CfnResource implements cdk.IInspectable, IReplicaKeyRef, cdk.ITaggable {
/**
* The CloudFormation resource type name for this resource class.
*/
static readonly CFN_RESOURCE_TYPE_NAME: string;
/**
* Build a CfnReplicaKey from CloudFormation properties
*
* A factory method that creates a new instance of this class from an object
* containing the CloudFormation properties of this resource.
* Used in the @aws-cdk/cloudformation-include module.
*
* @internal
*/
static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnReplicaKey;
/**
* Checks whether the given object is a CfnReplicaKey
*/
static isCfnReplicaKey(x: any): x is CfnReplicaKey;
static arnForReplicaKey(resource: IReplicaKeyRef): string;
/**
* A description of the KMS key.
*/
private _description?;
/**
* Specifies whether the replica key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
private _enabled?;
/**
* The key policy that authorizes use of the replica key.
*/
private _keyPolicy;
/**
* Specifies the number of days in the waiting period before AWS deletes a replica key that has been removed from a CloudFormation stack.
*/
private _pendingWindowInDays?;
/**
* Specifies the multi-Region primary key to replicate.
*/
private _primaryKeyArn;
/**
* Tag Manager which manages the tags for this resource
*/
readonly tags: cdk.TagManager;
/**
* Assigns one or more tags to the replica key.
*/
private _tagsRaw?;
protected readonly cfnPropertyNames: Record<string, string>;
/**
* Create a new `AWS::KMS::ReplicaKey`.
*
* @param scope Scope in which this resource is defined
* @param id Construct identifier for this resource (unique in its scope)
* @param props Resource properties
*/
constructor(scope: constructs.Construct, id: string, props: CfnReplicaKeyProps);
get replicaKeyRef(): ReplicaKeyReference;
/**
* A description of the KMS key.
*/
get description(): string | undefined;
/**
* A description of the KMS key.
*/
set description(value: string | undefined);
/**
* Specifies whether the replica key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
get enabled(): boolean | cdk.IResolvable | undefined;
/**
* Specifies whether the replica key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*/
set enabled(value: boolean | cdk.IResolvable | undefined);
/**
* The key policy that authorizes use of the replica key.
*/
get keyPolicy(): any | cdk.IResolvable;
/**
* The key policy that authorizes use of the replica key.
*/
set keyPolicy(value: any | cdk.IResolvable);
/**
* Specifies the number of days in the waiting period before AWS deletes a replica key that has been removed from a CloudFormation stack.
*/
get pendingWindowInDays(): number | undefined;
/**
* Specifies the number of days in the waiting period before AWS deletes a replica key that has been removed from a CloudFormation stack.
*/
set pendingWindowInDays(value: number | undefined);
/**
* Specifies the multi-Region primary key to replicate.
*/
get primaryKeyArn(): string;
/**
* Specifies the multi-Region primary key to replicate.
*/
set primaryKeyArn(value: string);
/**
* Assigns one or more tags to the replica key.
*/
get tagsRaw(): Array<cdk.CfnTag> | undefined;
/**
* Assigns one or more tags to the replica key.
*/
set tagsRaw(value: Array<cdk.CfnTag> | undefined);
/**
* The Amazon Resource Name (ARN) of the replica key, such as `arn:aws:kms:us-west-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab` .
*
* The key ARNs of related multi-Region keys differ only in the Region value. For information about the key ARNs of multi-Region keys, see [How multi-Region keys work](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-how-it-works) in the *AWS Key Management Service Developer Guide* .
*
* @cloudformationAttribute Arn
*/
get attrArn(): string;
/**
* The key ID of the replica key, such as `mrk-1234abcd12ab34cd56ef1234567890ab` .
*
* Related multi-Region keys have the same key ID. For information about the key IDs of multi-Region keys, see [How multi-Region keys work](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html#mrk-how-it-works) in the *AWS Key Management Service Developer Guide* .
*
* @cloudformationAttribute KeyId
*/
get attrKeyId(): string;
protected get cfnProperties(): Record<string, any>;
/**
* Examines the CloudFormation resource and discloses attributes
*
* @param inspector tree inspector to collect and process attributes
*/
inspect(inspector: cdk.TreeInspector): void;
protected renderProperties(props: Record<string, any>): Record<string, any>;
}
/**
* Properties for defining a `CfnReplicaKey`
*
* @struct
* @stability external
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html
*/
export interface CfnReplicaKeyProps {
/**
* A description of the KMS key.
*
* The default value is an empty string (no description).
*
* The description is not a shared property of multi-Region keys. You can specify the same description or a different description for each key in a set of related multi-Region keys. AWS Key Management Service does not synchronize this property.
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-description
*/
readonly description?: string;
/**
* Specifies whether the replica key is enabled. Disabled KMS keys cannot be used in cryptographic operations.
*
* When `Enabled` is `true` , the *key state* of the KMS key is `Enabled` . When `Enabled` is `false` , the key state of the KMS key is `Disabled` . The default value is `true` .
*
* The actual key state of the replica might be affected by actions taken outside of CloudFormation, such as running the [EnableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html) , [DisableKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html) , or [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operations. Also, while the replica key is being created, its key state is `Creating` . When the process is complete, the key state of the replica key changes to `Enabled` .
*
* For information about the key states of a KMS key, see [Key state: Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *AWS Key Management Service Developer Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-enabled
*/
readonly enabled?: boolean | cdk.IResolvable;
/**
* The key policy that authorizes use of the replica key.
*
* The key policy is not a shared property of multi-Region keys. You can specify the same key policy or a different key policy for each key in a set of related multi-Region keys. AWS does not synchronize this property.
*
* The key policy must conform to the following rules.
*
* - The key policy must give the caller [PutKeyPolicy](https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html) permission on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the [Default key policy](https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam) section of the **AWS Key Management Service Developer Guide** .
* - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS . For more information, see [Changes that I make are not always immediately visible](https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) in the *AWS Identity and Access Management User Guide* .
*
* A key policy document can include only the following characters:
*
* - Printable ASCII characters from the space character ( `\u0020` ) through the end of the ASCII character range.
* - Printable characters in the Basic Latin and Latin-1 Supplement character set (through `\u00FF` ).
* - The tab ( `\u0009` ), line feed ( `\u000A` ), and carriage return ( `\u000D` ) special characters
*
* *Minimum* : `1`
*
* *Maximum* : `32768`
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-keypolicy
*/
readonly keyPolicy: any | cdk.IResolvable;
/**
* Specifies the number of days in the waiting period before AWS deletes a replica key that has been removed from a CloudFormation stack.
*
* Enter a value between 7 and 30 days. The default value is 30 days.
*
* When you remove a replica key from a CloudFormation stack, AWS schedules the replica key for deletion and starts the mandatory waiting period. The `PendingWindowInDays` property determines the length of waiting period. During the waiting period, the key state of replica key is `Pending Deletion` , which prevents it from being used in cryptographic operations. When the waiting period expires, AWS permanently deletes the replica key.
*
* If the KMS key is a multi-Region primary key with replica keys, the waiting period begins when the last of its replica keys is deleted. Otherwise, the waiting period begins immediately.
*
* You cannot use a CloudFormation template to cancel deletion of the replica after you remove it from the stack, regardless of the waiting period. However, if you specify a replica key in your template that is based on the same primary key as the original replica key, CloudFormation creates a new replica key with the same key ID, key material, and other shared properties of the original replica key. This new replica key can decrypt ciphertext that was encrypted under the original replica key, or any related multi-Region key.
*
* For detailed information about deleting multi-Region keys, see [Deleting multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *AWS Key Management Service Developer Guide* .
*
* For information about the `PendingDeletion` key state, see [Key state: Effect on your KMS key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the *AWS Key Management Service Developer Guide* . For more information about deleting KMS keys, see the [ScheduleKeyDeletion](https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html) operation in the *AWS Key Management Service API Reference* and [Deleting KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in the *AWS Key Management Service Developer Guide* .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-pendingwindowindays
*/
readonly pendingWindowInDays?: number;
/**
* Specifies the multi-Region primary key to replicate.
*
* The primary key must be in a different AWS Region of the same AWS partition. You can create only one replica of a given primary key in each AWS Region .
*
* > If you change the `PrimaryKeyArn` value of a replica key, the existing replica key is scheduled for deletion and a new replica key is created based on the specified primary key. While it is scheduled for deletion, the existing replica key becomes unusable. You can cancel the scheduled deletion of the key outside of CloudFormation.
* >
* > However, if you inadvertently delete a replica key, you can decrypt ciphertext encrypted by that replica key by using any related multi-Region key. If necessary, you can recreate the replica in the same Region after the previous one is completely deleted. For details, see [Deleting multi-Region keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-delete.html) in the *AWS Key Management Service Developer Guide*
*
* Specify the key ARN of an existing multi-Region primary key. For example, `arn:aws:kms:us-east-2:111122223333:key/mrk-1234abcd12ab34cd56ef1234567890ab` .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-primarykeyarn
*/
readonly primaryKeyArn: string;
/**
* Assigns one or more tags to the replica key.
*
* > Tagging or untagging a KMS key can allow or deny permission to the KMS key. For details, see [ABAC for AWS](https://docs.aws.amazon.com/kms/latest/developerguide/abac.html) in the *AWS Key Management Service Developer Guide* .
*
* Tags are not a shared property of multi-Region keys. You can specify the same tags or different tags for each key in a set of related multi-Region keys. AWS does not synchronize this property.
*
* Each tag consists of a tag key and a tag value. Both the tag key and the tag value are required, but the tag value can be an empty (null) string. You cannot have more than one tag on a KMS key with the same tag key. If you specify an existing tag key with a different tag value, AWS replaces the current tag value with the specified one.
*
* When you assign tags to an AWS resource, AWS generates a cost allocation report with usage and costs aggregated by tags. Tags can also be used to control access to a KMS key. For details, see [Tagging keys](https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html) .
*
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html#cfn-kms-replicakey-tags
*/
readonly tags?: Array<cdk.CfnTag>;
}
export type { IAliasRef, AliasReference };
export type { IKeyRef, KeyReference };
export type { IReplicaKeyRef, ReplicaKeyReference };

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
import type { CfnResource } from '../../../core';
import type { ICfnResourceMatcher } from '../../../core/lib/helpers-internal';
/**
* Matches a CfnKey by a KMS key identifier (ref, key ID, or ARN).
*/
export declare class CfnKeyMatcher implements ICfnResourceMatcher {
private readonly keyId;
readonly cfnResourceType = "AWS::KMS::Key";
constructor(keyId: string);
matches(candidate: CfnResource): boolean;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CfnKeyMatcher=void 0;class CfnKeyMatcher{keyId;cfnResourceType="AWS::KMS::Key";constructor(keyId){this.keyId=keyId}matches(candidate){const key=candidate;return key.ref===this.keyId||key.attrKeyId===this.keyId||key.attrArn===this.keyId}}exports.CfnKeyMatcher=CfnKeyMatcher;

View File

@@ -0,0 +1 @@
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var aws_iam_1=()=>{var tmp=require("../../../aws-iam");return aws_iam_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},kms_generated_1=()=>{var tmp=require("../kms.generated");return kms_generated_1=()=>tmp,tmp};class KeyWithPolicyFactory{forResource(resource){if(!kms_generated_1().CfnKey.isCfnKey(resource))throw new(core_1()).ValidationError((0,literal_string_1().lit)`Construct`,`Construct ${resource.node.path} is not of type CfnKey`,resource);return new CfnKeyWithPolicy(resource)}}class CfnKeyWithPolicy{key;env;policyDocument;constructor(key){this.key=key,this.env=key.env}addToResourcePolicy(statement){return core_1().Token.isResolved(this.key.keyPolicy)?(this.policyDocument==null&&(this.policyDocument=aws_iam_1().PolicyDocument.fromJson(this.key.keyPolicy??{Statement:[]})),this.policyDocument.addStatements(statement),this.key.keyPolicy=this.policyDocument.toJSON(),{statementAdded:!0,policyDependable:this.policyDocument}):{statementAdded:!1}}}aws_iam_1().DefaultPolicyFactories.set("AWS::KMS::Key",new KeyWithPolicyFactory);

View File

@@ -0,0 +1,7 @@
export declare const ADMIN_ACTIONS: string[];
export declare const ENCRYPT_ACTIONS: string[];
export declare const DECRYPT_ACTIONS: string[];
export declare const SIGN_ACTIONS: string[];
export declare const VERIFY_ACTIONS: string[];
export declare const GENERATE_HMAC_ACTIONS: string[];
export declare const VERIFY_HMAC_ACTIONS: string[];

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.VERIFY_HMAC_ACTIONS=exports.GENERATE_HMAC_ACTIONS=exports.VERIFY_ACTIONS=exports.SIGN_ACTIONS=exports.DECRYPT_ACTIONS=exports.ENCRYPT_ACTIONS=exports.ADMIN_ACTIONS=void 0,exports.ADMIN_ACTIONS=["kms:Create*","kms:Describe*","kms:Enable*","kms:List*","kms:Put*","kms:Update*","kms:Revoke*","kms:Disable*","kms:Get*","kms:Delete*","kms:TagResource","kms:UntagResource","kms:ScheduleKeyDeletion","kms:CancelKeyDeletion"],exports.ENCRYPT_ACTIONS=["kms:Encrypt","kms:ReEncrypt*","kms:GenerateDataKey*"],exports.DECRYPT_ACTIONS=["kms:Decrypt"],exports.SIGN_ACTIONS=["kms:Sign"],exports.VERIFY_ACTIONS=["kms:Verify"],exports.GENERATE_HMAC_ACTIONS=["kms:GenerateMac"],exports.VERIFY_HMAC_ACTIONS=["kms:VerifyMac"];

View File

@@ -0,0 +1,11 @@
import * as iam from '../../aws-iam';
/**
* A principal to allow access to a key if it's being used through another AWS service
*/
export declare class ViaServicePrincipal extends iam.PrincipalBase {
private readonly serviceName;
private readonly basePrincipal;
constructor(serviceName: string, basePrincipal?: iam.IPrincipal);
get policyFragment(): iam.PrincipalPolicyFragment;
dedupeString(): string | undefined;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViaServicePrincipal=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp};class ViaServicePrincipal extends iam().PrincipalBase{serviceName;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_kms.ViaServicePrincipal",version:"2.252.0"};basePrincipal;constructor(serviceName,basePrincipal){super(),this.serviceName=serviceName;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IPrincipal(basePrincipal)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ViaServicePrincipal),error}this.basePrincipal=basePrincipal||new(iam()).AnyPrincipal}get policyFragment(){const base=this.basePrincipal.policyFragment,conditions=Object.assign({},base.conditions);return conditions.StringEquals?conditions.StringEquals=Object.assign({"kms:ViaService":this.serviceName},conditions.StringEquals):conditions.StringEquals={"kms:ViaService":this.serviceName},{principalJson:base.principalJson,conditions}}dedupeString(){const base=iam().ComparablePrincipal.dedupeStringFor(this.basePrincipal);return base!==void 0?`ViaServicePrincipal:${this.serviceName}:${base}`:void 0}}exports.ViaServicePrincipal=ViaServicePrincipal;