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

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),
        });
    }

}
Copy
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
	})
}
Copy

Coming soon!

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,
});
Copy
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)
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. ResourcemanagerFolderIamPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. ResourcemanagerFolderIamPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ResourcemanagerFolderIamPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := yandex.NewResourcemanagerFolderIamPolicy(ctx, "resourcemanagerFolderIamPolicyResource", &yandex.ResourcemanagerFolderIamPolicyArgs{
	FolderId:   pulumi.String("string"),
	PolicyData: pulumi.String("string"),
})
Copy
var resourcemanagerFolderIamPolicyResource = new ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource", ResourcemanagerFolderIamPolicyArgs.builder()
    .folderId("string")
    .policyData("string")
    .build());
Copy
resourcemanager_folder_iam_policy_resource = yandex.ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource",
    folder_id="string",
    policy_data="string")
Copy
const resourcemanagerFolderIamPolicyResource = new yandex.ResourcemanagerFolderIamPolicy("resourcemanagerFolderIamPolicyResource", {
    folderId: "string",
    policyData: "string",
});
Copy
type: yandex:ResourcemanagerFolderIamPolicy
properties:
    folderId: string
    policyData: string
Copy

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 This property is required. string
ID of the folder that the policy is attached to.
PolicyData This property is required. 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 This property is required. string
ID of the folder that the policy is attached to.
PolicyData This property is required. 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 This property is required. String
ID of the folder that the policy is attached to.
policyData This property is required. 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 This property is required. string
ID of the folder that the policy is attached to.
policyData This property is required. 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 This property is required. str
ID of the folder that the policy is attached to.
policy_data This property is required. 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 This property is required. String
ID of the folder that the policy is attached to.
policyData This property is required. 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)
resources:  _:    type: yandex:ResourcemanagerFolderIamPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.