# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetKMSCryptoKeyVersionResult',
    'AwaitableGetKMSCryptoKeyVersionResult',
    'get_kms_crypto_key_version',
    'get_kms_crypto_key_version_output',
]

@pulumi.output_type
class GetKMSCryptoKeyVersionResult:
    """
    A collection of values returned by getKMSCryptoKeyVersion.
    """
    def __init__(__self__, algorithm=None, crypto_key=None, id=None, name=None, protection_level=None, public_keys=None, state=None, version=None):
        if algorithm and not isinstance(algorithm, str):
            raise TypeError("Expected argument 'algorithm' to be a str")
        pulumi.set(__self__, "algorithm", algorithm)
        if crypto_key and not isinstance(crypto_key, str):
            raise TypeError("Expected argument 'crypto_key' to be a str")
        pulumi.set(__self__, "crypto_key", crypto_key)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if protection_level and not isinstance(protection_level, str):
            raise TypeError("Expected argument 'protection_level' to be a str")
        pulumi.set(__self__, "protection_level", protection_level)
        if public_keys and not isinstance(public_keys, list):
            raise TypeError("Expected argument 'public_keys' to be a list")
        pulumi.set(__self__, "public_keys", public_keys)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if version and not isinstance(version, int):
            raise TypeError("Expected argument 'version' to be a int")
        pulumi.set(__self__, "version", version)

    @property
    @pulumi.getter
    def algorithm(self) -> str:
        """
        The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
        """
        return pulumi.get(self, "algorithm")

    @property
    @pulumi.getter(name="cryptoKey")
    def crypto_key(self) -> str:
        return pulumi.get(self, "crypto_key")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="protectionLevel")
    def protection_level(self) -> str:
        """
        The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion. See the [protection_level reference](https://cloud.google.com/kms/docs/reference/rest/v1/ProtectionLevel) for possible outputs.
        """
        return pulumi.get(self, "protection_level")

    @property
    @pulumi.getter(name="publicKeys")
    def public_keys(self) -> Sequence['outputs.GetKMSCryptoKeyVersionPublicKeyResult']:
        """
        If the enclosing CryptoKey has purpose `ASYMMETRIC_SIGN` or `ASYMMETRIC_DECRYPT`, this block contains details about the public key associated to this CryptoKeyVersion. Structure is documented below.
        """
        return pulumi.get(self, "public_keys")

    @property
    @pulumi.getter
    def state(self) -> str:
        """
        The current state of the CryptoKeyVersion. See the [state reference](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions#CryptoKeyVersion.CryptoKeyVersionState) for possible outputs.
        """
        return pulumi.get(self, "state")

    @property
    @pulumi.getter
    def version(self) -> Optional[int]:
        return pulumi.get(self, "version")


class AwaitableGetKMSCryptoKeyVersionResult(GetKMSCryptoKeyVersionResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetKMSCryptoKeyVersionResult(
            algorithm=self.algorithm,
            crypto_key=self.crypto_key,
            id=self.id,
            name=self.name,
            protection_level=self.protection_level,
            public_keys=self.public_keys,
            state=self.state,
            version=self.version)


def get_kms_crypto_key_version(crypto_key: Optional[str] = None,
                               version: Optional[int] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetKMSCryptoKeyVersionResult:
    """
    Provides access to a Google Cloud Platform KMS CryptoKeyVersion. For more information see
    [the official documentation](https://cloud.google.com/kms/docs/object-hierarchy#key_version)
    and
    [API](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions).

    A CryptoKeyVersion represents an individual cryptographic key, and the associated key material.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    my_key_ring = gcp.kms.get_kms_key_ring(name="my-key-ring",
        location="us-central1")
    my_crypto_key = gcp.kms.get_kms_crypto_key(name="my-crypto-key",
        key_ring=my_key_ring.id)
    my_crypto_key_version = gcp.kms.get_kms_crypto_key_version(crypto_key=data["google_kms_key"]["my_key"]["id"])
    ```


    :param str crypto_key: The `self_link` of the Google Cloud Platform CryptoKey to which the key version belongs. This is also the `id` field of the 
           `kms.CryptoKey` resource/datasource.
    :param int version: The version number for this CryptoKeyVersion. Defaults to `1`.
    """
    __args__ = dict()
    __args__['cryptoKey'] = crypto_key
    __args__['version'] = version
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('gcp:kms/getKMSCryptoKeyVersion:getKMSCryptoKeyVersion', __args__, opts=opts, typ=GetKMSCryptoKeyVersionResult).value

    return AwaitableGetKMSCryptoKeyVersionResult(
        algorithm=__ret__.algorithm,
        crypto_key=__ret__.crypto_key,
        id=__ret__.id,
        name=__ret__.name,
        protection_level=__ret__.protection_level,
        public_keys=__ret__.public_keys,
        state=__ret__.state,
        version=__ret__.version)


@_utilities.lift_output_func(get_kms_crypto_key_version)
def get_kms_crypto_key_version_output(crypto_key: Optional[pulumi.Input[str]] = None,
                                      version: Optional[pulumi.Input[Optional[int]]] = None,
                                      opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetKMSCryptoKeyVersionResult]:
    """
    Provides access to a Google Cloud Platform KMS CryptoKeyVersion. For more information see
    [the official documentation](https://cloud.google.com/kms/docs/object-hierarchy#key_version)
    and
    [API](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions).

    A CryptoKeyVersion represents an individual cryptographic key, and the associated key material.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    my_key_ring = gcp.kms.get_kms_key_ring(name="my-key-ring",
        location="us-central1")
    my_crypto_key = gcp.kms.get_kms_crypto_key(name="my-crypto-key",
        key_ring=my_key_ring.id)
    my_crypto_key_version = gcp.kms.get_kms_crypto_key_version(crypto_key=data["google_kms_key"]["my_key"]["id"])
    ```


    :param str crypto_key: The `self_link` of the Google Cloud Platform CryptoKey to which the key version belongs. This is also the `id` field of the 
           `kms.CryptoKey` resource/datasource.
    :param int version: The version number for this CryptoKeyVersion. Defaults to `1`.
    """
    ...

[((59, 5, 59, 36), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((80, 5, 80, 42), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((88, 5, 88, 37), 'pulumi.getter', 'pulumi.getter', (), '', False, 'import pulumi\n'), ((27, 8, 27, 52), 'pulumi.set', 'pulumi.set', ({(27, 19, 27, 27): '__self__', (27, 29, 27, 40): '"""algorithm"""', (27, 42, 27, 51): 'algorithm'}, {}), "(__self__, 'algorithm', algorithm)", False, 'import pulumi\n'), ((30, 8, 30, 54), 'pulumi.set', 'pulumi.set', ({(30, 19, 30, 27): '__self__', (30, 29, 30, 41): '"""crypto_key"""', (30, 43, 30, 53): 'crypto_key'}, {}), "(__self__, 'crypto_key', crypto_key)", False, 'import pulumi\n'), ((33, 8, 33, 38), 'pulumi.set', 'pulumi.set', ({(33, 19, 33, 27): '__self__', (33, 29, 33, 33): '"""id"""', (33, 35, 33, 37): 'id'}, {}), "(__self__, 'id', id)", False, 'import pulumi\n'), ((36, 8, 36, 42), 'pulumi.set', 'pulumi.set', ({(36, 19, 36, 27): '__self__', (36, 29, 36, 35): '"""name"""', (36, 37, 36, 41): 'name'}, {}), "(__self__, 'name', name)", False, 'import pulumi\n'), ((39, 8, 39, 66), 'pulumi.set', 'pulumi.set', ({(39, 19, 39, 27): '__self__', (39, 29, 39, 47): '"""protection_level"""', (39, 49, 39, 65): 'protection_level'}, {}), "(__self__, 'protection_level', protection_level)", False, 'import pulumi\n'), ((42, 8, 42, 56), 'pulumi.set', 'pulumi.set', ({(42, 19, 42, 27): '__self__', (42, 29, 42, 42): '"""public_keys"""', (42, 44, 42, 55): 'public_keys'}, {}), "(__self__, 'public_keys', public_keys)", False, 'import pulumi\n'), ((45, 8, 45, 44), 'pulumi.set', 'pulumi.set', ({(45, 19, 45, 27): '__self__', (45, 29, 45, 36): '"""state"""', (45, 38, 45, 43): 'state'}, {}), "(__self__, 'state', state)", False, 'import pulumi\n'), ((48, 8, 48, 48), 'pulumi.set', 'pulumi.set', ({(48, 19, 48, 27): '__self__', (48, 29, 48, 38): '"""version"""', (48, 40, 48, 47): 'version'}, {}), "(__self__, 'version', version)", False, 'import pulumi\n'), ((56, 15, 56, 44), 'pulumi.get', 'pulumi.get', ({(56, 26, 56, 30): 'self', (56, 32, 56, 43): '"""algorithm"""'}, {}), "(self, 'algorithm')", False, 'import pulumi\n'), ((61, 15, 61, 45), 'pulumi.get', 'pulumi.get', ({(61, 26, 61, 30): 'self', (61, 32, 61, 44): '"""crypto_key"""'}, {}), "(self, 'crypto_key')", False, 'import pulumi\n'), ((69, 15, 69, 37), 'pulumi.get', 'pulumi.get', ({(69, 26, 69, 30): 'self', (69, 32, 69, 36): '"""id"""'}, {}), "(self, 'id')", False, 'import pulumi\n'), ((77, 15, 77, 39), 'pulumi.get', 'pulumi.get', ({(77, 26, 77, 30): 'self', (77, 32, 77, 38): '"""name"""'}, {}), "(self, 'name')", False, 'import pulumi\n'), ((85, 15, 85, 51), 'pulumi.get', 'pulumi.get', ({(85, 26, 85, 30): 'self', (85, 32, 85, 50): '"""protection_level"""'}, {}), "(self, 'protection_level')", False, 'import pulumi\n'), ((93, 15, 93, 46), 'pulumi.get', 'pulumi.get', ({(93, 26, 93, 30): 'self', (93, 32, 93, 45): '"""public_keys"""'}, {}), "(self, 'public_keys')", False, 'import pulumi\n'), ((101, 15, 101, 40), 'pulumi.get', 'pulumi.get', ({(101, 26, 101, 30): 'self', (101, 32, 101, 39): '"""state"""'}, {}), "(self, 'state')", False, 'import pulumi\n'), ((106, 15, 106, 42), 'pulumi.get', 'pulumi.get', ({(106, 26, 106, 30): 'self', (106, 32, 106, 41): '"""version"""'}, {}), "(self, 'version')", False, 'import pulumi\n'), ((158, 15, 158, 37), 'pulumi.InvokeOptions', 'pulumi.InvokeOptions', ({}, {}), '()', False, 'import pulumi\n'), ((161, 14, 161, 147), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (), '', False, 'import pulumi\n')]