1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. kms
  5. KeyRingIAMBinding
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.kms.KeyRingIAMBinding

Explore with Pulumi AI

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

  • gcp.kms.KeyRingIAMPolicy: Authoritative. Sets the IAM policy for the key ring and replaces any existing policy already attached.
  • gcp.kms.KeyRingIAMBinding: 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 key ring are preserved.
  • gcp.kms.KeyRingIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the key ring are preserved.

Note: gcp.kms.KeyRingIAMPolicy cannot be used in conjunction with gcp.kms.KeyRingIAMBinding and gcp.kms.KeyRingIAMMember or they will fight over what your policy should be.

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

gcp.kms.KeyRingIAMPolicy

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 admin = gcp.organizations.getIAMPolicy({
    bindings: [{
        role: "roles/editor",
        members: ["user:jane@example.com"],
    }],
});
const keyRing = new gcp.kms.KeyRingIAMPolicy("key_ring", {
    keyRingId: keyring.id,
    policyData: admin.then(admin => admin.policyData),
});
Copy
import pulumi
import pulumi_gcp as gcp

keyring = gcp.kms.KeyRing("keyring",
    name="keyring-example",
    location="global")
admin = gcp.organizations.get_iam_policy(bindings=[{
    "role": "roles/editor",
    "members": ["user:jane@example.com"],
}])
key_ring = gcp.kms.KeyRingIAMPolicy("key_ring",
    key_ring_id=keyring.id,
    policy_data=admin.policy_data)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi-gcp/sdk/v8/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
		}
		admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
			Bindings: []organizations.GetIAMPolicyBinding{
				{
					Role: "roles/editor",
					Members: []string{
						"user:jane@example.com",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = kms.NewKeyRingIAMPolicy(ctx, "key_ring", &kms.KeyRingIAMPolicyArgs{
			KeyRingId:  keyring.ID(),
			PolicyData: pulumi.String(admin.PolicyData),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
    {
        Bindings = new[]
        {
            new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
            {
                Role = "roles/editor",
                Members = new[]
                {
                    "user:jane@example.com",
                },
            },
        },
    });

    var keyRing = new Gcp.Kms.KeyRingIAMPolicy("key_ring", new()
    {
        KeyRingId = keyring.Id,
        PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
    });

});
Copy
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.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.kms.KeyRingIAMPolicy;
import com.pulumi.gcp.kms.KeyRingIAMPolicyArgs;
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());

        final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
            .bindings(GetIAMPolicyBindingArgs.builder()
                .role("roles/editor")
                .members("user:jane@example.com")
                .build())
            .build());

        var keyRing = new KeyRingIAMPolicy("keyRing", KeyRingIAMPolicyArgs.builder()
            .keyRingId(keyring.id())
            .policyData(admin.policyData())
            .build());

    }
}
Copy
resources:
  keyring:
    type: gcp:kms:KeyRing
    properties:
      name: keyring-example
      location: global
  keyRing:
    type: gcp:kms:KeyRingIAMPolicy
    name: key_ring
    properties:
      keyRingId: ${keyring.id}
      policyData: ${admin.policyData}
variables:
  admin:
    fn::invoke:
      function: gcp:organizations:getIAMPolicy
      arguments:
        bindings:
          - role: roles/editor
            members:
              - user:jane@example.com
Copy

With IAM Conditions:

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 admin = gcp.organizations.getIAMPolicy({
    bindings: [{
        role: "roles/editor",
        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\")",
        },
    }],
});
const keyRing = new gcp.kms.KeyRingIAMPolicy("key_ring", {
    keyRingId: keyring.id,
    policyData: admin.then(admin => admin.policyData),
});
Copy
import pulumi
import pulumi_gcp as gcp

keyring = gcp.kms.KeyRing("keyring",
    name="keyring-example",
    location="global")
admin = gcp.organizations.get_iam_policy(bindings=[{
    "role": "roles/editor",
    "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\")",
    },
}])
key_ring = gcp.kms.KeyRingIAMPolicy("key_ring",
    key_ring_id=keyring.id,
    policy_data=admin.policy_data)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi-gcp/sdk/v8/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
		}
		admin, err := organizations.LookupIAMPolicy(ctx, &organizations.LookupIAMPolicyArgs{
			Bindings: []organizations.GetIAMPolicyBinding{
				{
					Role: "roles/editor",
					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
		}
		_, err = kms.NewKeyRingIAMPolicy(ctx, "key_ring", &kms.KeyRingIAMPolicyArgs{
			KeyRingId:  keyring.ID(),
			PolicyData: pulumi.String(admin.PolicyData),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 admin = Gcp.Organizations.GetIAMPolicy.Invoke(new()
    {
        Bindings = new[]
        {
            new Gcp.Organizations.Inputs.GetIAMPolicyBindingInputArgs
            {
                Role = "roles/editor",
                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\")",
                },
            },
        },
    });

    var keyRing = new Gcp.Kms.KeyRingIAMPolicy("key_ring", new()
    {
        KeyRingId = keyring.Id,
        PolicyData = admin.Apply(getIAMPolicyResult => getIAMPolicyResult.PolicyData),
    });

});
Copy
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.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetIAMPolicyArgs;
import com.pulumi.gcp.kms.KeyRingIAMPolicy;
import com.pulumi.gcp.kms.KeyRingIAMPolicyArgs;
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());

        final var admin = OrganizationsFunctions.getIAMPolicy(GetIAMPolicyArgs.builder()
            .bindings(GetIAMPolicyBindingArgs.builder()
                .role("roles/editor")
                .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());

        var keyRing = new KeyRingIAMPolicy("keyRing", KeyRingIAMPolicyArgs.builder()
            .keyRingId(keyring.id())
            .policyData(admin.policyData())
            .build());

    }
}
Copy
resources:
  keyring:
    type: gcp:kms:KeyRing
    properties:
      name: keyring-example
      location: global
  keyRing:
    type: gcp:kms:KeyRingIAMPolicy
    name: key_ring
    properties:
      keyRingId: ${keyring.id}
      policyData: ${admin.policyData}
variables:
  admin:
    fn::invoke:
      function: gcp:organizations:getIAMPolicy
      arguments:
        bindings:
          - role: roles/editor
            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")
Copy

gcp.kms.KeyRingIAMBinding

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMBinding("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    members: ["user:jane@example.com"],
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMBinding("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    members=["user:jane@example.com"])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMBinding(ctx, "key_ring", &kms.KeyRingIAMBindingArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMBinding("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Members = new[]
        {
            "user:jane@example.com",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMBinding;
import com.pulumi.gcp.kms.KeyRingIAMBindingArgs;
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 KeyRingIAMBinding("keyRing", KeyRingIAMBindingArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .members("user:jane@example.com")
            .build());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMBinding
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      members:
        - user:jane@example.com
Copy

With IAM Conditions:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMBinding("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    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\")",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMBinding("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    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\")",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMBinding(ctx, "key_ring", &kms.KeyRingIAMBindingArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
			Condition: &kms.KeyRingIAMBindingConditionArgs{
				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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMBinding("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Members = new[]
        {
            "user:jane@example.com",
        },
        Condition = new Gcp.Kms.Inputs.KeyRingIAMBindingConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMBinding;
import com.pulumi.gcp.kms.KeyRingIAMBindingArgs;
import com.pulumi.gcp.kms.inputs.KeyRingIAMBindingConditionArgs;
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 KeyRingIAMBinding("keyRing", KeyRingIAMBindingArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .members("user:jane@example.com")
            .condition(KeyRingIAMBindingConditionArgs.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());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMBinding
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      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")
Copy

gcp.kms.KeyRingIAMMember

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMMember("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    member: "user:jane@example.com",
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMMember("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    member="user:jane@example.com")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMMember(ctx, "key_ring", &kms.KeyRingIAMMemberArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Member:    pulumi.String("user:jane@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMMember("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Member = "user:jane@example.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMMember;
import com.pulumi.gcp.kms.KeyRingIAMMemberArgs;
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 KeyRingIAMMember("keyRing", KeyRingIAMMemberArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .member("user:jane@example.com")
            .build());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMMember
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      member: user:jane@example.com
Copy

With IAM Conditions:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMMember("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    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\")",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMMember("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    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\")",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMMember(ctx, "key_ring", &kms.KeyRingIAMMemberArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Member:    pulumi.String("user:jane@example.com"),
			Condition: &kms.KeyRingIAMMemberConditionArgs{
				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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMMember("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Member = "user:jane@example.com",
        Condition = new Gcp.Kms.Inputs.KeyRingIAMMemberConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMMember;
import com.pulumi.gcp.kms.KeyRingIAMMemberArgs;
import com.pulumi.gcp.kms.inputs.KeyRingIAMMemberConditionArgs;
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 KeyRingIAMMember("keyRing", KeyRingIAMMemberArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .member("user:jane@example.com")
            .condition(KeyRingIAMMemberConditionArgs.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());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMMember
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      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")
Copy

gcp.kms.KeyRingIAMBinding

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMBinding("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    members: ["user:jane@example.com"],
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMBinding("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    members=["user:jane@example.com"])
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMBinding(ctx, "key_ring", &kms.KeyRingIAMBindingArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMBinding("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Members = new[]
        {
            "user:jane@example.com",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMBinding;
import com.pulumi.gcp.kms.KeyRingIAMBindingArgs;
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 KeyRingIAMBinding("keyRing", KeyRingIAMBindingArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .members("user:jane@example.com")
            .build());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMBinding
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      members:
        - user:jane@example.com
Copy

With IAM Conditions:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMBinding("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    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\")",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMBinding("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    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\")",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMBinding(ctx, "key_ring", &kms.KeyRingIAMBindingArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Members: pulumi.StringArray{
				pulumi.String("user:jane@example.com"),
			},
			Condition: &kms.KeyRingIAMBindingConditionArgs{
				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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMBinding("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Members = new[]
        {
            "user:jane@example.com",
        },
        Condition = new Gcp.Kms.Inputs.KeyRingIAMBindingConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMBinding;
import com.pulumi.gcp.kms.KeyRingIAMBindingArgs;
import com.pulumi.gcp.kms.inputs.KeyRingIAMBindingConditionArgs;
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 KeyRingIAMBinding("keyRing", KeyRingIAMBindingArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .members("user:jane@example.com")
            .condition(KeyRingIAMBindingConditionArgs.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());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMBinding
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      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")
Copy

gcp.kms.KeyRingIAMMember

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMMember("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    member: "user:jane@example.com",
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMMember("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    member="user:jane@example.com")
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMMember(ctx, "key_ring", &kms.KeyRingIAMMemberArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Member:    pulumi.String("user:jane@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMMember("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Member = "user:jane@example.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMMember;
import com.pulumi.gcp.kms.KeyRingIAMMemberArgs;
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 KeyRingIAMMember("keyRing", KeyRingIAMMemberArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .member("user:jane@example.com")
            .build());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMMember
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      member: user:jane@example.com
Copy

With IAM Conditions:

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const keyRing = new gcp.kms.KeyRingIAMMember("key_ring", {
    keyRingId: "your-key-ring-id",
    role: "roles/cloudkms.admin",
    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\")",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

key_ring = gcp.kms.KeyRingIAMMember("key_ring",
    key_ring_id="your-key-ring-id",
    role="roles/cloudkms.admin",
    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\")",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewKeyRingIAMMember(ctx, "key_ring", &kms.KeyRingIAMMemberArgs{
			KeyRingId: pulumi.String("your-key-ring-id"),
			Role:      pulumi.String("roles/cloudkms.admin"),
			Member:    pulumi.String("user:jane@example.com"),
			Condition: &kms.KeyRingIAMMemberConditionArgs{
				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
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var keyRing = new Gcp.Kms.KeyRingIAMMember("key_ring", new()
    {
        KeyRingId = "your-key-ring-id",
        Role = "roles/cloudkms.admin",
        Member = "user:jane@example.com",
        Condition = new Gcp.Kms.Inputs.KeyRingIAMMemberConditionArgs
        {
            Title = "expires_after_2019_12_31",
            Description = "Expiring at midnight of 2019-12-31",
            Expression = "request.time < timestamp(\"2020-01-01T00:00:00Z\")",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRingIAMMember;
import com.pulumi.gcp.kms.KeyRingIAMMemberArgs;
import com.pulumi.gcp.kms.inputs.KeyRingIAMMemberConditionArgs;
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 KeyRingIAMMember("keyRing", KeyRingIAMMemberArgs.builder()
            .keyRingId("your-key-ring-id")
            .role("roles/cloudkms.admin")
            .member("user:jane@example.com")
            .condition(KeyRingIAMMemberConditionArgs.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());

    }
}
Copy
resources:
  keyRing:
    type: gcp:kms:KeyRingIAMMember
    name: key_ring
    properties:
      keyRingId: your-key-ring-id
      role: roles/cloudkms.admin
      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")
Copy

Create KeyRingIAMBinding Resource

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

Constructor syntax

new KeyRingIAMBinding(name: string, args: KeyRingIAMBindingArgs, opts?: CustomResourceOptions);
@overload
def KeyRingIAMBinding(resource_name: str,
                      args: KeyRingIAMBindingArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def KeyRingIAMBinding(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      key_ring_id: Optional[str] = None,
                      members: Optional[Sequence[str]] = None,
                      role: Optional[str] = None,
                      condition: Optional[KeyRingIAMBindingConditionArgs] = None)
func NewKeyRingIAMBinding(ctx *Context, name string, args KeyRingIAMBindingArgs, opts ...ResourceOption) (*KeyRingIAMBinding, error)
public KeyRingIAMBinding(string name, KeyRingIAMBindingArgs args, CustomResourceOptions? opts = null)
public KeyRingIAMBinding(String name, KeyRingIAMBindingArgs args)
public KeyRingIAMBinding(String name, KeyRingIAMBindingArgs args, CustomResourceOptions options)
type: gcp:kms:KeyRingIAMBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

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

var keyRingIAMBindingResource = new Gcp.Kms.KeyRingIAMBinding("keyRingIAMBindingResource", new()
{
    KeyRingId = "string",
    Members = new[]
    {
        "string",
    },
    Role = "string",
    Condition = new Gcp.Kms.Inputs.KeyRingIAMBindingConditionArgs
    {
        Expression = "string",
        Title = "string",
        Description = "string",
    },
});
Copy
example, err := kms.NewKeyRingIAMBinding(ctx, "keyRingIAMBindingResource", &kms.KeyRingIAMBindingArgs{
	KeyRingId: pulumi.String("string"),
	Members: pulumi.StringArray{
		pulumi.String("string"),
	},
	Role: pulumi.String("string"),
	Condition: &kms.KeyRingIAMBindingConditionArgs{
		Expression:  pulumi.String("string"),
		Title:       pulumi.String("string"),
		Description: pulumi.String("string"),
	},
})
Copy
var keyRingIAMBindingResource = new KeyRingIAMBinding("keyRingIAMBindingResource", KeyRingIAMBindingArgs.builder()
    .keyRingId("string")
    .members("string")
    .role("string")
    .condition(KeyRingIAMBindingConditionArgs.builder()
        .expression("string")
        .title("string")
        .description("string")
        .build())
    .build());
Copy
key_ring_iam_binding_resource = gcp.kms.KeyRingIAMBinding("keyRingIAMBindingResource",
    key_ring_id="string",
    members=["string"],
    role="string",
    condition={
        "expression": "string",
        "title": "string",
        "description": "string",
    })
Copy
const keyRingIAMBindingResource = new gcp.kms.KeyRingIAMBinding("keyRingIAMBindingResource", {
    keyRingId: "string",
    members: ["string"],
    role: "string",
    condition: {
        expression: "string",
        title: "string",
        description: "string",
    },
});
Copy
type: gcp:kms:KeyRingIAMBinding
properties:
    condition:
        description: string
        expression: string
        title: string
    keyRingId: string
    members:
        - string
    role: string
Copy

KeyRingIAMBinding Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The KeyRingIAMBinding resource accepts the following input properties:

KeyRingId
This property is required.
Changes to this property will trigger replacement.
string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
Members This property is required. List<string>
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, alice@gmail.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.
Role
This property is required.
Changes to this property will trigger replacement.
string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
Condition Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
KeyRingId
This property is required.
Changes to this property will trigger replacement.
string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
Members This property is required. []string
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, alice@gmail.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.
Role
This property is required.
Changes to this property will trigger replacement.
string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
Condition Changes to this property will trigger replacement. KeyRingIAMBindingConditionArgs
An IAM Condition for a given binding. Structure is documented below.
keyRingId
This property is required.
Changes to this property will trigger replacement.
String
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members This property is required. List<String>
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, alice@gmail.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.
role
This property is required.
Changes to this property will trigger replacement.
String
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
keyRingId
This property is required.
Changes to this property will trigger replacement.
string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members This property is required. string[]
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, alice@gmail.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.
role
This property is required.
Changes to this property will trigger replacement.
string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
key_ring_id
This property is required.
Changes to this property will trigger replacement.
str
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members This property is required. Sequence[str]
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, alice@gmail.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.
role
This property is required.
Changes to this property will trigger replacement.
str
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingConditionArgs
An IAM Condition for a given binding. Structure is documented below.
keyRingId
This property is required.
Changes to this property will trigger replacement.
String
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members This property is required. List<String>
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, alice@gmail.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.
role
This property is required.
Changes to this property will trigger replacement.
String
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. 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 KeyRingIAMBinding resource produces the following output properties:

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

Look up Existing KeyRingIAMBinding Resource

Get an existing KeyRingIAMBinding 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?: KeyRingIAMBindingState, opts?: CustomResourceOptions): KeyRingIAMBinding
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        condition: Optional[KeyRingIAMBindingConditionArgs] = None,
        etag: Optional[str] = None,
        key_ring_id: Optional[str] = None,
        members: Optional[Sequence[str]] = None,
        role: Optional[str] = None) -> KeyRingIAMBinding
func GetKeyRingIAMBinding(ctx *Context, name string, id IDInput, state *KeyRingIAMBindingState, opts ...ResourceOption) (*KeyRingIAMBinding, error)
public static KeyRingIAMBinding Get(string name, Input<string> id, KeyRingIAMBindingState? state, CustomResourceOptions? opts = null)
public static KeyRingIAMBinding get(String name, Output<String> id, KeyRingIAMBindingState state, CustomResourceOptions options)
resources:  _:    type: gcp:kms:KeyRingIAMBinding    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
Etag string
(Computed) The etag of the key ring's IAM policy.
KeyRingId Changes to this property will trigger replacement. string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
Members List<string>
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, alice@gmail.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.
Role Changes to this property will trigger replacement. string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
Condition Changes to this property will trigger replacement. KeyRingIAMBindingConditionArgs
An IAM Condition for a given binding. Structure is documented below.
Etag string
(Computed) The etag of the key ring's IAM policy.
KeyRingId Changes to this property will trigger replacement. string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
Members []string
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, alice@gmail.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.
Role Changes to this property will trigger replacement. string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
etag String
(Computed) The etag of the key ring's IAM policy.
keyRingId Changes to this property will trigger replacement. String
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members List<String>
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, alice@gmail.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.
role Changes to this property will trigger replacement. String
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingCondition
An IAM Condition for a given binding. Structure is documented below.
etag string
(Computed) The etag of the key ring's IAM policy.
keyRingId Changes to this property will trigger replacement. string
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members string[]
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, alice@gmail.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.
role Changes to this property will trigger replacement. string
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. KeyRingIAMBindingConditionArgs
An IAM Condition for a given binding. Structure is documented below.
etag str
(Computed) The etag of the key ring's IAM policy.
key_ring_id Changes to this property will trigger replacement. str
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members Sequence[str]
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, alice@gmail.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.
role Changes to this property will trigger replacement. str
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.
condition Changes to this property will trigger replacement. Property Map
An IAM Condition for a given binding. Structure is documented below.
etag String
(Computed) The etag of the key ring's IAM policy.
keyRingId Changes to this property will trigger replacement. String
The key ring ID, in the form {project_id}/{location_name}/{key_ring_name} or {location_name}/{key_ring_name}. In the second form, the provider's project setting will be used as a fallback.
members List<String>
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, alice@gmail.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.
role Changes to this property will trigger replacement. String
The role that should be applied. Only one gcp.kms.KeyRingIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

Supporting Types

KeyRingIAMBindingCondition
, KeyRingIAMBindingConditionArgs

Expression
This property is required.
Changes to this property will trigger replacement.
string
Textual representation of an expression in Common Expression Language syntax.
Title
This property is required.
Changes to this property will trigger replacement.
string
A title for the expression, i.e. a short string describing its purpose.
Description Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
Textual representation of an expression in Common Expression Language syntax.
Title
This property is required.
Changes to this property will trigger replacement.
string
A title for the expression, i.e. a short string describing its purpose.
Description Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
Textual representation of an expression in Common Expression Language syntax.
title
This property is required.
Changes to this property will trigger replacement.
String
A title for the expression, i.e. a short string describing its purpose.
description Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
string
Textual representation of an expression in Common Expression Language syntax.
title
This property is required.
Changes to this property will trigger replacement.
string
A title for the expression, i.e. a short string describing its purpose.
description Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
str
Textual representation of an expression in Common Expression Language syntax.
title
This property is required.
Changes to this property will trigger replacement.
str
A title for the expression, i.e. a short string describing its purpose.
description Changes to this property will trigger replacement. 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
This property is required.
Changes to this property will trigger replacement.
String
Textual representation of an expression in Common Expression Language syntax.
title
This property is required.
Changes to this property will trigger replacement.
String
A title for the expression, i.e. a short string describing its purpose.
description Changes to this property will trigger replacement. 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 Cloud KMS key ring only. For example:

  • {{project_id}}/{{location}}/{{key_ring_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}}”

to = google_kms_key_ring_iam_policy.default

}

The pulumi import command can also be used:

$ pulumi import gcp:kms/keyRingIAMBinding:KeyRingIAMBinding default {{project_id}}/{{location}}/{{key_ring_name}}
Copy

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.