@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
143 lines • 6.33 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Version = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(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.
*
* > **Security Best Practice:**
* For enhanced security, we recommend using the `dataWo` write-only argument instead of the regular `data` argument. This ensures your sensitive data is never stored in Terraform state files, providing superior protection against accidental exposure. Write-Only arguments are supported in Terraform 1.11.0 and later.
*
* ## 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.
*
* ```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, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:secrets/version:Version';
/**
* 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?.createdAt;
resourceInputs["data"] = state?.data;
resourceInputs["dataWo"] = state?.dataWo;
resourceInputs["dataWoVersion"] = state?.dataWoVersion;
resourceInputs["description"] = state?.description;
resourceInputs["region"] = state?.region;
resourceInputs["revision"] = state?.revision;
resourceInputs["secretId"] = state?.secretId;
resourceInputs["status"] = state?.status;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.secretId === undefined && !opts.urn) {
throw new Error("Missing required property 'secretId'");
}
resourceInputs["data"] = args?.data ? pulumi.secret(args.data) : undefined;
resourceInputs["dataWo"] = args?.dataWo ? pulumi.secret(args.dataWo) : undefined;
resourceInputs["dataWoVersion"] = args?.dataWoVersion;
resourceInputs["description"] = args?.description;
resourceInputs["region"] = args?.region;
resourceInputs["secretId"] = args?.secretId;
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", "dataWo"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(Version.__pulumiType, name, resourceInputs, opts);
}
}
exports.Version = Version;
//# sourceMappingURL=version.js.map