UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

173 lines 7.8 kB
"use strict"; // *** 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.getSecretVersionOutput = exports.getSecretVersion = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * The `scaleway.secrets.Version` data source is used to get information about a specific secret version stored in Scaleway Secret Manager. * * Refer to the Secret Manager [product documentation](https://www.scaleway.com/en/docs/identity-and-access-management/secret-manager/) and [API documentation](https://www.scaleway.com/en/developers/api/secret-manager/) for more information. * * ## Example Usage * * ### Use Secret Manager * * The following commands allow you to: * * - create a secret named `fooii` * - create a new version of `fooii` containing data (`yourSecret`) * - retrieve the secret version specified by the secret ID and the desired version * - retrieve the secret version specified by the secret name and the desired version * * The output blocks display the sensitive data contained in your secret version. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Create a secret named fooii * const main = new scaleway.secrets.Secret("main", { * name: "fooii", * description: "barr", * }); * // Create a version of fooii containing data * const mainVersion = new scaleway.secrets.Version("main", { * description: "your description", * secretId: main.id, * data: "your_secret", * }); * // Retrieve the secret version specified by the secret ID and the desired version * const dataBySecretId = scaleway.secrets.getVersionOutput({ * secretId: main.id, * revision: "1", * }); * // Retrieve the secret version specified by the secret name and the desired version * const dataBySecretName = scaleway.secrets.getVersionOutput({ * secretName: main.name, * revision: "1", * }); * export const scalewaySecretAccessPayload = dataBySecretName.apply(dataBySecretName => dataBySecretName.data); * export const scalewaySecretAccessPayloadById = dataBySecretId.apply(dataBySecretId => dataBySecretId.data); * ``` * * ## Data * * Note: This data source provides you with access to the secret payload, which is encoded in base64. * * Keep in mind that this is a sensitive attribute. For more information, * see Sensitive Data in State. * * > **Important:** This property is sensitive and will not be displayed in the pulumi preview, for security reasons. */ /** @deprecated scaleway.index/getsecretversion.getSecretVersion has been deprecated in favor of scaleway.secrets/getversion.getVersion */ function getSecretVersion(args, opts) { pulumi.log.warn("getSecretVersion is deprecated: scaleway.index/getsecretversion.getSecretVersion has been deprecated in favor of scaleway.secrets/getversion.getVersion"); args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("scaleway:index/getSecretVersion:getSecretVersion", { "organizationId": args.organizationId, "projectId": args.projectId, "region": args.region, "revision": args.revision, "secretId": args.secretId, "secretName": args.secretName, }, opts); } exports.getSecretVersion = getSecretVersion; /** * The `scaleway.secrets.Version` data source is used to get information about a specific secret version stored in Scaleway Secret Manager. * * Refer to the Secret Manager [product documentation](https://www.scaleway.com/en/docs/identity-and-access-management/secret-manager/) and [API documentation](https://www.scaleway.com/en/developers/api/secret-manager/) for more information. * * ## Example Usage * * ### Use Secret Manager * * The following commands allow you to: * * - create a secret named `fooii` * - create a new version of `fooii` containing data (`yourSecret`) * - retrieve the secret version specified by the secret ID and the desired version * - retrieve the secret version specified by the secret name and the desired version * * The output blocks display the sensitive data contained in your secret version. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * // Create a secret named fooii * const main = new scaleway.secrets.Secret("main", { * name: "fooii", * description: "barr", * }); * // Create a version of fooii containing data * const mainVersion = new scaleway.secrets.Version("main", { * description: "your description", * secretId: main.id, * data: "your_secret", * }); * // Retrieve the secret version specified by the secret ID and the desired version * const dataBySecretId = scaleway.secrets.getVersionOutput({ * secretId: main.id, * revision: "1", * }); * // Retrieve the secret version specified by the secret name and the desired version * const dataBySecretName = scaleway.secrets.getVersionOutput({ * secretName: main.name, * revision: "1", * }); * export const scalewaySecretAccessPayload = dataBySecretName.apply(dataBySecretName => dataBySecretName.data); * export const scalewaySecretAccessPayloadById = dataBySecretId.apply(dataBySecretId => dataBySecretId.data); * ``` * * ## Data * * Note: This data source provides you with access to the secret payload, which is encoded in base64. * * Keep in mind that this is a sensitive attribute. For more information, * see Sensitive Data in State. * * > **Important:** This property is sensitive and will not be displayed in the pulumi preview, for security reasons. */ /** @deprecated scaleway.index/getsecretversion.getSecretVersion has been deprecated in favor of scaleway.secrets/getversion.getVersion */ function getSecretVersionOutput(args, opts) { pulumi.log.warn("getSecretVersion is deprecated: scaleway.index/getsecretversion.getSecretVersion has been deprecated in favor of scaleway.secrets/getversion.getVersion"); args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("scaleway:index/getSecretVersion:getSecretVersion", { "organizationId": args.organizationId, "projectId": args.projectId, "region": args.region, "revision": args.revision, "secretId": args.secretId, "secretName": args.secretName, }, opts); } exports.getSecretVersionOutput = getSecretVersionOutput; //# sourceMappingURL=getSecretVersion.js.map