# 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 pulumi
import pulumi.runtime

class CryptoKeyIAMBinding(pulumi.CustomResource):
    """
    Allows creation and management of a single binding within IAM policy for
    an existing Google Cloud KMS crypto key.
    """
    def __init__(__self__, __name__, __opts__=None, crypto_key_id=None, members=None, role=None):
        """Create a CryptoKeyIAMBinding resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if not crypto_key_id:
            raise TypeError('Missing required property crypto_key_id')
        elif not isinstance(crypto_key_id, basestring):
            raise TypeError('Expected property crypto_key_id to be a basestring')
        __self__.crypto_key_id = crypto_key_id
        """
        The crypto key ID, in the form
        `{project_id}/{location_name}/{key_ring_name}/{crypto_key_name}` or
        `{location_name}/{key_ring_name}/{crypto_key_name}`.
        In the second form, the provider's project setting will be used as a fallback.
        """
        __props__['cryptoKeyId'] = crypto_key_id

        if not members:
            raise TypeError('Missing required property members')
        elif not isinstance(members, list):
            raise TypeError('Expected property members to be a list')
        __self__.members = members
        """
        A list of users that the role should apply to.
        """
        __props__['members'] = members

        if not role:
            raise TypeError('Missing required property role')
        elif not isinstance(role, basestring):
            raise TypeError('Expected property role to be a basestring')
        __self__.role = role
        """
        The role that should be applied. Only one
        `google_kms_crypto_key_iam_binding` can be used per role. Note that custom roles must be of the format
        `[projects|organizations]/{parent-name}/roles/{role-name}`.
        """
        __props__['role'] = role

        __self__.etag = pulumi.runtime.UNKNOWN
        """
        (Computed) The etag of the crypto key's IAM policy.
        """

        super(CryptoKeyIAMBinding, __self__).__init__(
            'gcp:kms/cryptoKeyIAMBinding:CryptoKeyIAMBinding',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'cryptoKeyId' in outs:
            self.crypto_key_id = outs['cryptoKeyId']
        if 'etag' in outs:
            self.etag = outs['etag']
        if 'members' in outs:
            self.members = outs['members']
        if 'role' in outs:
            self.role = outs['role']

# 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 pulumi
import pulumi.runtime

class CryptoKeyIAMBinding(pulumi.CustomResource):
    """
    Allows creation and management of a single binding within IAM policy for
    an existing Google Cloud KMS crypto key.
    """
    def __init__(__self__, __name__, __opts__=None, crypto_key_id=None, members=None, role=None):
        """Create a CryptoKeyIAMBinding resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if not crypto_key_id:
            raise TypeError('Missing required property crypto_key_id')
        elif not isinstance(crypto_key_id, basestring):
            raise TypeError('Expected property crypto_key_id to be a basestring')
        __self__.crypto_key_id = crypto_key_id
        """
        The crypto key ID, in the form
        `{project_id}/{location_name}/{key_ring_name}/{crypto_key_name}` or
        `{location_name}/{key_ring_name}/{crypto_key_name}`.
        In the second form, the provider's project setting will be used as a fallback.
        """
        __props__['cryptoKeyId'] = crypto_key_id

        if not members:
            raise TypeError('Missing required property members')
        elif not isinstance(members, list):
            raise TypeError('Expected property members to be a list')
        __self__.members = members
        """
        A list of users that the role should apply to.
        """
        __props__['members'] = members

        if not role:
            raise TypeError('Missing required property role')
        elif not isinstance(role, basestring):
            raise TypeError('Expected property role to be a basestring')
        __self__.role = role
        """
        The role that should be applied. Only one
        `google_kms_crypto_key_iam_binding` can be used per role. Note that custom roles must be of the format
        `[projects|organizations]/{parent-name}/roles/{role-name}`.
        """
        __props__['role'] = role

        __self__.etag = pulumi.runtime.UNKNOWN
        """
        (Computed) The etag of the crypto key's IAM policy.
        """

        super(CryptoKeyIAMBinding, __self__).__init__(
            'gcp:kms/cryptoKeyIAMBinding:CryptoKeyIAMBinding',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'cryptoKeyId' in outs:
            self.crypto_key_id = outs['cryptoKeyId']
        if 'etag' in outs:
            self.etag = outs['etag']
        if 'members' in outs:
            self.members = outs['members']
        if 'role' in outs:
            self.role = outs['role']

# 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! *** Allows creation and management of a single binding within IAM policy for     an existing Google Cloud KMS crypto key. Create a CryptoKeyIAMBinding resource with the given unique name, props, and options. The crypto key ID, in the form         `{project_id}/{location_name}/{key_ring_name}/{crypto_key_name}` or         `{location_name}/{key_ring_name}/{crypto_key_name}`.         In the second form, the provider's project setting will be used as a fallback. A list of users that the role should apply to. The role that should be applied. Only one         `google_kms_crypto_key_iam_binding` can be used per role. Note that custom roles must be of the format         `[projects|organizations]/{parent-name}/roles/{role-name}`. (Computed) The etag of the crypto key's IAM policy.