Show / Hide Table of Contents

Class ServiceIamMember

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

  • gcp.endpoints.ServiceIamPolicy: Authoritative. Sets the IAM policy for the service and replaces any existing policy already attached.
  • gcp.endpoints.ServiceIamBinding: 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 service are preserved.
  • gcp.endpoints.ServiceIamMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the service are preserved.

Note: gcp.endpoints.ServiceIamPolicy cannot be used in conjunction with gcp.endpoints.ServiceIamBinding and gcp.endpoints.ServiceIamMember or they will fight over what your policy should be.

Note: gcp.endpoints.ServiceIamBinding resources can be used in conjunction with gcp.endpoints.ServiceIamMember resources only if they do not grant privilege to the same role.

google_endpoints_service_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.Endpoints.ServiceIamPolicy("policy", new Gcp.Endpoints.ServiceIamPolicyArgs
    {
        ServiceName = google_endpoints_service.Endpoints_service.Service_name,
        PolicyData = admin.Apply(admin => admin.PolicyData),
    });
}

}

google_endpoints_service_iam_binding

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var binding = new Gcp.Endpoints.ServiceIamBinding("binding", new Gcp.Endpoints.ServiceIamBindingArgs
    {
        ServiceName = google_endpoints_service.Endpoints_service.Service_name,
        Role = "roles/viewer",
        Members = 
        {
            "user:jane@example.com",
        },
    });
}

}

google_endpoints_service_iam_member

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
public MyStack()
{
    var member = new Gcp.Endpoints.ServiceIamMember("member", new Gcp.Endpoints.ServiceIamMemberArgs
    {
        ServiceName = google_endpoints_service.Endpoints_service.Service_name,
        Role = "roles/viewer",
        Member = "user:jane@example.com",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
ServiceIamMember
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.Endpoints
Assembly: Pulumi.Gcp.dll
Syntax
public class ServiceIamMember : CustomResource

Constructors

View Source

ServiceIamMember(String, ServiceIamMemberArgs, CustomResourceOptions)

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

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

The unique name of the resource

ServiceIamMemberArgs 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

Condition

Declaration
public Output<ServiceIamMemberCondition> Condition { get; }
Property Value
Type Description
Output<ServiceIamMemberCondition>
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

Member

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

Role

The role that should be applied. Only one gcp.endpoints.ServiceIamBinding 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>
View Source

ServiceName

The name of the service. Used to find the parent resource to bind the IAM policy to

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

Methods

View Source

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

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

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

ServiceIamMemberState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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