1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. kms
  5. CryptoKeyIAMMember
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

gcp.kms.CryptoKeyIAMMember

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi

    Three different resources help you manage your IAM policy for KMS crypto key. Each of these resources serves a different use case:

    • gcp.kms.CryptoKeyIAMPolicy: Authoritative. Sets the IAM policy for the crypto key and replaces any existing policy already attached.
    • gcp.kms.CryptoKeyIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the crypto key are preserved.
    • gcp.kms.CryptoKeyIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the crypto key are preserved.

    Note: gcp.kms.CryptoKeyIAMPolicy cannot be used in conjunction with gcp.kms.CryptoKeyIAMBinding and gcp.kms.CryptoKeyIAMMember or they will fight over what your policy should be.

    Note: gcp.kms.CryptoKeyIAMBinding resources can be used in conjunction with gcp.kms.CryptoKeyIAMMember resources only if they do not grant privilege to the same role.

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const keyring = new gcp.kms.KeyRing("keyring", {
        name: "keyring-example",
        location: "global",
    });
    const key = new gcp.kms.CryptoKey("key", {
        name: "crypto-key-example",
        keyRing: keyring.id,
        rotationPeriod: "7776000s",
    });
    const admin = gcp.organizations.getIAMPolicy({
        bindings: [{
            role: "roles/cloudkms.cryptoKeyEncrypter",
            members: ["user:jane@example.com"],
        }],
    });
    const cryptoKey = new gcp.kms.CryptoKeyIAMPolicy("crypto_key", {
        cryptoKeyId: key.id,
        policyData: admin.then(admin => admin.policyData),
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    keyring = gcp.kms.KeyRing("keyring",
        name="keyring-example",
        location="global")
    key = gcp.kms.CryptoKey("key",
        name="crypto-key-example",
        key_ring=keyring.id,
        rotation_period="7776000s")
    admin = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
        role="roles/cloudkms.cryptoKeyEncrypter",
        members=["user:jane@example.com"],
    )])
    crypto_key = gcp.kms.CryptoKeyIAMPolicy("crypto_key",
        crypto_key_id=key.id,
        policy_data=admin.policy_data)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		keyring, err := kms.NewKeyRing(ctx, "keyring", &kms.KeyRingArgs{
    			Name:     pulumi.String("keyring-example"),
    			Location: pulumi.String("global"),
    		})
    		if err != nil {
    			return err
    		}
    		key, err := kms.NewCryptoKey(ctx, "key", &kms.CryptoKeyArgs{
    			Name:           pulumi.String("crypto-key-example"),
    			KeyRing:        keyring.ID(),
    			RotationPeriod: pulumi.String("7776000s"),
    		})
    		if err != nil {
    			return err
    		}
    		admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
    			Bindings: []organizations.GetIAMPolicyBinding{
    				{
    					Role: "roles/cloudkms.cryptoKeyEncrypter",
    					Members: []string{
    						"user:jane@example.com",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = kms.NewCryptoKeyIAMPolicy(ctx, "crypto_key", &kms.CryptoKeyIAMPolicyArgs{
    			CryptoKeyId: key.ID(),
    			PolicyData:  pulumi.String(admin.PolicyData),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var keyring = new Gcp.Kms.KeyRing("keyring", new()
        {
            Name = "keyring-example",
            Location = "global",
        });
    
        var key = new Gcp.Kms.CryptoKey("key", new()
        {
            Name = "crypto-key-example",
            KeyRing = keyring.Id,
            RotationPeriod = "7776000s",
        });
    
        var admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
        {
            Bindings = new[]
            {
                new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
                {
                    Role = "roles/cloudkms.cryptoKeyEncrypter",
                    Members = new[]
                    {
                        "user:jane@example.com",
                    },
                },
            },
        });
    
        var cryptoKey = new Gcp.Kms.CryptoKeyIAMPolicy("crypto_key", new()
        {
            CryptoKeyId = key.Id,
            PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.KeyRing;
    import com.pulumi.gcp.kms.KeyRingArgs;
    import com.pulumi.gcp.kms.CryptoKey;
    import com.pulumi.gcp.kms.CryptoKeyArgs;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
    import com.pulumi.gcp.kms.CryptoKeyIAMPolicy;
    import com.pulumi.gcp.kms.CryptoKeyIAMPolicyArgs;
    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) {
            var keyring = new KeyRing("keyring", KeyRingArgs.builder()        
                .name("keyring-example")
                .location("global")
                .build());
    
            var key = new CryptoKey("key", CryptoKeyArgs.builder()        
                .name("crypto-key-example")
                .keyRing(keyring.id())
                .rotationPeriod("7776000s")
                .build());
    
            final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
                .bindings(GetIAMPolicyBindingArgs.builder()
                    .role("roles/cloudkms.cryptoKeyEncrypter")
                    .members("user:jane@example.com")
                    .build())
                .build());
    
            var cryptoKey = new CryptoKeyIAMPolicy("cryptoKey", CryptoKeyIAMPolicyArgs.builder()        
                .cryptoKeyId(key.id())
                .policyData(admin.applyValue(getIAMPolicyResult -> getIAMPolicyResult.policyData()))
                .build());
    
        }
    }
    
    resources:
      keyring:
        type: gcp:kms:KeyRing
        properties:
          name: keyring-example
          location: global
      key:
        type: gcp:kms:CryptoKey
        properties:
          name: crypto-key-example
          keyRing: ${keyring.id}
          rotationPeriod: 7776000s
      cryptoKey:
        type: gcp:kms:CryptoKeyIAMPolicy
        name: crypto_key
        properties:
          cryptoKeyId: ${key.id}
          policyData: ${admin.policyData}
    variables:
      admin:
        fn::invoke:
          Function: gcp:organizations:getIAMPolicy
          Arguments:
            bindings:
              - role: roles/cloudkms.cryptoKeyEncrypter
                members:
                  - user:jane@example.com
    

    With IAM Conditions:

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const admin = gcp.organizations.getIAMPolicy({
        bindings: [{
            role: "roles/cloudkms.cryptoKeyEncrypter",
            members: ["user:jane@example.com"],
            condition: {
                title: "expires_after_2019_12_31",
                description: "Expiring at midnight of 2019-12-31",
                expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    admin = gcp.organizations.get_iam_policy(bindings=[gcp.organizations.GetIAMPolicyBindingArgs(
        role="roles/cloudkms.cryptoKeyEncrypter",
        members=["user:jane@example.com"],
        condition=gcp.organizations.GetIAMPolicyBindingConditionArgs(
            title="expires_after_2019_12_31",
            description="Expiring at midnight of 2019-12-31",
            expression="request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        ),
    )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
    			Bindings: []organizations.GetIAMPolicyBinding{
    				{
    					Role: "roles/cloudkms.cryptoKeyEncrypter",
    					Members: []string{
    						"user:jane@example.com",
    					},
    					Condition: {
    						Title:       "expires_after_2019_12_31",
    						Description: pulumi.StringRef("Expiring at midnight of 2019-12-31"),
    						Expression:  "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
        {
            Bindings = new[]
            {
                new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
                {
                    Role = "roles/cloudkms.cryptoKeyEncrypter",
                    Members = new[]
                    {
                        "user:jane@example.com",
                    },
                    Condition = new Gcp.Organizations.Inputs.GetIAMPolicyBindingConditionInputArgs
                    {
                        Title = "expires_after_2019_12_31",
                        Description = "Expiring at midnight of 2019-12-31",
                        Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.OrganizationsFunctions;
    import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
    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 admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
                .bindings(GetIAMPolicyBindingArgs.builder()
                    .role("roles/cloudkms.cryptoKeyEncrypter")
                    .members("user:jane@example.com")
                    .condition(GetIAMPolicyBindingConditionArgs.builder()
                        .title("expires_after_2019_12_31")
                        .description("Expiring at midnight of 2019-12-31")
                        .expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
                        .build())
                    .build())
                .build());
    
        }
    }
    
    variables:
      admin:
        fn::invoke:
          Function: gcp:organizations:getIAMPolicy
          Arguments:
            bindings:
              - role: roles/cloudkms.cryptoKeyEncrypter
                members:
                  - user:jane@example.com
                condition:
                  title: expires_after_2019_12_31
                  description: Expiring at midnight of 2019-12-31
                  expression: request.time < timestamp("2020-01-01T00:00:00Z")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const cryptoKey = new gcp.kms.CryptoKeyIAMBinding("crypto_key", {
        cryptoKeyId: key.id,
        role: "roles/cloudkms.cryptoKeyEncrypter",
        members: ["user:jane@example.com"],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    crypto_key = gcp.kms.CryptoKeyIAMBinding("crypto_key",
        crypto_key_id=key["id"],
        role="roles/cloudkms.cryptoKeyEncrypter",
        members=["user:jane@example.com"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.NewCryptoKeyIAMBinding(ctx, "crypto_key", &kms.CryptoKeyIAMBindingArgs{
    			CryptoKeyId: pulumi.Any(key.Id),
    			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypter"),
    			Members: pulumi.StringArray{
    				pulumi.String("user:jane@example.com"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var cryptoKey = new Gcp.Kms.CryptoKeyIAMBinding("crypto_key", new()
        {
            CryptoKeyId = key.Id,
            Role = "roles/cloudkms.cryptoKeyEncrypter",
            Members = new[]
            {
                "user:jane@example.com",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.CryptoKeyIAMBinding;
    import com.pulumi.gcp.kms.CryptoKeyIAMBindingArgs;
    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) {
            var cryptoKey = new CryptoKeyIAMBinding("cryptoKey", CryptoKeyIAMBindingArgs.builder()        
                .cryptoKeyId(key.id())
                .role("roles/cloudkms.cryptoKeyEncrypter")
                .members("user:jane@example.com")
                .build());
    
        }
    }
    
    resources:
      cryptoKey:
        type: gcp:kms:CryptoKeyIAMBinding
        name: crypto_key
        properties:
          cryptoKeyId: ${key.id}
          role: roles/cloudkms.cryptoKeyEncrypter
          members:
            - user:jane@example.com
    

    With IAM Conditions:

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const cryptoKey = new gcp.kms.CryptoKeyIAMBinding("crypto_key", {
        cryptoKeyId: key.id,
        role: "roles/cloudkms.cryptoKeyEncrypter",
        members: ["user:jane@example.com"],
        condition: {
            title: "expires_after_2019_12_31",
            description: "Expiring at midnight of 2019-12-31",
            expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    crypto_key = gcp.kms.CryptoKeyIAMBinding("crypto_key",
        crypto_key_id=key["id"],
        role="roles/cloudkms.cryptoKeyEncrypter",
        members=["user:jane@example.com"],
        condition=gcp.kms.CryptoKeyIAMBindingConditionArgs(
            title="expires_after_2019_12_31",
            description="Expiring at midnight of 2019-12-31",
            expression="request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.NewCryptoKeyIAMBinding(ctx, "crypto_key", &kms.CryptoKeyIAMBindingArgs{
    			CryptoKeyId: pulumi.Any(key.Id),
    			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypter"),
    			Members: pulumi.StringArray{
    				pulumi.String("user:jane@example.com"),
    			},
    			Condition: &kms.CryptoKeyIAMBindingConditionArgs{
    				Title:       pulumi.String("expires_after_2019_12_31"),
    				Description: pulumi.String("Expiring at midnight of 2019-12-31"),
    				Expression:  pulumi.String("request.time < timestamp(\"2020-01-01T00:00:00Z\")"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var cryptoKey = new Gcp.Kms.CryptoKeyIAMBinding("crypto_key", new()
        {
            CryptoKeyId = key.Id,
            Role = "roles/cloudkms.cryptoKeyEncrypter",
            Members = new[]
            {
                "user:jane@example.com",
            },
            Condition = new Gcp.Kms.Inputs.CryptoKeyIAMBindingConditionArgs
            {
                Title = "expires_after_2019_12_31",
                Description = "Expiring at midnight of 2019-12-31",
                Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.CryptoKeyIAMBinding;
    import com.pulumi.gcp.kms.CryptoKeyIAMBindingArgs;
    import com.pulumi.gcp.kms.inputs.CryptoKeyIAMBindingConditionArgs;
    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) {
            var cryptoKey = new CryptoKeyIAMBinding("cryptoKey", CryptoKeyIAMBindingArgs.builder()        
                .cryptoKeyId(key.id())
                .role("roles/cloudkms.cryptoKeyEncrypter")
                .members("user:jane@example.com")
                .condition(CryptoKeyIAMBindingConditionArgs.builder()
                    .title("expires_after_2019_12_31")
                    .description("Expiring at midnight of 2019-12-31")
                    .expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
                    .build())
                .build());
    
        }
    }
    
    resources:
      cryptoKey:
        type: gcp:kms:CryptoKeyIAMBinding
        name: crypto_key
        properties:
          cryptoKeyId: ${key.id}
          role: roles/cloudkms.cryptoKeyEncrypter
          members:
            - user:jane@example.com
          condition:
            title: expires_after_2019_12_31
            description: Expiring at midnight of 2019-12-31
            expression: request.time < timestamp("2020-01-01T00:00:00Z")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", {
        cryptoKeyId: key.id,
        role: "roles/cloudkms.cryptoKeyEncrypter",
        member: "user:jane@example.com",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    crypto_key = gcp.kms.CryptoKeyIAMMember("crypto_key",
        crypto_key_id=key["id"],
        role="roles/cloudkms.cryptoKeyEncrypter",
        member="user:jane@example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key", &kms.CryptoKeyIAMMemberArgs{
    			CryptoKeyId: pulumi.Any(key.Id),
    			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypter"),
    			Member:      pulumi.String("user:jane@example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var cryptoKey = new Gcp.Kms.CryptoKeyIAMMember("crypto_key", new()
        {
            CryptoKeyId = key.Id,
            Role = "roles/cloudkms.cryptoKeyEncrypter",
            Member = "user:jane@example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.CryptoKeyIAMMember;
    import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
    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) {
            var cryptoKey = new CryptoKeyIAMMember("cryptoKey", CryptoKeyIAMMemberArgs.builder()        
                .cryptoKeyId(key.id())
                .role("roles/cloudkms.cryptoKeyEncrypter")
                .member("user:jane@example.com")
                .build());
    
        }
    }
    
    resources:
      cryptoKey:
        type: gcp:kms:CryptoKeyIAMMember
        name: crypto_key
        properties:
          cryptoKeyId: ${key.id}
          role: roles/cloudkms.cryptoKeyEncrypter
          member: user:jane@example.com
    

    With IAM Conditions:

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const cryptoKey = new gcp.kms.CryptoKeyIAMMember("crypto_key", {
        cryptoKeyId: key.id,
        role: "roles/cloudkms.cryptoKeyEncrypter",
        member: "user:jane@example.com",
        condition: {
            title: "expires_after_2019_12_31",
            description: "Expiring at midnight of 2019-12-31",
            expression: "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    crypto_key = gcp.kms.CryptoKeyIAMMember("crypto_key",
        crypto_key_id=key["id"],
        role="roles/cloudkms.cryptoKeyEncrypter",
        member="user:jane@example.com",
        condition=gcp.kms.CryptoKeyIAMMemberConditionArgs(
            title="expires_after_2019_12_31",
            description="Expiring at midnight of 2019-12-31",
            expression="request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/kms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.NewCryptoKeyIAMMember(ctx, "crypto_key", &kms.CryptoKeyIAMMemberArgs{
    			CryptoKeyId: pulumi.Any(key.Id),
    			Role:        pulumi.String("roles/cloudkms.cryptoKeyEncrypter"),
    			Member:      pulumi.String("user:jane@example.com"),
    			Condition: &kms.CryptoKeyIAMMemberConditionArgs{
    				Title:       pulumi.String("expires_after_2019_12_31"),
    				Description: pulumi.String("Expiring at midnight of 2019-12-31"),
    				Expression:  pulumi.String("request.time < timestamp(\"2020-01-01T00:00:00Z\")"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var cryptoKey = new Gcp.Kms.CryptoKeyIAMMember("crypto_key", new()
        {
            CryptoKeyId = key.Id,
            Role = "roles/cloudkms.cryptoKeyEncrypter",
            Member = "user:jane@example.com",
            Condition = new Gcp.Kms.Inputs.CryptoKeyIAMMemberConditionArgs
            {
                Title = "expires_after_2019_12_31",
                Description = "Expiring at midnight of 2019-12-31",
                Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.kms.CryptoKeyIAMMember;
    import com.pulumi.gcp.kms.CryptoKeyIAMMemberArgs;
    import com.pulumi.gcp.kms.inputs.CryptoKeyIAMMemberConditionArgs;
    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) {
            var cryptoKey = new CryptoKeyIAMMember("cryptoKey", CryptoKeyIAMMemberArgs.builder()        
                .cryptoKeyId(key.id())
                .role("roles/cloudkms.cryptoKeyEncrypter")
                .member("user:jane@example.com")
                .condition(CryptoKeyIAMMemberConditionArgs.builder()
                    .title("expires_after_2019_12_31")
                    .description("Expiring at midnight of 2019-12-31")
                    .expression("request.time < timestamp(\"2020-01-01T00:00:00Z\")")
                    .build())
                .build());
    
        }
    }
    
    resources:
      cryptoKey:
        type: gcp:kms:CryptoKeyIAMMember
        name: crypto_key
        properties:
          cryptoKeyId: ${key.id}
          role: roles/cloudkms.cryptoKeyEncrypter
          member: user:jane@example.com
          condition:
            title: expires_after_2019_12_31
            description: Expiring at midnight of 2019-12-31
            expression: request.time < timestamp("2020-01-01T00:00:00Z")
    

    Create CryptoKeyIAMMember Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CryptoKeyIAMMember(name: string, args: CryptoKeyIAMMemberArgs, opts?: CustomResourceOptions);
    @overload
    def CryptoKeyIAMMember(resource_name: str,
                           args: CryptoKeyIAMMemberArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def CryptoKeyIAMMember(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           crypto_key_id: Optional[str] = None,
                           member: Optional[str] = None,
                           role: Optional[str] = None,
                           condition: Optional[CryptoKeyIAMMemberConditionArgs] = None)
    func NewCryptoKeyIAMMember(ctx *Context, name string, args CryptoKeyIAMMemberArgs, opts ...ResourceOption) (*CryptoKeyIAMMember, error)
    public CryptoKeyIAMMember(string name, CryptoKeyIAMMemberArgs args, CustomResourceOptions? opts = null)
    public CryptoKeyIAMMember(String name, CryptoKeyIAMMemberArgs args)
    public CryptoKeyIAMMember(String name, CryptoKeyIAMMemberArgs args, CustomResourceOptions options)
    
    type: gcp:kms:CryptoKeyIAMMember
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CryptoKeyIAMMemberArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CryptoKeyIAMMemberArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CryptoKeyIAMMemberArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CryptoKeyIAMMemberArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CryptoKeyIAMMemberArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var cryptoKeyIAMMemberResource = new Gcp.Kms.CryptoKeyIAMMember("cryptoKeyIAMMemberResource", new()
    {
        CryptoKeyId = "string",
        Member = "string",
        Role = "string",
        Condition = new Gcp.Kms.Inputs.CryptoKeyIAMMemberConditionArgs
        {
            Expression = "string",
            Title = "string",
            Description = "string",
        },
    });
    
    example, err := kms.NewCryptoKeyIAMMember(ctx, "cryptoKeyIAMMemberResource", &kms.CryptoKeyIAMMemberArgs{
    	CryptoKeyId: pulumi.String("string"),
    	Member:      pulumi.String("string"),
    	Role:        pulumi.String("string"),
    	Condition: &kms.CryptoKeyIAMMemberConditionArgs{
    		Expression:  pulumi.String("string"),
    		Title:       pulumi.String("string"),
    		Description: pulumi.String("string"),
    	},
    })
    
    var cryptoKeyIAMMemberResource = new CryptoKeyIAMMember("cryptoKeyIAMMemberResource", CryptoKeyIAMMemberArgs.builder()        
        .cryptoKeyId("string")
        .member("string")
        .role("string")
        .condition(CryptoKeyIAMMemberConditionArgs.builder()
            .expression("string")
            .title("string")
            .description("string")
            .build())
        .build());
    
    crypto_key_iam_member_resource = gcp.kms.CryptoKeyIAMMember("cryptoKeyIAMMemberResource",
        crypto_key_id="string",
        member="string",
        role="string",
        condition=gcp.kms.CryptoKeyIAMMemberConditionArgs(
            expression="string",
            title="string",
            description="string",
        ))
    
    const cryptoKeyIAMMemberResource = new gcp.kms.CryptoKeyIAMMember("cryptoKeyIAMMemberResource", {
        cryptoKeyId: "string",
        member: "string",
        role: "string",
        condition: {
            expression: "string",
            title: "string",
            description: "string",
        },
    });
    
    type: gcp:kms:CryptoKeyIAMMember
    properties:
        condition:
            description: string
            expression: string
            title: string
        cryptoKeyId: string
        member: string
        role: string
    

    CryptoKeyIAMMember Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The CryptoKeyIAMMember resource accepts the following input properties:

    CryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    Member string
    Role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    Condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    CryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    Member string
    Role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    Condition CryptoKeyIAMMemberConditionArgs
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId String
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    member String
    role String
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    member string
    role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    crypto_key_id str
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    member str
    role str
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberConditionArgs
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId String
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    member String
    role String
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition Property Map
    An IAM Condition for a given binding. Structure is documented below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CryptoKeyIAMMember resource produces the following output properties:

    Etag string
    (Computed) The etag of the project's IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    Etag string
    (Computed) The etag of the project's IAM policy.
    Id string
    The provider-assigned unique ID for this managed resource.
    etag String
    (Computed) The etag of the project's IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.
    etag string
    (Computed) The etag of the project's IAM policy.
    id string
    The provider-assigned unique ID for this managed resource.
    etag str
    (Computed) The etag of the project's IAM policy.
    id str
    The provider-assigned unique ID for this managed resource.
    etag String
    (Computed) The etag of the project's IAM policy.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CryptoKeyIAMMember Resource

    Get an existing CryptoKeyIAMMember resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CryptoKeyIAMMemberState, opts?: CustomResourceOptions): CryptoKeyIAMMember
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            condition: Optional[CryptoKeyIAMMemberConditionArgs] = None,
            crypto_key_id: Optional[str] = None,
            etag: Optional[str] = None,
            member: Optional[str] = None,
            role: Optional[str] = None) -> CryptoKeyIAMMember
    func GetCryptoKeyIAMMember(ctx *Context, name string, id IDInput, state *CryptoKeyIAMMemberState, opts ...ResourceOption) (*CryptoKeyIAMMember, error)
    public static CryptoKeyIAMMember Get(string name, Input<string> id, CryptoKeyIAMMemberState? state, CustomResourceOptions? opts = null)
    public static CryptoKeyIAMMember get(String name, Output<String> id, CryptoKeyIAMMemberState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    CryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    Etag string
    (Computed) The etag of the project's IAM policy.
    Member string
    Role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    Condition CryptoKeyIAMMemberConditionArgs
    An IAM Condition for a given binding. Structure is documented below.
    CryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    Etag string
    (Computed) The etag of the project's IAM policy.
    Member string
    Role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId String
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    etag String
    (Computed) The etag of the project's IAM policy.
    member String
    role String
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberCondition
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId string
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    etag string
    (Computed) The etag of the project's IAM policy.
    member string
    role string
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition CryptoKeyIAMMemberConditionArgs
    An IAM Condition for a given binding. Structure is documented below.
    crypto_key_id str
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    etag str
    (Computed) The etag of the project's IAM policy.
    member str
    role str
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
    condition Property Map
    An IAM Condition for a given binding. Structure is documented below.
    cryptoKeyId String
    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.

    • member/members - (Required) Identities that will be granted the privilege in role. Each entry can have one of the following values:
    • allUsers: A special identifier that represents anyone who is on the internet; with or without a Google account.
    • allAuthenticatedUsers: A special identifier that represents anyone who is authenticated with a Google account or a service account.
    • user:{emailid}: An email address that represents a specific Google account. For example, jane@example.com or joe@example.com.
    • serviceAccount:{emailid}: An email address that represents a service account. For example, my-other-app@appspot.gserviceaccount.com.
    • group:{emailid}: An email address that represents a Google group. For example, admins@example.com.
    • domain:{domain}: A G Suite domain (primary, instead of alias) name that represents all the users of that domain. For example, google.com or example.com.
    etag String
    (Computed) The etag of the project's IAM policy.
    member String
    role String
    The role that should be applied. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

    Supporting Types

    CryptoKeyIAMMemberCondition, CryptoKeyIAMMemberConditionArgs

    Expression string
    Textual representation of an expression in Common Expression Language syntax.
    Title string
    A title for the expression, i.e. a short string describing its purpose.
    Description string

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    Expression string
    Textual representation of an expression in Common Expression Language syntax.
    Title string
    A title for the expression, i.e. a short string describing its purpose.
    Description string

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    expression String
    Textual representation of an expression in Common Expression Language syntax.
    title String
    A title for the expression, i.e. a short string describing its purpose.
    description String

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    expression string
    Textual representation of an expression in Common Expression Language syntax.
    title string
    A title for the expression, i.e. a short string describing its purpose.
    description string

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    expression str
    Textual representation of an expression in Common Expression Language syntax.
    title str
    A title for the expression, i.e. a short string describing its purpose.
    description str

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    expression String
    Textual representation of an expression in Common Expression Language syntax.
    title String
    A title for the expression, i.e. a short string describing its purpose.
    description String

    An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

    Warning: The provider considers the role and condition contents (title+description+expression) as the identifier for the binding. This means that if any part of the condition is changed out-of-band, the provider will consider it to be an entirely different resource and will treat it as such.

    Import

    Importing IAM policies

    IAM policy imports use the identifier of the KMS crypto key only. For example:

    • {{project_id}}/{{location}}/{{key_ring_name}}/{{crypto_key_name}}

    An import block (Terraform v1.5.0 and later) can be used to import IAM policies:

    tf

    import {

    id = “{{project_id}}/{{location}}/{{key_ring_name}}/{{crypto_key_name}}”

    to = google_kms_crypto_key_iam_policy.default

    }

    The pulumi import command can also be used:

    $ pulumi import gcp:kms/cryptoKeyIAMMember:CryptoKeyIAMMember default {{project_id}}/{{location}}/{{key_ring_name}}/{{crypto_key_name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.18.0 published on Wednesday, Apr 10, 2024 by Pulumi