@aws-cdk/aws-kms
Version:
The CDK Construct Library for AWS::KMS
824 lines • 107 kB
JSON
{
"version": "2",
"toolVersion": "1.74.0",
"snippets": {
"0ad02fde94b94efd8e110217f997271482722082350c156da1225648d32ce940": {
"translations": {
"python": {
"source": "kms.Key(self, \"MyKey\",\n enable_key_rotation=True\n)",
"version": "2"
},
"csharp": {
"source": "new Key(this, \"MyKey\", new KeyProps {\n EnableKeyRotation = true\n});",
"version": "1"
},
"java": {
"source": "Key.Builder.create(this, \"MyKey\")\n .enableKeyRotation(true)\n .build();",
"version": "1"
},
"go": {
"source": "kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\tenableKeyRotation: jsii.Boolean(true),\n})",
"version": "1"
},
"$": {
"source": "new kms.Key(this, 'MyKey', {\n enableKeyRotation: true,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 16
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew kms.Key(this, 'MyKey', {\n enableKeyRotation: true,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 3,
"104": 1,
"106": 1,
"193": 1,
"194": 1,
"197": 1,
"226": 1,
"281": 1
},
"fqnsFingerprint": "0916683fae71d7975297147cfff0b1a17e9636759086d074aba647a1c232945c"
},
"e311e0be03390f6d9c7731918629ad9cba3668ddc843bb1f3d01f8a782966700": {
"translations": {
"python": {
"source": "key = kms.Key(self, \"MyKey\",\n pending_window=Duration.days(10)\n)",
"version": "2"
},
"csharp": {
"source": "Key key = new Key(this, \"MyKey\", new KeyProps {\n PendingWindow = Duration.Days(10)\n});",
"version": "1"
},
"java": {
"source": "Key key = Key.Builder.create(this, \"MyKey\")\n .pendingWindow(Duration.days(10))\n .build();",
"version": "1"
},
"go": {
"source": "key := kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\tpendingWindow: *awscdkcore.Duration.days(jsii.Number(10)),\n})",
"version": "1"
},
"$": {
"source": "const key = new kms.Key(this, 'MyKey', {\n pendingWindow: Duration.days(10), // Default to 30 Days\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 26
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"@aws-cdk/core.Duration",
"@aws-cdk/core.Duration#days",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst key = new kms.Key(this, 'MyKey', {\n pendingWindow: Duration.days(10), // Default to 30 Days\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"8": 1,
"10": 1,
"75": 6,
"104": 1,
"193": 1,
"194": 2,
"196": 1,
"197": 1,
"225": 1,
"242": 1,
"243": 1,
"281": 1
},
"fqnsFingerprint": "6cc626c43b793cde9f0bcd32806daa182ca7f4dc7a425478af2237eaef472445"
},
"aabe9e5dab5a8b01bf60c651c2acd958585bc7f3233f837babcf3c85a5556f32": {
"translations": {
"python": {
"source": "key = kms.Key(self, \"MyKey\")\nkey.add_alias(\"alias/foo\")\nkey.add_alias(\"alias/bar\")",
"version": "2"
},
"csharp": {
"source": "Key key = new Key(this, \"MyKey\");\nkey.AddAlias(\"alias/foo\");\nkey.AddAlias(\"alias/bar\");",
"version": "1"
},
"java": {
"source": "Key key = new Key(this, \"MyKey\");\nkey.addAlias(\"alias/foo\");\nkey.addAlias(\"alias/bar\");",
"version": "1"
},
"go": {
"source": "key := kms.NewKey(this, jsii.String(\"MyKey\"))\nkey.addAlias(jsii.String(\"alias/foo\"))\nkey.addAlias(jsii.String(\"alias/bar\"))",
"version": "1"
},
"$": {
"source": "const key = new kms.Key(this, 'MyKey');\nkey.addAlias('alias/foo');\nkey.addAlias('alias/bar');",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 35
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Key",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst key = new kms.Key(this, 'MyKey');\nkey.addAlias('alias/foo');\nkey.addAlias('alias/bar');\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 3,
"75": 7,
"104": 1,
"194": 3,
"196": 2,
"197": 1,
"225": 1,
"226": 2,
"242": 1,
"243": 1
},
"fqnsFingerprint": "a62621ee079d3223aab5818f38b89b7d2c9028c6afab09be4874fe180e166099"
},
"05f7c34014b0352bb0aa31af76085551527fcc8037bbc1a5e1c2135fc51aa977": {
"translations": {
"python": {
"source": "key = kms.Key(self, \"MyKey\",\n key_spec=kms.KeySpec.ECC_SECG_P256K1, # Default to SYMMETRIC_DEFAULT\n key_usage=kms.KeyUsage.SIGN_VERIFY\n)",
"version": "2"
},
"csharp": {
"source": "Key key = new Key(this, \"MyKey\", new KeyProps {\n KeySpec = KeySpec.ECC_SECG_P256K1, // Default to SYMMETRIC_DEFAULT\n KeyUsage = KeyUsage.SIGN_VERIFY\n});",
"version": "1"
},
"java": {
"source": "Key key = Key.Builder.create(this, \"MyKey\")\n .keySpec(KeySpec.ECC_SECG_P256K1) // Default to SYMMETRIC_DEFAULT\n .keyUsage(KeyUsage.SIGN_VERIFY)\n .build();",
"version": "1"
},
"go": {
"source": "key := kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\tkeySpec: kms.keySpec_ECC_SECG_P256K1,\n\t // Default to SYMMETRIC_DEFAULT\n\tkeyUsage: kms.keyUsage_SIGN_VERIFY,\n})",
"version": "1"
},
"$": {
"source": "const key = new kms.Key(this, 'MyKey', {\n keySpec: kms.KeySpec.ECC_SECG_P256K1, // Default to SYMMETRIC_DEFAULT\n keyUsage: kms.KeyUsage.SIGN_VERIFY, // and ENCRYPT_DECRYPT\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 46
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"@aws-cdk/aws-kms.KeySpec",
"@aws-cdk/aws-kms.KeySpec#ECC_SECG_P256K1",
"@aws-cdk/aws-kms.KeyUsage",
"@aws-cdk/aws-kms.KeyUsage#SIGN_VERIFY",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst key = new kms.Key(this, 'MyKey', {\n keySpec: kms.KeySpec.ECC_SECG_P256K1, // Default to SYMMETRIC_DEFAULT\n keyUsage: kms.KeyUsage.SIGN_VERIFY, // and ENCRYPT_DECRYPT\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 11,
"104": 1,
"193": 1,
"194": 5,
"197": 1,
"225": 1,
"242": 1,
"243": 1,
"281": 2
},
"fqnsFingerprint": "af77273d35526f63dc7723e77516d3dc2a7dd280b2a4cbb1856a56e1d91ae1c7"
},
"7273ddb7cb9e300bba421403e50a89bce99b234df22cc9e8edca632c941fa797": {
"translations": {
"python": {
"source": "#\n# Stack that defines the key\n#\nclass KeyStack(cdk.Stack):\n\n def __init__(self, scope, id, *, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):\n super().__init__(scope, id, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)\n self.key = kms.Key(self, \"MyKey\", removal_policy=cdk.RemovalPolicy.DESTROY)\n\n#\n# Stack that uses the key\n#\nclass UseStack(cdk.Stack):\n def __init__(self, scope, id, *, key, description=None, env=None, stackName=None, tags=None, synthesizer=None, terminationProtection=None, analyticsReporting=None):\n super().__init__(scope, id, key=key, description=description, env=env, stackName=stackName, tags=tags, synthesizer=synthesizer, terminationProtection=terminationProtection, analyticsReporting=analyticsReporting)\n\n # Use the IKey object here.\n kms.Alias(self, \"Alias\",\n alias_name=\"alias/foo\",\n target_key=key\n )\n\nkey_stack = KeyStack(app, \"KeyStack\")\nUseStack(app, \"UseStack\", key=key_stack.key)",
"version": "2"
},
"csharp": {
"source": "/**\n * Stack that defines the key\n */\nclass KeyStack : Stack\n{\n public Key Key { get; }\n\n public KeyStack(App scope, string id, StackProps? props=null) : base(scope, id, props)\n {\n Key = new Key(this, \"MyKey\", new KeyProps { RemovalPolicy = RemovalPolicy.DESTROY });\n }\n}\n\nclass UseStackProps : StackProps\n{\n public IKey Key { get; set; }\n}\n\n/**\n * Stack that uses the key\n */\nclass UseStack : Stack\n{\n public UseStack(App scope, string id, UseStackProps props) : base(scope, id, props)\n {\n\n // Use the IKey object here.\n // Use the IKey object here.\n new Alias(this, \"Alias\", new AliasProps {\n AliasName = \"alias/foo\",\n TargetKey = props.Key\n });\n }\n}\n\nKeyStack keyStack = new KeyStack(app, \"KeyStack\");\nnew UseStack(app, \"UseStack\", new UseStackProps { Key = keyStack.Key });",
"version": "1"
},
"java": {
"source": "/**\n * Stack that defines the key\n */\npublic class KeyStack extends Stack {\n public final Key key;\n\n public KeyStack(App scope, String id) {\n this(scope, id, null);\n }\n\n public KeyStack(App scope, String id, StackProps props) {\n super(scope, id, props);\n this.key = Key.Builder.create(this, \"MyKey\").removalPolicy(RemovalPolicy.DESTROY).build();\n }\n}\n\npublic class UseStackProps extends StackProps {\n private IKey key;\n public IKey getKey() {\n return this.key;\n }\n public UseStackProps key(IKey key) {\n this.key = key;\n return this;\n }\n}\n\n/**\n * Stack that uses the key\n */\npublic class UseStack extends Stack {\n public UseStack(App scope, String id, UseStackProps props) {\n super(scope, id, props);\n\n // Use the IKey object here.\n // Use the IKey object here.\n Alias.Builder.create(this, \"Alias\")\n .aliasName(\"alias/foo\")\n .targetKey(props.getKey())\n .build();\n }\n}\n\nKeyStack keyStack = new KeyStack(app, \"KeyStack\");\nnew UseStack(app, \"UseStack\", new UseStackProps().key(keyStack.getKey()));",
"version": "1"
},
"go": {
"source": "/**\n * Stack that defines the key\n */\ntype keyStack struct {\n\tstack\n\tkey key\n}\n\nfunc newKeyStack(scope app, id *string, props stackProps) *keyStack {\n\tthis := &keyStack{}\n\tcdk.NewStack_Override(this, scope, id, props)\n\tthis.key = kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\t\tremovalPolicy: cdk.removalPolicy_DESTROY,\n\t})\n\treturn this\n}\n\ntype useStackProps struct {\n\tstackProps\n\tkey iKey\n}\n\n/**\n * Stack that uses the key\n */\ntype useStack struct {\n\tstack\n}\n\nfunc newUseStack(scope app, id *string, props useStackProps) *useStack {\n\tthis := &useStack{}\n\tcdk.NewStack_Override(this, scope, id, props)\n\n\t// Use the IKey object here.\n\t// Use the IKey object here.\n\tkms.NewAlias(this, jsii.String(\"Alias\"), &aliasProps{\n\t\taliasName: jsii.String(\"alias/foo\"),\n\t\ttargetKey: props.key,\n\t})\n\treturn this\n}\n\nkeyStack := NewKeyStack(app, jsii.String(\"KeyStack\"))\nNewUseStack(app, jsii.String(\"UseStack\"), &useStackProps{\n\tkey: keyStack.key,\n})",
"version": "1"
},
"$": {
"source": "\n/**\n * Stack that defines the key\n */\nclass KeyStack extends cdk.Stack {\n public readonly key: kms.Key;\n\n constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n this.key = new kms.Key(this, 'MyKey', { removalPolicy: cdk.RemovalPolicy.DESTROY });\n }\n}\n\ninterface UseStackProps extends cdk.StackProps {\n key: kms.IKey; // Use IKey here\n}\n\n/**\n * Stack that uses the key\n */\nclass UseStack extends cdk.Stack {\n constructor(scope: cdk.App, id: string, props: UseStackProps) {\n super(scope, id, props);\n\n // Use the IKey object here.\n new kms.Alias(this, 'Alias', {\n aliasName: 'alias/foo',\n targetKey: props.key,\n });\n }\n}\n\nconst keyStack = new KeyStack(app, 'KeyStack');\nnew UseStack(app, 'UseStack', { key: keyStack.key });",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 58
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Alias",
"@aws-cdk/aws-kms.AliasProps",
"@aws-cdk/aws-kms.IKey",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"@aws-cdk/core.App",
"@aws-cdk/core.RemovalPolicy",
"@aws-cdk/core.RemovalPolicy#DESTROY",
"@aws-cdk/core.Stack",
"@aws-cdk/core.StackProps",
"constructs.Construct"
],
"fullSource": "/// !cdk-integ *\nimport * as cdk from '@aws-cdk/core';\nimport * as kms from '../lib';\n\nconst app = new cdk.App();\n\n/// !show\n\n/**\n * Stack that defines the key\n */\nclass KeyStack extends cdk.Stack {\n public readonly key: kms.Key;\n\n constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {\n super(scope, id, props);\n this.key = new kms.Key(this, 'MyKey', { removalPolicy: cdk.RemovalPolicy.DESTROY });\n }\n}\n\ninterface UseStackProps extends cdk.StackProps {\n key: kms.IKey; // Use IKey here\n}\n\n/**\n * Stack that uses the key\n */\nclass UseStack extends cdk.Stack {\n constructor(scope: cdk.App, id: string, props: UseStackProps) {\n super(scope, id, props);\n\n // Use the IKey object here.\n new kms.Alias(this, 'Alias', {\n aliasName: 'alias/foo',\n targetKey: props.key,\n });\n }\n}\n\nconst keyStack = new KeyStack(app, 'KeyStack');\nnew UseStack(app, 'UseStack', { key: keyStack.key });\n/// !hide\n\napp.synth();\n",
"syntaxKindCounter": {
"10": 5,
"57": 1,
"62": 1,
"75": 55,
"102": 2,
"104": 3,
"119": 1,
"138": 1,
"143": 2,
"153": 5,
"156": 6,
"158": 1,
"159": 1,
"162": 2,
"169": 6,
"193": 3,
"194": 10,
"196": 2,
"197": 4,
"209": 1,
"216": 3,
"223": 2,
"225": 1,
"226": 5,
"242": 1,
"243": 1,
"245": 2,
"246": 1,
"279": 3,
"281": 4
},
"fqnsFingerprint": "dc71a585e1b7712ce79e1bf6ccb15a9dfec364ea15d88ab0a0ec48b01d3cbbdd"
},
"fe337821dfa1e9333a87720cb423add6e58c7173ecb3827f4066e25fb382aa55": {
"translations": {
"python": {
"source": "my_key_imported = kms.Key.from_key_arn(self, \"MyImportedKey\", \"arn:aws:...\")\n\n# you can do stuff with this imported key.\nmy_key_imported.add_alias(\"alias/foo\")",
"version": "2"
},
"csharp": {
"source": "IKey myKeyImported = Key.FromKeyArn(this, \"MyImportedKey\", \"arn:aws:...\");\n\n// you can do stuff with this imported key.\nmyKeyImported.AddAlias(\"alias/foo\");",
"version": "1"
},
"java": {
"source": "IKey myKeyImported = Key.fromKeyArn(this, \"MyImportedKey\", \"arn:aws:...\");\n\n// you can do stuff with this imported key.\nmyKeyImported.addAlias(\"alias/foo\");",
"version": "1"
},
"go": {
"source": "myKeyImported := kms.key.fromKeyArn(this, jsii.String(\"MyImportedKey\"), jsii.String(\"arn:aws:...\"))\n\n// you can do stuff with this imported key.\nmyKeyImported.addAlias(jsii.String(\"alias/foo\"))",
"version": "1"
},
"$": {
"source": "const myKeyImported = kms.Key.fromKeyArn(this, 'MyImportedKey', 'arn:aws:...');\n\n// you can do stuff with this imported key.\nmyKeyImported.addAlias('alias/foo');",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 103
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.IKey",
"@aws-cdk/aws-kms.IKey#addAlias",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.Key#fromKeyArn",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst myKeyImported = kms.Key.fromKeyArn(this, 'MyImportedKey', 'arn:aws:...');\n\n// you can do stuff with this imported key.\nmyKeyImported.addAlias('alias/foo');\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 3,
"75": 6,
"104": 1,
"194": 3,
"196": 2,
"225": 1,
"226": 1,
"242": 1,
"243": 1
},
"fqnsFingerprint": "aebd1fd23fa118378a3c57d3770075cec9e81d11e07e79cbdcbeb5154530e7c0"
},
"6a6f49e170bfb854b16a39acb03ce73437abb7d1d54317a535c78dc35c951efa": {
"translations": {
"python": {
"source": "import aws_cdk.aws_cloudtrail as cloudtrail\n\n\nmy_key_alias = kms.Alias.from_alias_name(self, \"myKey\", \"alias/aws/s3\")\ntrail = cloudtrail.Trail(self, \"myCloudTrail\",\n send_to_cloud_watch_logs=True,\n kms_key=my_key_alias\n)",
"version": "2"
},
"csharp": {
"source": "using Amazon.CDK.AWS.CloudTrail;\n\n\nIAlias myKeyAlias = Alias.FromAliasName(this, \"myKey\", \"alias/aws/s3\");\nTrail trail = new Trail(this, \"myCloudTrail\", new TrailProps {\n SendToCloudWatchLogs = true,\n KmsKey = myKeyAlias\n});",
"version": "1"
},
"java": {
"source": "import software.amazon.awscdk.services.cloudtrail.*;\n\n\nIAlias myKeyAlias = Alias.fromAliasName(this, \"myKey\", \"alias/aws/s3\");\nTrail trail = Trail.Builder.create(this, \"myCloudTrail\")\n .sendToCloudWatchLogs(true)\n .kmsKey(myKeyAlias)\n .build();",
"version": "1"
},
"go": {
"source": "import cloudtrail \"github.com/aws-samples/dummy/awscdkawscloudtrail\"\n\n\nmyKeyAlias := kms.alias.fromAliasName(this, jsii.String(\"myKey\"), jsii.String(\"alias/aws/s3\"))\ntrail := cloudtrail.NewTrail(this, jsii.String(\"myCloudTrail\"), &trailProps{\n\tsendToCloudWatchLogs: jsii.Boolean(true),\n\tkmsKey: myKeyAlias,\n})",
"version": "1"
},
"$": {
"source": "import * as cloudtrail from '@aws-cdk/aws-cloudtrail';\n\nconst myKeyAlias = kms.Alias.fromAliasName(this, 'myKey', 'alias/aws/s3');\nconst trail = new cloudtrail.Trail(this, 'myCloudTrail', {\n sendToCloudWatchLogs: true,\n kmsKey: myKeyAlias,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 119
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-cloudtrail.Trail",
"@aws-cdk/aws-cloudtrail.TrailProps",
"@aws-cdk/aws-kms.Alias",
"@aws-cdk/aws-kms.Alias#fromAliasName",
"@aws-cdk/aws-kms.IAlias",
"@aws-cdk/aws-kms.IKey",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\nimport * as cloudtrail from '@aws-cdk/aws-cloudtrail';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst myKeyAlias = kms.Alias.fromAliasName(this, 'myKey', 'alias/aws/s3');\nconst trail = new cloudtrail.Trail(this, 'myCloudTrail', {\n sendToCloudWatchLogs: true,\n kmsKey: myKeyAlias,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 4,
"75": 11,
"104": 2,
"106": 1,
"193": 1,
"194": 3,
"196": 1,
"197": 1,
"225": 2,
"242": 2,
"243": 2,
"254": 1,
"255": 1,
"256": 1,
"281": 2,
"290": 1
},
"fqnsFingerprint": "0c637c610d8ccb80e1f3a0d69646135080553889dfca624252cc612a911dc4d9"
},
"d3d6684a08caf640183a7c5ebcabc5ae550f9779fb07c5912e966e217e314a33": {
"translations": {
"python": {
"source": "my_key_lookup = kms.Key.from_lookup(self, \"MyKeyLookup\",\n alias_name=\"alias/KeyAlias\"\n)\n\nrole = iam.Role(self, \"MyRole\",\n assumed_by=iam.ServicePrincipal(\"lambda.amazonaws.com\")\n)\nmy_key_lookup.grant_encrypt_decrypt(role)",
"version": "2"
},
"csharp": {
"source": "IKey myKeyLookup = Key.FromLookup(this, \"MyKeyLookup\", new KeyLookupOptions {\n AliasName = \"alias/KeyAlias\"\n});\n\nRole role = new Role(this, \"MyRole\", new RoleProps {\n AssumedBy = new ServicePrincipal(\"lambda.amazonaws.com\")\n});\nmyKeyLookup.GrantEncryptDecrypt(role);",
"version": "1"
},
"java": {
"source": "IKey myKeyLookup = Key.fromLookup(this, \"MyKeyLookup\", KeyLookupOptions.builder()\n .aliasName(\"alias/KeyAlias\")\n .build());\n\nRole role = Role.Builder.create(this, \"MyRole\")\n .assumedBy(new ServicePrincipal(\"lambda.amazonaws.com\"))\n .build();\nmyKeyLookup.grantEncryptDecrypt(role);",
"version": "1"
},
"go": {
"source": "myKeyLookup := kms.key.fromLookup(this, jsii.String(\"MyKeyLookup\"), &keyLookupOptions{\n\taliasName: jsii.String(\"alias/KeyAlias\"),\n})\n\nrole := iam.NewRole(this, jsii.String(\"MyRole\"), &roleProps{\n\tassumedBy: iam.NewServicePrincipal(jsii.String(\"lambda.amazonaws.com\")),\n})\nmyKeyLookup.grantEncryptDecrypt(role)",
"version": "1"
},
"$": {
"source": "const myKeyLookup = kms.Key.fromLookup(this, 'MyKeyLookup', {\n aliasName: 'alias/KeyAlias',\n});\n\nconst role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),\n});\nmyKeyLookup.grantEncryptDecrypt(role);",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 146
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-iam.IGrantable",
"@aws-cdk/aws-iam.IPrincipal",
"@aws-cdk/aws-iam.Role",
"@aws-cdk/aws-iam.RoleProps",
"@aws-cdk/aws-iam.ServicePrincipal",
"@aws-cdk/aws-kms.IKey",
"@aws-cdk/aws-kms.IKey#grantEncryptDecrypt",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.Key#fromLookup",
"@aws-cdk/aws-kms.KeyLookupOptions",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst myKeyLookup = kms.Key.fromLookup(this, 'MyKeyLookup', {\n aliasName: 'alias/KeyAlias',\n});\n\nconst role = new iam.Role(this, 'MyRole', {\n assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'),\n});\nmyKeyLookup.grantEncryptDecrypt(role);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 4,
"75": 14,
"104": 2,
"193": 2,
"194": 5,
"196": 2,
"197": 2,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"281": 2
},
"fqnsFingerprint": "26b3bcee08c2320d35d3665e0008627296a2fcd4b2d7aaf4e601367fbcf34bbd"
},
"d13662c3a69e47308b1f2a3294ff1820099daece484aca2e49d9d31e56e5268c": {
"translations": {
"python": {
"source": "kms.Key(self, \"MyKey\", trust_account_identities=True)",
"version": "2"
},
"csharp": {
"source": "new Key(this, \"MyKey\", new KeyProps { TrustAccountIdentities = true });",
"version": "1"
},
"java": {
"source": "Key.Builder.create(this, \"MyKey\").trustAccountIdentities(true).build();",
"version": "1"
},
"go": {
"source": "kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\ttrustAccountIdentities: jsii.Boolean(true),\n})",
"version": "1"
},
"$": {
"source": "new kms.Key(this, 'MyKey', { trustAccountIdentities: true });",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 175
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew kms.Key(this, 'MyKey', { trustAccountIdentities: true });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 1,
"75": 3,
"104": 1,
"106": 1,
"193": 1,
"194": 1,
"197": 1,
"226": 1,
"281": 1
},
"fqnsFingerprint": "0916683fae71d7975297147cfff0b1a17e9636759086d074aba647a1c232945c"
},
"1cbc37414aaf63842ec625d105c85480d31650ed3283d25dc08ba2b1f3813f4a": {
"translations": {
"python": {
"source": "key = kms.Key(self, \"MyKey\")\nuser = iam.User(self, \"MyUser\")\nkey.grant_encrypt(user)",
"version": "2"
},
"csharp": {
"source": "Key key = new Key(this, \"MyKey\");\nUser user = new User(this, \"MyUser\");\nkey.GrantEncrypt(user);",
"version": "1"
},
"java": {
"source": "Key key = new Key(this, \"MyKey\");\nUser user = new User(this, \"MyUser\");\nkey.grantEncrypt(user);",
"version": "1"
},
"go": {
"source": "key := kms.NewKey(this, jsii.String(\"MyKey\"))\nuser := iam.NewUser(this, jsii.String(\"MyUser\"))\nkey.grantEncrypt(user)",
"version": "1"
},
"$": {
"source": "const key = new kms.Key(this, 'MyKey');\nconst user = new iam.User(this, 'MyUser');\nkey.grantEncrypt(user); // Adds encrypt permissions to user policy; key policy is unmodified.",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 195
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-iam.IGrantable",
"@aws-cdk/aws-iam.User",
"@aws-cdk/aws-kms.Key",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst key = new kms.Key(this, 'MyKey');\nconst user = new iam.User(this, 'MyUser');\nkey.grantEncrypt(user);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 2,
"75": 9,
"104": 2,
"194": 3,
"196": 1,
"197": 2,
"225": 2,
"226": 1,
"242": 2,
"243": 2
},
"fqnsFingerprint": "2e2ce15bddd101571710485cad6924dc533901cbf96d6480866b6fe198bb18a3"
},
"83548013773869deaaff419520eff5f6a8184d387e76d7562ae68d16e4af0ad5": {
"translations": {
"python": {
"source": "my_trusted_admin_role = iam.Role.from_role_arn(self, \"TrustedRole\", \"arn:aws:iam:....\")\nkey = kms.Key(self, \"MyKey\",\n admins=[my_trusted_admin_role]\n)\n\nsecond_key = kms.Key(self, \"MyKey2\")\nsecond_key.grant_admin(my_trusted_admin_role)",
"version": "2"
},
"csharp": {
"source": "IRole myTrustedAdminRole = Role.FromRoleArn(this, \"TrustedRole\", \"arn:aws:iam:....\");\nKey key = new Key(this, \"MyKey\", new KeyProps {\n Admins = new [] { myTrustedAdminRole }\n});\n\nKey secondKey = new Key(this, \"MyKey2\");\nsecondKey.GrantAdmin(myTrustedAdminRole);",
"version": "1"
},
"java": {
"source": "IRole myTrustedAdminRole = Role.fromRoleArn(this, \"TrustedRole\", \"arn:aws:iam:....\");\nKey key = Key.Builder.create(this, \"MyKey\")\n .admins(List.of(myTrustedAdminRole))\n .build();\n\nKey secondKey = new Key(this, \"MyKey2\");\nsecondKey.grantAdmin(myTrustedAdminRole);",
"version": "1"
},
"go": {
"source": "myTrustedAdminRole := iam.role.fromRoleArn(this, jsii.String(\"TrustedRole\"), jsii.String(\"arn:aws:iam:....\"))\nkey := kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\tadmins: []iPrincipal{\n\t\tmyTrustedAdminRole,\n\t},\n})\n\nsecondKey := kms.NewKey(this, jsii.String(\"MyKey2\"))\nsecondKey.grantAdmin(myTrustedAdminRole)",
"version": "1"
},
"$": {
"source": "const myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');\nconst key = new kms.Key(this, 'MyKey', {\n admins: [myTrustedAdminRole],\n});\n\nconst secondKey = new kms.Key(this, 'MyKey2');\nsecondKey.grantAdmin(myTrustedAdminRole);",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 214
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-iam.IGrantable",
"@aws-cdk/aws-iam.IRole",
"@aws-cdk/aws-iam.Role",
"@aws-cdk/aws-iam.Role#fromRoleArn",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.Key#grantAdmin",
"@aws-cdk/aws-kms.KeyProps",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');\nconst key = new kms.Key(this, 'MyKey', {\n admins: [myTrustedAdminRole],\n});\n\nconst secondKey = new kms.Key(this, 'MyKey2');\nsecondKey.grantAdmin(myTrustedAdminRole);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 4,
"75": 15,
"104": 3,
"192": 1,
"193": 1,
"194": 5,
"196": 2,
"197": 2,
"225": 3,
"226": 1,
"242": 3,
"243": 3,
"281": 1
},
"fqnsFingerprint": "7a3298ce5529316fdff2b5611008cbb97888d3219c6b92a1a69f6c7cae2dab82"
},
"67ad2cd93fdfe3e3ec88fb2f373db52724c88e5880e689727c54295c38237296": {
"translations": {
"python": {
"source": "my_trusted_admin_role = iam.Role.from_role_arn(self, \"TrustedRole\", \"arn:aws:iam:....\")\n# Creates a limited admin policy and assigns to the account root.\nmy_custom_policy = iam.PolicyDocument(\n statements=[iam.PolicyStatement(\n actions=[\"kms:Create*\", \"kms:Describe*\", \"kms:Enable*\", \"kms:List*\", \"kms:Put*\"\n ],\n principals=[iam.AccountRootPrincipal()],\n resources=[\"*\"]\n )]\n)\nkey = kms.Key(self, \"MyKey\",\n policy=my_custom_policy\n)",
"version": "2"
},
"csharp": {
"source": "IRole myTrustedAdminRole = Role.FromRoleArn(this, \"TrustedRole\", \"arn:aws:iam:....\");\n// Creates a limited admin policy and assigns to the account root.\nPolicyDocument myCustomPolicy = new PolicyDocument(new PolicyDocumentProps {\n Statements = new [] { new PolicyStatement(new PolicyStatementProps {\n Actions = new [] { \"kms:Create*\", \"kms:Describe*\", \"kms:Enable*\", \"kms:List*\", \"kms:Put*\" },\n Principals = new [] { new AccountRootPrincipal() },\n Resources = new [] { \"*\" }\n }) }\n});\nKey key = new Key(this, \"MyKey\", new KeyProps {\n Policy = myCustomPolicy\n});",
"version": "1"
},
"java": {
"source": "IRole myTrustedAdminRole = Role.fromRoleArn(this, \"TrustedRole\", \"arn:aws:iam:....\");\n// Creates a limited admin policy and assigns to the account root.\nPolicyDocument myCustomPolicy = PolicyDocument.Builder.create()\n .statements(List.of(PolicyStatement.Builder.create()\n .actions(List.of(\"kms:Create*\", \"kms:Describe*\", \"kms:Enable*\", \"kms:List*\", \"kms:Put*\"))\n .principals(List.of(new AccountRootPrincipal()))\n .resources(List.of(\"*\"))\n .build()))\n .build();\nKey key = Key.Builder.create(this, \"MyKey\")\n .policy(myCustomPolicy)\n .build();",
"version": "1"
},
"go": {
"source": "myTrustedAdminRole := iam.role.fromRoleArn(this, jsii.String(\"TrustedRole\"), jsii.String(\"arn:aws:iam:....\"))\n// Creates a limited admin policy and assigns to the account root.\nmyCustomPolicy := iam.NewPolicyDocument(&policyDocumentProps{\n\tstatements: []policyStatement{\n\t\tiam.NewPolicyStatement(&policyStatementProps{\n\t\t\tactions: []*string{\n\t\t\t\tjsii.String(\"kms:Create*\"),\n\t\t\t\tjsii.String(\"kms:Describe*\"),\n\t\t\t\tjsii.String(\"kms:Enable*\"),\n\t\t\t\tjsii.String(\"kms:List*\"),\n\t\t\t\tjsii.String(\"kms:Put*\"),\n\t\t\t},\n\t\t\tprincipals: []iPrincipal{\n\t\t\t\tiam.NewAccountRootPrincipal(),\n\t\t\t},\n\t\t\tresources: []*string{\n\t\t\t\tjsii.String(\"*\"),\n\t\t\t},\n\t\t}),\n\t},\n})\nkey := kms.NewKey(this, jsii.String(\"MyKey\"), &keyProps{\n\tpolicy: myCustomPolicy,\n})",
"version": "1"
},
"$": {
"source": "const myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');\n// Creates a limited admin policy and assigns to the account root.\nconst myCustomPolicy = new iam.PolicyDocument({\n statements: [new iam.PolicyStatement({\n actions: [\n 'kms:Create*',\n 'kms:Describe*',\n 'kms:Enable*',\n 'kms:List*',\n 'kms:Put*',\n ],\n principals: [new iam.AccountRootPrincipal()],\n resources: ['*'],\n })],\n});\nconst key = new kms.Key(this, 'MyKey', {\n policy: myCustomPolicy,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-kms"
},
"field": {
"field": "markdown",
"line": 230
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-iam.AccountRootPrincipal",
"@aws-cdk/aws-iam.IRole",
"@aws-cdk/aws-iam.PolicyDocument",
"@aws-cdk/aws-iam.PolicyDocumentProps",
"@aws-cdk/aws-iam.PolicyStatement",
"@aws-cdk/aws-iam.PolicyStatementProps",
"@aws-cdk/aws-iam.Role",
"@aws-cdk/aws-iam.Role#fromRoleArn",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-kms.KeyProps",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { Duration, Stack } from '@aws-cdk/core';\nimport * as kms from '@aws-cdk/aws-kms';\nimport * as iam from '@aws-cdk/aws-iam';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst myTrustedAdminRole = iam.Role.fromRoleArn(this, 'TrustedRole', 'arn:aws:iam:....');\n// Creates a limited admin policy and assigns to the account root.\nconst myCustomPolicy = new iam.PolicyDocument({\n statements: [new iam.PolicyStatement({\n actions: [\n 'kms:Create*',\n 'kms:Describe*',\n 'kms:Enable*',\n 'kms:List*',\n 'kms:Put*',\n ],\n principals: [new iam.AccountRootPrincipal()],\n resources: ['*'],\n })],\n});\nconst key = new kms.Key(this, 'MyKey', {\n policy: myCustomPolicy,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n\n",
"syntaxKindCounter": {
"10": 9,
"75": 20,
"104": 2,
"192": 4,
"193": 3,
"194": 6,
"196": 1,
"197": 4,
"225": 3,
"242": 3,
"243": 3,
"281": 5
},
"fqnsFingerprint": "934404f881a4076b95e1653ee0ba8630dc2e38b336a690d4f27debcc1059e395"
},
"26ebf12061946d80c1a4c164b44540bc795645fcdeb943e9d99220280ca7c4fc": {
"translations": {
"python": {
"source": "# Passing an encrypted replication bucket created in a different stack.\napp = App()\nreplication_stack = Stack(app, \"ReplicationStack\",\n env=Environment(\n region=\"us-west-1\"\n )\n)\nkey = kms.Key(replication_stack, \"ReplicationKey\")\nalias = kms.Alias(replication_stack, \"ReplicationAlias\",\n # aliasName is required\n alias_name=PhysicalName.GENERATE_IF_NEEDED,\n target_key=key\n)\nreplication_bucket = s3.Bucket(replication_stack, \"ReplicationBucket\",\n bucket_name=PhysicalName.GENERATE_IF_NEEDED,\n encryption_key=alias\n)",
"version": "2"
},
"csharp": {
"source": "// Passing an encrypted replication bucket created in a different stack.\nApp app = new App();\nStack replicationStack = new Stack(app, \"ReplicationStack\", new StackProps {\n Env = new Environment {\n Region = \"us-west-1\"\n }\n});\nKey key = new Key(replicationStack, \"ReplicationKey\");\nAlias alias = new Alias(replicationStack, \"ReplicationAlias\", new AliasProps {\n // aliasName is required\n AliasName = PhysicalName.GENERATE_IF_NEEDED,\n TargetKey = key\n});\nBucket replicationBucket = new Bucket(replicationStack, \"ReplicationBucket\", new BucketProps {\n BucketName = PhysicalName.GENERATE_IF_NEEDED,\n EncryptionKey = alias\n});",
"version": "1"
},
"java": {
"source": "// Passing an encrypted replication bucket created in a different stack.\nApp app = new App();\nStack replicationStack = Stack.Builder.create(app, \"ReplicationStack\")\n .env(Environment.builder()\n .region(\"us-west-1\")\n .build())\n .build();\nKey key = new Key(replicationStack, \"ReplicationKey\");\nAlias alias = Alias.Builder.create(replicationStack, \"ReplicationAlias\")\n // aliasName is required\n .aliasName(PhysicalName.GENERATE_IF_NEEDED)\n .targetKey(key)\n .build();\nBucket replicationBucket = Bucket.Builder.create(replicationStack, \"ReplicationBucket\")\n .bucketName(PhysicalName.GENERATE_IF_NEEDED)\n .encryptionKey(alias)\n .build();",
"version": "1"
},
"go": {
"source": "// Passing an encrypted replication bucket created in a different stack.\napp := awscdkcore.NewApp()\nreplicationStack := awscdkcore.Newstack(app, jsii.String(\"ReplicationStack\"), &stackProps{\n\tenv: &environment{\n\t\tregion: jsii.String(\"us-west-1\"),\n\t},\n})\nkey := kms.NewKey(replicationStack, jsii.String(\"ReplicationKey\"))\nalias := kms.NewAlias(replicationStack, jsii.String(\"ReplicationAlias\"), &aliasProps{\n\t// aliasName is required\n\taliasName: *awscdkcore.PhysicalName_GENERATE_IF_NEEDED(),\n\ttargetKey: key,\n})\nreplicationBucket := s3.NewBucket(replicationStack, jsii.String(\"ReplicationBucket\"), &bucketProps{\n\tbucketName: *awscdkcore.PhysicalName_GENERATE_IF_NEEDED(),\n\tencryptionKey: alias,\n})",
"version": "1"
},
"$": {
"source": "// Passing an encrypted replication bucket created in a different stack.\nconst app = new App();\nconst replicationStack = new Stack(app, 'ReplicationStack', {\n env: {\n region: 'us-west-1',\n },\n});\nconst key = new kms.Key(replicationStack, 'ReplicationKey');\nconst alias = new kms.Alias(replicationStack, 'ReplicationAlias', {\n // aliasName is required\n aliasName: PhysicalName.GENERATE_IF_NEEDED,\n targetKey: key,\n});\nconst replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', {\n bucketName: PhysicalName.GENERATE_IF_NEEDED,\n encryptionKey: alias,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "type",
"fqn": "@aws-cdk/aws-kms.Alias"
},
"field": {
"field": "example"
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.Alias",
"@aws-cdk/aws-kms.AliasProps",
"@aws-cdk/aws-kms.IKey",
"@aws-cdk/aws-kms.Key",
"@aws-cdk/aws-s3.Bucket",
"@aws-cdk/aws-s3.BucketProps",
"@aws-cdk/core.App",
"@aws-cdk/core.Environment",
"@aws-cdk/core.PhysicalName#GENERATE_IF_NEEDED",
"@aws-cdk/core.Stack",
"@aws-cdk/core.StackProps",
"constructs.Construct"
],
"fullSource": "import { Construct } from 'constructs';\nimport { App, Duration, PhysicalName, Stack } from '@aws-cdk/core';\nimport * as codepipeline from '@aws-cdk/aws-codepipeline';\nimport * as codepipeline_actions from '@aws-cdk/aws-codepipeline-actions';\nimport * as s3 from '@aws-cdk/aws-s3';\nimport * as iam from '@aws-cdk/aws-iam';\nimport * as kms from '@aws-cdk/aws-kms';\n\nclass Context extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n// Passing an encrypted replication bucket created in a different stack.\nconst app = new App();\nconst replicationStack = new Stack(app, 'ReplicationStack', {\n env: {\n region: 'us-west-1',\n },\n});\nconst key = new kms.Key(replicationStack, 'ReplicationKey');\nconst alias = new kms.Alias(replicationStack, 'ReplicationAlias', {\n // aliasName is required\n aliasName: PhysicalName.GENERATE_IF_NEEDED,\n targetKey: key,\n});\nconst replicationBucket = new s3.Bucket(replicationStack, 'ReplicationBucket', {\n bucketName: PhysicalName.GENERATE_IF_NEEDED,\n encryptionKey: alias,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"10": 5,
"75": 29,
"193": 4,
"194": 5,
"197": 5,
"225": 5,
"242": 5,
"243": 5,
"281": 6
},
"fqnsFingerprint": "2d48719e0d496742cfc083acd40ed56b694a7203eb571c89489f1cdffd1cbb79"
},
"124483fdd22883535ad422f403294df9e329b51d6e11a85590ea300e82d8d56f": {
"translations": {
"python": {
"source": "# The code below shows an example of how to instantiate this type.\n# The values are placeholders you should change.\nimport aws_cdk.aws_kms as kms\n\n# key: kms.Key\n\nalias_attributes = kms.AliasAttributes(\n alias_name=\"aliasName\",\n alias_target_key=key\n)",
"version": "2"
},
"csharp": {
"source": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nusing Amazon.CDK.AWS.KMS;\n\nKey key;\n\nAliasAttributes aliasAttributes = new AliasAttributes {\n AliasName = \"aliasName\",\n AliasTargetKey = key\n};",
"version": "1"
},
"java": {
"source": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport software.amazon.awscdk.services.kms.*;\n\nKey key;\n\nAliasAttributes aliasAttributes = AliasAttributes.builder()\n .aliasName(\"aliasName\")\n .aliasTargetKey(key)\n .build();",
"version": "1"
},
"go": {
"source": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport kms \"github.com/aws-samples/dummy/awscdkawskms\"\n\nvar key key\n\naliasAttributes := &aliasAttributes{\n\taliasName: jsii.String(\"aliasName\"),\n\taliasTargetKey: key,\n}",
"version": "1"
},
"$": {
"source": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as kms from '@aws-cdk/aws-kms';\n\ndeclare const key: kms.Key;\nconst aliasAttributes: kms.AliasAttributes = {\n aliasName: 'aliasName',\n aliasTargetKey: key,\n};",
"version": "0"
}
},
"location": {
"api": {
"api": "type",
"fqn": "@aws-cdk/aws-kms.AliasAttributes"
},
"field": {
"field": "example"
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-kms.AliasAttributes",
"@aws-cdk/aws-kms.IKey"
],
"