@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
85 lines • 4.33 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.IamServiceAccountApiKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of a [Yandex.Cloud IAM service account API key](https://cloud.yandex.com/docs/iam/concepts/authorization/api-key).
* The API key is a private key used for simplified authorization in the Yandex.Cloud API. API keys are only used for [service accounts](https://cloud.yandex.com/docs/iam/concepts/users/service-accounts).
*
* API keys do not expire. This means that this authentication method is simpler, but less secure. Use it if you can't automatically request an [IAM token](https://cloud.yandex.com/docs/iam/concepts/authorization/iam-token).
*
* ## Example Usage
*
* This snippet creates an API key.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const sa_api_key = new yandex.IamServiceAccountApiKey("sa-api-key", {
* description: "api key for authorization",
* pgpKey: "keybase:keybaseusername",
* serviceAccountId: "some_sa_id",
* });
* ```
*/
class IamServiceAccountApiKey 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["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["createdAt"] = undefined /*out*/;
resourceInputs["encryptedSecretKey"] = undefined /*out*/;
resourceInputs["keyFingerprint"] = undefined /*out*/;
resourceInputs["secretKey"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(IamServiceAccountApiKey.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing IamServiceAccountApiKey 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 IamServiceAccountApiKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of IamServiceAccountApiKey. 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'] === IamServiceAccountApiKey.__pulumiType;
}
}
exports.IamServiceAccountApiKey = IamServiceAccountApiKey;
/** @internal */
IamServiceAccountApiKey.__pulumiType = 'yandex:index/iamServiceAccountApiKey:IamServiceAccountApiKey';
//# sourceMappingURL=iamServiceAccountApiKey.js.map