code: async function disableCryptoKeyVersion(
    projectId = 'your-project-id', // Your GCP Project ID
    keyRingId = 'my-key-ring', // Name of the crypto key version's key ring
    cryptoKeyId = 'my-key', // Name of the version's crypto key
    version = 1234 // The version's id
  ) {
    // Import the library and create a client
    const kms = require('@google-cloud/kms');
    const client = new kms.KeyManagementServiceClient();
  
    // The location of the crypto key versions's key ring, e.g. "global"
    const locationId = 'global';
  
    // Get the full path to the crypto key
    const name = client.cryptoKeyVersionPath(
      projectId,
      locationId,
      keyRingId,
      cryptoKeyId,
      version
    );
  
    // Gets a crypto key version
    const [cryptoKeyVersion] = await client.getCryptoKeyVersion({name});
    cryptoKeyVersion.state = 'DISABLED';
  
    // Disables a crypto key version
    const [result] = await client.updateCryptoKeyVersion({
      cryptoKeyVersion,
      updateMask: ['state'],
    });
    console.log(`Crypto key version ${result.name} disabled.`);
  }
docs: [START kms_disable_cryptokey_version]