@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
152 lines • 6.89 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.getSecretVersionOutput = exports.getSecretVersion = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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 "@pulumi/scaleway";
* 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 information
*
* 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 "@pulumi/scaleway";
* 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 information
*
* 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