UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

101 lines 5.32 kB
"use strict"; // *** 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.IamServiceAccountIamMember = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * When managing IAM roles, you can treat a service account either as a resource or as an identity. * This resource is used to add IAM policy bindings to a service account resource to configure permissions * that define who can edit the service account. * * There are three different resources that help you manage your IAM policy for a service account. * Each of these resources is used for a different use case: * * * yandex_iam_service_account_iam_policy: Authoritative. Sets the IAM policy for the service account and replaces any existing policy already attached. * * yandex_iam_service_account_iam_binding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the service account are preserved. * * yandex_iam_service_account_iam_member: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role of the service account are preserved. * * > **Note:** `yandex.IamServiceAccountIamPolicy` **cannot** be used in conjunction with `yandex.IamServiceAccountIamBinding` and `yandex.IamServiceAccountIamMember` or they will conflict over what your policy should be. * * > **Note:** `yandex.IamServiceAccountIamBinding` resources **can be** used in conjunction with `yandex.IamServiceAccountIamMember` resources **only if** they do not grant privileges to the same role. * * ## yandex\_service\_account\_iam\_member * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const admin_account_iam = new yandex.IamServiceAccountIamMember("admin-account-iam", { * member: "userAccount:bar_user_id", * role: "admin", * serviceAccountId: "your-service-account-id", * }); * ``` * * ## Import * * Service account IAM member resources can be imported using the service account ID, role and member. * * ```sh * $ pulumi import yandex:index/iamServiceAccountIamMember:IamServiceAccountIamMember admin-account-iam "service_account_id roles/editor foo@example.com" * ``` */ class IamServiceAccountIamMember extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["member"] = state ? state.member : undefined; resourceInputs["role"] = state ? state.role : undefined; resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined; resourceInputs["sleepAfter"] = state ? state.sleepAfter : undefined; } else { const args = argsOrState; if ((!args || args.member === undefined) && !opts.urn) { throw new Error("Missing required property 'member'"); } if ((!args || args.role === undefined) && !opts.urn) { throw new Error("Missing required property 'role'"); } if ((!args || args.serviceAccountId === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceAccountId'"); } resourceInputs["member"] = args ? args.member : undefined; resourceInputs["role"] = args ? args.role : undefined; resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined; resourceInputs["sleepAfter"] = args ? args.sleepAfter : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IamServiceAccountIamMember.__pulumiType, name, resourceInputs, opts); } /** * Get an existing IamServiceAccountIamMember resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new IamServiceAccountIamMember(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IamServiceAccountIamMember. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === IamServiceAccountIamMember.__pulumiType; } } exports.IamServiceAccountIamMember = IamServiceAccountIamMember; /** @internal */ IamServiceAccountIamMember.__pulumiType = 'yandex:index/iamServiceAccountIamMember:IamServiceAccountIamMember'; //# sourceMappingURL=iamServiceAccountIamMember.js.map