getKMSCryptoKeyVersion

Provides access to a Google Cloud Platform KMS CryptoKeyVersion. For more information see the official documentation and API. A CryptoKeyVersion represents an individual cryptographic key, and the associated key material.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KmsFunctions;
import com.pulumi.gcp.kms.inputs.GetKMSKeyRingArgs;
import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyArgs;
import com.pulumi.gcp.kms.inputs.GetKMSCryptoKeyVersionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var myKeyRing = KmsFunctions.getKMSKeyRing(GetKMSKeyRingArgs.builder()
.name("my-key-ring")
.location("us-central1")
.build());
final var myCryptoKey = KmsFunctions.getKMSCryptoKey(GetKMSCryptoKeyArgs.builder()
.name("my-crypto-key")
.keyRing(myKeyRing.applyValue(getKMSKeyRingResult -> getKMSKeyRingResult.id()))
.build());
final var myCryptoKeyVersion = KmsFunctions.getKMSCryptoKeyVersion(GetKMSCryptoKeyVersionArgs.builder()
.cryptoKey(data.google_kms_crypto_key().my_key().id())
.build());
}
}

Return

A collection of values returned by getKMSCryptoKeyVersion.

Parameters

argument

A collection of arguments for invoking getKMSCryptoKeyVersion.


suspend fun getKMSCryptoKeyVersion(cryptoKey: String, version: Int? = null): GetKMSCryptoKeyVersionResult

Return

A collection of values returned by getKMSCryptoKeyVersion.

Parameters

cryptoKey

The id of the Google Cloud Platform CryptoKey to which the key version belongs. This is also the id field of the gcp.kms.CryptoKey resource/datasource.

version

The version number for this CryptoKeyVersion. Defaults to 1.

See also


Return

A collection of values returned by getKMSCryptoKeyVersion.

Parameters

argument

Builder for com.pulumi.gcp.kms.kotlin.inputs.GetKMSCryptoKeyVersionPlainArgs.

See also