@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
48 lines • 1.76 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getIamPolicyOutput = exports.getIamPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Generates an [IAM] policy document that may be referenced by and applied to
* other Yandex.Cloud Platform resources, such as the `yandex.ResourcemanagerFolder` resource.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const admin = pulumi.output(yandex.getIamPolicy({
* bindings: [
* {
* members: ["userAccount:user_id_1"],
* role: "admin",
* },
* {
* members: ["userAccount:user_id_2"],
* role: "viewer",
* },
* ],
* }));
* ```
*
* This data source is used to define [IAM] policies to apply to other resources.
* Currently, defining a policy through a data source and referencing that policy
* from another resource is the only way to apply an IAM policy to a resource.
*/
function getIamPolicy(args, opts) {
if (!opts) {
opts = {};
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
return pulumi.runtime.invoke("yandex:index/getIamPolicy:getIamPolicy", {
"bindings": args.bindings,
}, opts);
}
exports.getIamPolicy = getIamPolicy;
function getIamPolicyOutput(args, opts) {
return pulumi.output(args).apply(a => getIamPolicy(a, opts));
}
exports.getIamPolicyOutput = getIamPolicyOutput;
//# sourceMappingURL=getIamPolicy.js.map