Class InstanceIAMMember
Three different resources help you manage your IAM policy for a Spanner instance. Each of these resources serves a different use case:
gcp.spanner.InstanceIAMPolicy: Authoritative. Sets the IAM policy for the instance and replaces any existing policy already attached.
Warning: It's entirely possibly to lock yourself out of your instance using
gcp.spanner.InstanceIAMPolicy. Any permissions granted by default will be removed unless you include them in your config.
gcp.spanner.InstanceIAMBinding: 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 instance are preserved.gcp.spanner.InstanceIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the instance are preserved.
Note:
gcp.spanner.InstanceIAMPolicycannot be used in conjunction withgcp.spanner.InstanceIAMBindingandgcp.spanner.InstanceIAMMemberor they will fight over what your policy should be.
Note:
gcp.spanner.InstanceIAMBindingresources can be used in conjunction withgcp.spanner.InstanceIAMMemberresources only if they do not grant privilege to the same role.
google_spanner_instance_iam_policy
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var admin = Output.Create(Gcp.Organizations.GetIAMPolicy.InvokeAsync(new Gcp.Organizations.GetIAMPolicyArgs
{
Binding =
{
{
{ "role", "roles/editor" },
{ "members",
{
"user:jane@example.com",
} },
},
},
}));
var instance = new Gcp.Spanner.InstanceIAMPolicy("instance", new Gcp.Spanner.InstanceIAMPolicyArgs
{
Instance = "your-instance-name",
PolicyData = admin.Apply(admin => admin.PolicyData),
});
}
}
google_spanner_instance_iam_binding
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var instance = new Gcp.Spanner.InstanceIAMBinding("instance", new Gcp.Spanner.InstanceIAMBindingArgs
{
Instance = "your-instance-name",
Members =
{
"user:jane@example.com",
},
Role = "roles/compute.networkUser",
});
}
}
google_spanner_instance_iam_member
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var instance = new Gcp.Spanner.InstanceIAMMember("instance", new Gcp.Spanner.InstanceIAMMemberArgs
{
Instance = "your-instance-name",
Member = "user:jane@example.com",
Role = "roles/compute.networkUser",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Spanner
Assembly: Pulumi.Gcp.dll
Syntax
public class InstanceIAMMember : CustomResource
Constructors
View SourceInstanceIAMMember(String, InstanceIAMMemberArgs, CustomResourceOptions)
Create a InstanceIAMMember resource with the given unique name, arguments, and options.
Declaration
public InstanceIAMMember(string name, InstanceIAMMemberArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| InstanceIAMMemberArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCondition
Declaration
public Output<InstanceIAMMemberCondition> Condition { get; }
Property Value
| Type | Description |
|---|---|
| Output<InstanceIAMMemberCondition> |
Etag
(Computed) The etag of the instance's IAM policy.
Declaration
public Output<string> Etag { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Instance
The name of the instance.
Declaration
public Output<string> Instance { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Member
Declaration
public Output<string> Member { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Role
The role that should be applied. Only one
gcp.spanner.InstanceIAMBinding can be used per role. Note that custom roles must be of the format
[projects|organizations]/{parent-name}/roles/{role-name}.
Declaration
public Output<string> Role { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, InstanceIAMMemberState, CustomResourceOptions)
Get an existing InstanceIAMMember resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static InstanceIAMMember Get(string name, Input<string> id, InstanceIAMMemberState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| InstanceIAMMemberState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| InstanceIAMMember |