MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / createKeyLabels

Function createKeyLabels

kms/createKeyLabels.js:41–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 const keyRingName = client.keyRingPath(projectId, locationId, keyRingId);
40
41 async function createKeyLabels() {
42 const [key] = await client.createCryptoKey({
43 parent: keyRingName,
44 cryptoKeyId: id,
45 cryptoKey: {
46 purpose: 'ENCRYPT_DECRYPT',
47 versionTemplate: {
48 algorithm: 'GOOGLE_SYMMETRIC_ENCRYPTION',
49 },
50 labels: {
51 team: 'alpha',
52 cost_center: 'cc1234',
53 },
54 },
55 });
56
57 console.log(`Created labeled key: ${key.name}`);
58 return key;
59 }
60
61 return createKeyLabels();
62 // [END kms_create_key_labels]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected