@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
153 lines • 6.46 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.Secret = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* The `scaleway.secrets.Secret` resource allows you to create and manage secrets 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
*
* The following command allows you to create a secret named `foo` with a description (`barr`), and tags (`foo` and `terraform`).
*
* ```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",
* ],
* });
* ```
*
* ### Apply the ephemeral policy on a secret
*
* The following command shows you how to apply the [ephemeral policy](https://www.scaleway.com/en/docs/identity-and-access-management/secret-manager/concepts/#ephemeral-policy) on your secret named `foo`.
*
* In the example below, your secret's lifetime is of 24 hours, your secret versions will expire once they are accessed, and they are disabled after being accessed.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const ephemeral = new scaleway.secrets.Secret("ephemeral", {
* name: "foo",
* ephemeralPolicies: [{
* ttl: "24h",
* expiresOnceAccessed: true,
* action: "disable",
* }],
* });
* ```
*
* ## Import
*
* This section explains how to import a secret using the `{region}/{id}` format.
*
* ```sh
* $ pulumi import scaleway:secrets/secret:Secret main fr-par/11111111-1111-1111-1111-111111111111
* ```
*/
class Secret extends pulumi.CustomResource {
/**
* Get an existing Secret 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 Secret(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:secrets/secret:Secret';
/**
* Returns true if the given object is an instance of Secret. 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'] === Secret.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["description"] = state?.description;
resourceInputs["ephemeralPolicies"] = state?.ephemeralPolicies;
resourceInputs["name"] = state?.name;
resourceInputs["path"] = state?.path;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["protected"] = state?.protected;
resourceInputs["region"] = state?.region;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["type"] = state?.type;
resourceInputs["updatedAt"] = state?.updatedAt;
resourceInputs["versionCount"] = state?.versionCount;
resourceInputs["versions"] = state?.versions;
}
else {
const args = argsOrState;
resourceInputs["description"] = args?.description;
resourceInputs["ephemeralPolicies"] = args?.ephemeralPolicies;
resourceInputs["name"] = args?.name;
resourceInputs["path"] = args?.path;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["protected"] = args?.protected;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
resourceInputs["versionCount"] = undefined /*out*/;
resourceInputs["versions"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/secret:Secret" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(Secret.__pulumiType, name, resourceInputs, opts);
}
}
exports.Secret = Secret;
//# sourceMappingURL=secret.js.map