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.ServiceIamPolicycannot be used in conjunction withgcp.endpoints.ServiceIamBindingandgcp.endpoints.ServiceIamMemberor they will fight over what your policy should be.
Note:
gcp.endpoints.ServiceIamBindingresources can be used in conjunction withgcp.endpoints.ServiceIamMemberresources 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",
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Endpoints
Assembly: Pulumi.Gcp.dll
Syntax
public class ServiceIamMember : CustomResource
Constructors
View SourceServiceIamMember(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 SourceCondition
Declaration
public Output<ServiceIamMemberCondition> Condition { get; }
Property Value
| Type | Description |
|---|---|
| Output<ServiceIamMemberCondition> |
Etag
(Computed) The etag of the IAM policy.
Declaration
public Output<string> Etag { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Member
Declaration
public Output<string> Member { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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 SourceGet(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 |