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

yandex.ResourcemanagerFolderIamPolicy

Explore with Pulumi AI

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

    Allows creation and management of the IAM policy for an existing Yandex Resource Manager folder.

    Example Usage

    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var project1 = Output.Create(Yandex.GetResourcemanagerFolder.InvokeAsync(new Yandex.GetResourcemanagerFolderArgs
            {
                FolderId = "my_folder_id",
            }));
            var admin = Output.Create(Yandex.GetIamPolicy.InvokeAsync(new Yandex.GetIamPolicyArgs
            {
                Bindings = 
                {
                    new Yandex.Inputs.GetIamPolicyBindingArgs
                    {
                        Members = 
                        {
                            "userAccount:some_user_id",
                        },
                        Role = "editor",
                    },
                },
            }));
            var folderAdminPolicy = new Yandex.ResourcemanagerFolderIamPolicy("folderAdminPolicy", new Yandex.ResourcemanagerFolderIamPolicyArgs
            {
                FolderId = data.Yandex_folder.Project1.Id,
                PolicyData = admin.Apply(admin => admin.PolicyData),
            });
        }
    
    }
    
    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 := "my_folder_id"
    		_, err := yandex.LookupResourcemanagerFolder(ctx, &GetResourcemanagerFolderArgs{
    			FolderId: &opt0,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		admin, err := yandex.GetIamPolicy(ctx, &GetIamPolicyArgs{
    			Bindings: []GetIamPolicyBinding{
    				GetIamPolicyBinding{
    					Members: []string{
    						"userAccount:some_user_id",
    					},
    					Role: "editor",
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = yandex.NewResourcemanagerFolderIamPolicy(ctx, "folderAdminPolicy", &yandex.ResourcemanagerFolderIamPolicyArgs{
    			FolderId:   pulumi.Any(data.Yandex_folder.Project1.Id),
    			PolicyData: pulumi.String(admin.PolicyData),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_yandex as yandex
    
    project1 = yandex.get_resourcemanager_folder(folder_id="my_folder_id")
    admin = yandex.get_iam_policy(bindings=[yandex.GetIamPolicyBindingArgs(
        members=["userAccount:some_user_id"],
        role="editor",
    )])
    folder_admin_policy = yandex.ResourcemanagerFolderIamPolicy("folderAdminPolicy",
        folder_id=data["yandex_folder"]["project1"]["id"],
        policy_data=admin.policy_data)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const project1 = pulumi.output(yandex.getResourcemanagerFolder({
        folderId: "my_folder_id",
    }));
    const admin = pulumi.output(yandex.getIamPolicy({
        bindings: [{
            members: ["userAccount:some_user_id"],
            role: "editor",
        }],
    }));
    const folderAdminPolicy = new yandex.ResourcemanagerFolderIamPolicy("folder_admin_policy", {
        folderId: yandex_folder_project1.id,
        policyData: admin.policyData,
    });
    

    Coming soon!

    Create ResourcemanagerFolderIamPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ResourcemanagerFolderIamPolicy(name: string, args: ResourcemanagerFolderIamPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ResourcemanagerFolderIamPolicy(resource_name: str,
                                       args: ResourcemanagerFolderIamPolicyArgs,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourcemanagerFolderIamPolicy(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       folder_id: Optional[str] = None,
                                       policy_data: Optional[str] = None)
    func NewResourcemanagerFolderIamPolicy(ctx *Context, name string, args ResourcemanagerFolderIamPolicyArgs, opts ...ResourceOption) (*ResourcemanagerFolderIamPolicy, error)
    public ResourcemanagerFolderIamPolicy(string name, ResourcemanagerFolderIamPolicyArgs args, CustomResourceOptions? opts = null)
    public ResourcemanagerFolderIamPolicy(String name, ResourcemanagerFolderIamPolicyArgs args)
    public ResourcemanagerFolderIamPolicy(String name, ResourcemanagerFolderIamPolicyArgs args, CustomResourceOptions options)
    
    type: yandex:ResourcemanagerFolderIamPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ResourcemanagerFolderIamPolicyArgs
    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 ResourcemanagerFolderIamPolicyArgs
    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 ResourcemanagerFolderIamPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourcemanagerFolderIamPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourcemanagerFolderIamPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var resourcemanagerFolderIamPolicyResource = new Yandex.ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource", new()
    {
        FolderId = "string",
        PolicyData = "string",
    });
    
    example, err := yandex.NewResourcemanagerFolderIamPolicy(ctx, "resourcemanagerFolderIamPolicyResource", &yandex.ResourcemanagerFolderIamPolicyArgs{
    	FolderId:   pulumi.String("string"),
    	PolicyData: pulumi.String("string"),
    })
    
    var resourcemanagerFolderIamPolicyResource = new ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource", ResourcemanagerFolderIamPolicyArgs.builder()
        .folderId("string")
        .policyData("string")
        .build());
    
    resourcemanager_folder_iam_policy_resource = yandex.ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource",
        folder_id="string",
        policy_data="string")
    
    const resourcemanagerFolderIamPolicyResource = new yandex.ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource", {
        folderId: "string",
        policyData: "string",
    });
    
    type: yandex:ResourcemanagerFolderIamPolicy
    properties:
        folderId: string
        policyData: string
    

    ResourcemanagerFolderIamPolicy Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ResourcemanagerFolderIamPolicy resource accepts the following input properties:

    FolderId string
    ID of the folder that the policy is attached to.
    PolicyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    FolderId string
    ID of the folder that the policy is attached to.
    PolicyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId String
    ID of the folder that the policy is attached to.
    policyData String
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId string
    ID of the folder that the policy is attached to.
    policyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folder_id str
    ID of the folder that the policy is attached to.
    policy_data str
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId String
    ID of the folder that the policy is attached to.
    policyData String
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ResourcemanagerFolderIamPolicy 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 ResourcemanagerFolderIamPolicy Resource

    Get an existing ResourcemanagerFolderIamPolicy 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?: ResourcemanagerFolderIamPolicyState, opts?: CustomResourceOptions): ResourcemanagerFolderIamPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            folder_id: Optional[str] = None,
            policy_data: Optional[str] = None) -> ResourcemanagerFolderIamPolicy
    func GetResourcemanagerFolderIamPolicy(ctx *Context, name string, id IDInput, state *ResourcemanagerFolderIamPolicyState, opts ...ResourceOption) (*ResourcemanagerFolderIamPolicy, error)
    public static ResourcemanagerFolderIamPolicy Get(string name, Input<string> id, ResourcemanagerFolderIamPolicyState? state, CustomResourceOptions? opts = null)
    public static ResourcemanagerFolderIamPolicy get(String name, Output<String> id, ResourcemanagerFolderIamPolicyState 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 that the policy is attached to.
    PolicyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    FolderId string
    ID of the folder that the policy is attached to.
    PolicyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId String
    ID of the folder that the policy is attached to.
    policyData String
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId string
    ID of the folder that the policy is attached to.
    policyData string
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folder_id str
    ID of the folder that the policy is attached to.
    policy_data str
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.
    folderId String
    ID of the folder that the policy is attached to.
    policyData String
    The yandex.getIamPolicy data source that represents the IAM policy that will be applied to the folder. This policy overrides any existing policy applied to the folder.

    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