Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

ResourcemanagerCloudIamMember

Allows creation and management of a single member for a single binding within the IAM policy for an existing Yandex Resource Manager cloud.

Note: Roles controlled by yandex.ResourcemanagerCloudIamBinding should not be assigned using yandex.ResourcemanagerCloudIamMember.

Note: When you delete yandex.ResourcemanagerCloudIamBinding resource, the roles can be deleted from other users within the cloud as well. Be careful!

Example Usage

using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var department1 = Output.Create(Yandex.GetResourcemanagerCloud.InvokeAsync(new Yandex.GetResourcemanagerCloudArgs
        {
            Name = "Department 1",
        }));
        var admin = new Yandex.ResourcemanagerCloudIamMember("admin", new Yandex.ResourcemanagerCloudIamMemberArgs
        {
            CloudId = department1.Apply(department1 => department1.Id),
            Member = "userAccount:user_id",
            Role = "editor",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "Department 1"
		department1, err := yandex.GetResourcemanagerCloud(ctx, &GetResourcemanagerCloudArgs{
			Name: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		_, err = yandex.NewResourcemanagerCloudIamMember(ctx, "admin", &yandex.ResourcemanagerCloudIamMemberArgs{
			CloudId: pulumi.String(department1.Id),
			Member:  pulumi.String("userAccount:user_id"),
			Role:    pulumi.String("editor"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_yandex as yandex

department1 = yandex.get_resourcemanager_cloud(name="Department 1")
admin = yandex.ResourcemanagerCloudIamMember("admin",
    cloud_id=department1.id,
    member="userAccount:user_id",
    role="editor")
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";

const department1 = pulumi.output(yandex.getResourcemanagerCloud({
    name: "Department 1",
}));
const admin = new yandex.ResourcemanagerCloudIamMember("admin", {
    cloudId: department1.id,
    member: "userAccount:user_id",
    role: "editor",
});

Create a ResourcemanagerCloudIamMember Resource

new ResourcemanagerCloudIamMember(name: string, args: ResourcemanagerCloudIamMemberArgs, opts?: CustomResourceOptions);
@overload
def ResourcemanagerCloudIamMember(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  cloud_id: Optional[str] = None,
                                  member: Optional[str] = None,
                                  role: Optional[str] = None,
                                  sleep_after: Optional[int] = None)
@overload
def ResourcemanagerCloudIamMember(resource_name: str,
                                  args: ResourcemanagerCloudIamMemberArgs,
                                  opts: Optional[ResourceOptions] = None)
func NewResourcemanagerCloudIamMember(ctx *Context, name string, args ResourcemanagerCloudIamMemberArgs, opts ...ResourceOption) (*ResourcemanagerCloudIamMember, error)
public ResourcemanagerCloudIamMember(string name, ResourcemanagerCloudIamMemberArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ResourcemanagerCloudIamMemberArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ResourcemanagerCloudIamMemberArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ResourcemanagerCloudIamMemberArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ResourcemanagerCloudIamMemberArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ResourcemanagerCloudIamMember Resource Properties

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

Inputs

The ResourcemanagerCloudIamMember resource accepts the following input properties:

CloudId string
ID of the cloud to attach a policy to.
Member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
Role string
The role that should be assigned.
SleepAfter int
CloudId string
ID of the cloud to attach a policy to.
Member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
Role string
The role that should be assigned.
SleepAfter int
cloudId string
ID of the cloud to attach a policy to.
member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
role string
The role that should be assigned.
sleepAfter number
cloud_id str
ID of the cloud to attach a policy to.
member str

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
role str
The role that should be assigned.
sleep_after int

Outputs

All input properties are implicitly available as output properties. Additionally, the ResourcemanagerCloudIamMember resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ResourcemanagerCloudIamMember Resource

Get an existing ResourcemanagerCloudIamMember 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?: ResourcemanagerCloudIamMemberState, opts?: CustomResourceOptions): ResourcemanagerCloudIamMember
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cloud_id: Optional[str] = None,
        member: Optional[str] = None,
        role: Optional[str] = None,
        sleep_after: Optional[int] = None) -> ResourcemanagerCloudIamMember
func GetResourcemanagerCloudIamMember(ctx *Context, name string, id IDInput, state *ResourcemanagerCloudIamMemberState, opts ...ResourceOption) (*ResourcemanagerCloudIamMember, error)
public static ResourcemanagerCloudIamMember Get(string name, Input<string> id, ResourcemanagerCloudIamMemberState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

CloudId string
ID of the cloud to attach a policy to.
Member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
Role string
The role that should be assigned.
SleepAfter int
CloudId string
ID of the cloud to attach a policy to.
Member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
Role string
The role that should be assigned.
SleepAfter int
cloudId string
ID of the cloud to attach a policy to.
member string

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
role string
The role that should be assigned.
sleepAfter number
cloud_id str
ID of the cloud to attach a policy to.
member str

The identity that will be granted the privilege that is specified in the role field. This field can have one of the following values:

  • userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
  • serviceAccount:{service_account_id}: A unique service account ID.
role str
The role that should be assigned.
sleep_after int

Import

IAM member imports use space-delimited identifiers; the resource in question, the role, and the account. This member resource can be imported using the cloud id, role, and account, e.g.

 $ pulumi import yandex:index/resourcemanagerCloudIamMember:ResourcemanagerCloudIamMember my_project "cloud_id viewer foo@example.com"

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.