@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
90 lines • 4.67 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.IamServiceAccountKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of [Yandex.Cloud IAM service account authorized keys](https://cloud.yandex.com/docs/iam/concepts/authorization/key).
* Generated pair of keys is used to create a [JSON Web Token](https://tools.ietf.org/html/rfc7519) which is necessary for requesting an [IAM Token](https://cloud.yandex.com/docs/iam/concepts/authorization/iam-token) for a [service account](https://cloud.yandex.com/docs/iam/concepts/users/service-accounts).
*
* ## Example Usage
*
* This snippet creates an authorized keys pair.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const sa_auth_key = new yandex.IamServiceAccountKey("sa-auth-key", {
* description: "key for service account",
* keyAlgorithm: "RSA_4096",
* pgpKey: "keybase:keybaseusername",
* serviceAccountId: "some_sa_id",
* });
* ```
*/
class IamServiceAccountKey extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["encryptedPrivateKey"] = state ? state.encryptedPrivateKey : undefined;
resourceInputs["format"] = state ? state.format : undefined;
resourceInputs["keyAlgorithm"] = state ? state.keyAlgorithm : undefined;
resourceInputs["keyFingerprint"] = state ? state.keyFingerprint : undefined;
resourceInputs["pgpKey"] = state ? state.pgpKey : undefined;
resourceInputs["privateKey"] = state ? state.privateKey : undefined;
resourceInputs["publicKey"] = state ? state.publicKey : 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["format"] = args ? args.format : undefined;
resourceInputs["keyAlgorithm"] = args ? args.keyAlgorithm : undefined;
resourceInputs["pgpKey"] = args ? args.pgpKey : undefined;
resourceInputs["serviceAccountId"] = args ? args.serviceAccountId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["encryptedPrivateKey"] = undefined /*out*/;
resourceInputs["keyFingerprint"] = undefined /*out*/;
resourceInputs["privateKey"] = undefined /*out*/;
resourceInputs["publicKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IamServiceAccountKey.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing IamServiceAccountKey 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 IamServiceAccountKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of IamServiceAccountKey. 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'] === IamServiceAccountKey.__pulumiType;
}
}
exports.IamServiceAccountKey = IamServiceAccountKey;
/** @internal */
IamServiceAccountKey.__pulumiType = 'yandex:index/iamServiceAccountKey:IamServiceAccountKey';
//# sourceMappingURL=iamServiceAccountKey.js.map