1. Packages
  2. Yandex
  3. API Docs
  4. ResourcemanagerFolderIamBinding
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.ResourcemanagerFolderIamBinding

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

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

    Note: This resource must not be used in conjunction with yandex.ResourcemanagerFolderIamPolicy or they will conflict over what your policy should be.

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

    Example Usage

    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var project1 = Output.Create(Yandex.GetResourcemanagerFolder.InvokeAsync(new Yandex.GetResourcemanagerFolderArgs
            {
                FolderId = "some_folder_id",
            }));
            var admin = new Yandex.ResourcemanagerFolderIamBinding("admin", new Yandex.ResourcemanagerFolderIamBindingArgs
            {
                FolderId = project1.Apply(project1 => project1.Id),
                Members = 
                {
                    "userAccount:some_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 := "some_folder_id"
    		project1, err := yandex.LookupResourcemanagerFolder(ctx, &GetResourcemanagerFolderArgs{
    			FolderId: &opt0,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = yandex.NewResourcemanagerFolderIamBinding(ctx, "admin", &yandex.ResourcemanagerFolderIamBindingArgs{
    			FolderId: pulumi.String(project1.Id),
    			Members: pulumi.StringArray{
    				pulumi.String("userAccount:some_user_id"),
    			},
    			Role: pulumi.String("editor"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_yandex as yandex
    
    project1 = yandex.get_resourcemanager_folder(folder_id="some_folder_id")
    admin = yandex.ResourcemanagerFolderIamBinding("admin",
        folder_id=project1.id,
        members=["userAccount:some_user_id"],
        role="editor")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const project1 = pulumi.output(yandex.getResourcemanagerFolder({
        folderId: "some_folder_id",
    }));
    const admin = new yandex.ResourcemanagerFolderIamBinding("admin", {
        folderId: project1.id,
        members: ["userAccount:some_user_id"],
        role: "editor",
    });
    

    Coming soon!

    Create ResourcemanagerFolderIamBinding Resource

    new ResourcemanagerFolderIamBinding(name: string, args: ResourcemanagerFolderIamBindingArgs, opts?: CustomResourceOptions);
    @overload
    def ResourcemanagerFolderIamBinding(resource_name: str,
                                        opts: Optional[ResourceOptions] = None,
                                        folder_id: Optional[str] = None,
                                        members: Optional[Sequence[str]] = None,
                                        role: Optional[str] = None,
                                        sleep_after: Optional[int] = None)
    @overload
    def ResourcemanagerFolderIamBinding(resource_name: str,
                                        args: ResourcemanagerFolderIamBindingArgs,
                                        opts: Optional[ResourceOptions] = None)
    func NewResourcemanagerFolderIamBinding(ctx *Context, name string, args ResourcemanagerFolderIamBindingArgs, opts ...ResourceOption) (*ResourcemanagerFolderIamBinding, error)
    public ResourcemanagerFolderIamBinding(string name, ResourcemanagerFolderIamBindingArgs args, CustomResourceOptions? opts = null)
    public ResourcemanagerFolderIamBinding(String name, ResourcemanagerFolderIamBindingArgs args)
    public ResourcemanagerFolderIamBinding(String name, ResourcemanagerFolderIamBindingArgs args, CustomResourceOptions options)
    
    type: yandex:ResourcemanagerFolderIamBinding
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ResourcemanagerFolderIamBindingArgs
    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 ResourcemanagerFolderIamBindingArgs
    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 ResourcemanagerFolderIamBindingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourcemanagerFolderIamBindingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourcemanagerFolderIamBindingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ResourcemanagerFolderIamBinding 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 ResourcemanagerFolderIamBinding resource accepts the following input properties:

    FolderId string
    ID of the folder to attach a policy to.
    Members List<string>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    Role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    SleepAfter int
    FolderId string
    ID of the folder to attach a policy to.
    Members []string
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    Role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    SleepAfter int
    folderId String
    ID of the folder to attach a policy to.
    members List<String>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role String
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter Integer
    folderId string
    ID of the folder to attach a policy to.
    members string[]
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter number
    folder_id str
    ID of the folder to attach a policy to.
    members Sequence[str]
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role str
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleep_after int
    folderId String
    ID of the folder to attach a policy to.
    members List<String>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role String
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter Number

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourcemanagerFolderIamBinding 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ResourcemanagerFolderIamBinding Resource

    Get an existing ResourcemanagerFolderIamBinding 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?: ResourcemanagerFolderIamBindingState, opts?: CustomResourceOptions): ResourcemanagerFolderIamBinding
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            folder_id: Optional[str] = None,
            members: Optional[Sequence[str]] = None,
            role: Optional[str] = None,
            sleep_after: Optional[int] = None) -> ResourcemanagerFolderIamBinding
    func GetResourcemanagerFolderIamBinding(ctx *Context, name string, id IDInput, state *ResourcemanagerFolderIamBindingState, opts ...ResourceOption) (*ResourcemanagerFolderIamBinding, error)
    public static ResourcemanagerFolderIamBinding Get(string name, Input<string> id, ResourcemanagerFolderIamBindingState? state, CustomResourceOptions? opts = null)
    public static ResourcemanagerFolderIamBinding get(String name, Output<String> id, ResourcemanagerFolderIamBindingState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    FolderId string
    ID of the folder to attach a policy to.
    Members List<string>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    Role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    SleepAfter int
    FolderId string
    ID of the folder to attach a policy to.
    Members []string
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    Role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    SleepAfter int
    folderId String
    ID of the folder to attach a policy to.
    members List<String>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role String
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter Integer
    folderId string
    ID of the folder to attach a policy to.
    members string[]
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role string
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter number
    folder_id str
    ID of the folder to attach a policy to.
    members Sequence[str]
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role str
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleep_after int
    folderId String
    ID of the folder to attach a policy to.
    members List<String>
    An array of identities that will be granted the privilege that is specified in the role field. Each entry can have one of the following values:

    • userAccount:{user_id}: An email address that represents a specific Yandex account. For example, ivan@yandex.ru or joe@example.com.
    • serviceAccount:{service_account_id}: A unique service account ID.
    role String
    The role that should be assigned. Only one yandex.ResourcemanagerFolderIamBinding can be used per role.
    sleepAfter Number

    Import

    IAM binding imports use space-delimited identifiers; first the resource in question and then the role. These bindings can be imported using the folder_id and role, e.g.

     $ pulumi import yandex:index/resourcemanagerFolderIamBinding:ResourcemanagerFolderIamBinding viewer "folder_id viewer"
    

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi