UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

87 lines 4.51 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.IamServiceAccountStaticAccessKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Allows management of [Yandex.Cloud IAM service account static access keys](https://cloud.yandex.com/docs/iam/operations/sa/create-access-key). * Generated pair of keys is used to access [Yandex Object Storage](https://cloud.yandex.com/docs/storage) on behalf of service account. * * Before using keys do not forget to [assign a proper role](https://cloud.yandex.com/docs/iam/operations/sa/assign-role-for-sa) to the service account. * * ## Example Usage * * This snippet creates a service account static access key. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const sa_static_key = new yandex.IamServiceAccountStaticAccessKey("sa-static-key", { * description: "static access key for object storage", * pgpKey: "keybase:keybaseusername", * serviceAccountId: "some_sa_id", * }); * ``` */ class IamServiceAccountStaticAccessKey extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessKey"] = state ? state.accessKey : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["encryptedSecretKey"] = state ? state.encryptedSecretKey : undefined; resourceInputs["keyFingerprint"] = state ? state.keyFingerprint : undefined; resourceInputs["pgpKey"] = state ? state.pgpKey : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; resourceInputs["serviceAccountId"] = state ? state.serviceAccountId : undefined; } else { const args = argsOrState; if ((!args || args.serviceAccountId === undefined) && !opts.urn) { throw new Error("Missing required property 'serviceAccountId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["pgpKey"] = args ? args.pgpKey : undefined; resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined; resourceInputs["accessKey"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["encryptedSecretKey"] = undefined /*out*/; resourceInputs["keyFingerprint"] = undefined /*out*/; resourceInputs["secretKey"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(IamServiceAccountStaticAccessKey.__pulumiType, name, resourceInputs, opts); } /** * Get an existing IamServiceAccountStaticAccessKey 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 IamServiceAccountStaticAccessKey(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of IamServiceAccountStaticAccessKey. 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'] === IamServiceAccountStaticAccessKey.__pulumiType; } } exports.IamServiceAccountStaticAccessKey = IamServiceAccountStaticAccessKey; /** @internal */ IamServiceAccountStaticAccessKey.__pulumiType = 'yandex:index/iamServiceAccountStaticAccessKey:IamServiceAccountStaticAccessKey'; //# sourceMappingURL=iamServiceAccountStaticAccessKey.js.map