Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Yandex

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

ResourcemanagerFolderIamPolicy

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

Create a ResourcemanagerFolderIamPolicy Resource

new ResourcemanagerFolderIamPolicy(name: string, args: ResourcemanagerFolderIamPolicyArgs, opts?: CustomResourceOptions);
@overload
def ResourcemanagerFolderIamPolicy(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   folder_id: Optional[str] = None,
                                   policy_data: Optional[str] = None)
@overload
def ResourcemanagerFolderIamPolicy(resource_name: str,
                                   args: ResourcemanagerFolderIamPolicyArgs,
                                   opts: Optional[ResourceOptions] = None)
func NewResourcemanagerFolderIamPolicy(ctx *Context, name string, args ResourcemanagerFolderIamPolicyArgs, opts ...ResourceOption) (*ResourcemanagerFolderIamPolicy, error)
public ResourcemanagerFolderIamPolicy(string name, ResourcemanagerFolderIamPolicyArgs args, CustomResourceOptions? opts = null)
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.

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

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.
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.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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:

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.

Package Details

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