@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
118 lines • 5.09 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.Version = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* The `scaleway.secrets.Version` resource allows you to create and manage secret versions in Scaleway Secret Manager.
*
* Refer to the Secret Manager [product documentation](https://www.scaleway.com/en/docs/secret-manager/) and [API documentation](https://www.scaleway.com/en/developers/api/secret-manager/) for more information.
*
* ## Example Usage
*
* ### Create a secret and a version
*
* The following commands allow you to:
*
* - create a secret named `foo`
* - create a version of this secret containing the `myNewSecret` data
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.secrets.Secret("main", {
* name: "foo",
* description: "barr",
* tags: [
* "foo",
* "terraform",
* ],
* });
* const v1 = new scaleway.secrets.Version("v1", {
* description: "version1",
* secretId: main.id,
* data: "my_new_secret",
* });
* ```
*
* ## Import
*
* This section explains how to import a secret version using the `{region}/{id}/{revision}` format.
*
* ~> **Important:** Keep in mind that if you import with the `latest` revision, you will overwrite the previous version you might have been using.
*
* bash
*
* ```sh
* $ pulumi import scaleway:secrets/version:Version main fr-par/11111111-1111-1111-1111-111111111111/2
* ```
*/
class Version extends pulumi.CustomResource {
/**
* Get an existing Version 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 Version(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Version. 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'] === Version.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["data"] = state ? state.data : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["revision"] = state ? state.revision : undefined;
resourceInputs["secretId"] = state ? state.secretId : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
if ((!args || args.data === undefined) && !opts.urn) {
throw new Error("Missing required property 'data'");
}
if ((!args || args.secretId === undefined) && !opts.urn) {
throw new Error("Missing required property 'secretId'");
}
resourceInputs["data"] = (args === null || args === void 0 ? void 0 : args.data) ? pulumi.secret(args.data) : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["secretId"] = args ? args.secretId : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["revision"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/secretVersion:SecretVersion" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
const secretOpts = { additionalSecretOutputs: ["data"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Version.__pulumiType, name, resourceInputs, opts);
}
}
exports.Version = Version;
/** @internal */
Version.__pulumiType = 'scaleway:secrets/version:Version';
//# sourceMappingURL=version.js.map