Show / Hide Table of Contents

Class NamespaceIamPolicy

Three different resources help you manage your IAM policy for Service Directory Namespace. Each of these resources serves a different use case:

  • gcp.servicedirectory.NamespaceIamPolicy: Authoritative. Sets the IAM policy for the namespace and replaces any existing policy already attached.
  • gcp.servicedirectory.NamespaceIamBinding: 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 namespace are preserved.
  • gcp.servicedirectory.NamespaceIamMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the namespace are preserved.

Note: gcp.servicedirectory.NamespaceIamPolicy cannot be used in conjunction with gcp.servicedirectory.NamespaceIamBinding and gcp.servicedirectory.NamespaceIamMember or they will fight over what your policy should be.

Note: gcp.servicedirectory.NamespaceIamBinding resources can be used in conjunction with gcp.servicedirectory.NamespaceIamMember resources only if they do not grant privilege to the same role.

google_service_directory_namespace_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/viewer" },
                { "members", 
                {
                    "user:jane@example.com",
                } },
            },
        },
    }));
    var policy = new Gcp.ServiceDirectory.NamespaceIamPolicy("policy", new Gcp.ServiceDirectory.NamespaceIamPolicyArgs
    {
        PolicyData = admin.Apply(admin => admin.PolicyData),
    });
}

}

google_service_directory_namespace_iam_binding

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var binding = new Gcp.ServiceDirectory.NamespaceIamBinding("binding", new Gcp.ServiceDirectory.NamespaceIamBindingArgs
    {
        Role = "roles/viewer",
        Members = 
        {
            "user:jane@example.com",
        },
    });
}

}

google_service_directory_namespace_iam_member

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var member = new Gcp.ServiceDirectory.NamespaceIamMember("member", new Gcp.ServiceDirectory.NamespaceIamMemberArgs
    {
        Role = "roles/viewer",
        Member = "user:jane@example.com",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NamespaceIamPolicy
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Gcp.ServiceDirectory
Assembly: Pulumi.Gcp.dll
Syntax
public class NamespaceIamPolicy : CustomResource

Constructors

View Source

NamespaceIamPolicy(String, NamespaceIamPolicyArgs, CustomResourceOptions)

Create a NamespaceIamPolicy resource with the given unique name, arguments, and options.

Declaration
public NamespaceIamPolicy(string name, NamespaceIamPolicyArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

NamespaceIamPolicyArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Etag

(Computed) The etag of the IAM policy.

Declaration
public Output<string> Etag { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

Used to find the parent resource to bind the IAM policy to

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

PolicyData

The policy data generated by a gcp.organizations.getIAMPolicy data source.

Declaration
public Output<string> PolicyData { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, NamespaceIamPolicyState, CustomResourceOptions)

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

Declaration
public static NamespaceIamPolicy Get(string name, Input<string> id, NamespaceIamPolicyState 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.

NamespaceIamPolicyState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
NamespaceIamPolicy
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.