1. Packages
  2. Scaleway
  3. API Docs
  4. SecretVersion
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.SecretVersion

Explore with Pulumi AI

Deprecated: scaleway.index/secretversion.SecretVersion has been deprecated in favor of scaleway.secrets/version.Version

The scaleway.secrets.Version resource allows you to create and manage secret versions in Scaleway Secret Manager.

Refer to the Secret Manager product documentation and API documentation 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 my_new_secret data
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",
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

main = scaleway.secrets.Secret("main",
    name="foo",
    description="barr",
    tags=[
        "foo",
        "terraform",
    ])
v1 = scaleway.secrets.Version("v1",
    description="version1",
    secret_id=main.id,
    data="my_new_secret")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/secrets"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := secrets.NewSecret(ctx, "main", &secrets.SecretArgs{
			Name:        pulumi.String("foo"),
			Description: pulumi.String("barr"),
			Tags: pulumi.StringArray{
				pulumi.String("foo"),
				pulumi.String("terraform"),
			},
		})
		if err != nil {
			return err
		}
		_, err = secrets.NewVersion(ctx, "v1", &secrets.VersionArgs{
			Description: pulumi.String("version1"),
			SecretId:    main.ID(),
			Data:        pulumi.String("my_new_secret"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var main = new Scaleway.Secrets.Secret("main", new()
    {
        Name = "foo",
        Description = "barr",
        Tags = new[]
        {
            "foo",
            "terraform",
        },
    });

    var v1 = new Scaleway.Secrets.Version("v1", new()
    {
        Description = "version1",
        SecretId = main.Id,
        Data = "my_new_secret",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.secrets.Secret;
import com.pulumi.scaleway.secrets.SecretArgs;
import com.pulumi.scaleway.secrets.Version;
import com.pulumi.scaleway.secrets.VersionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var main = new Secret("main", SecretArgs.builder()
            .name("foo")
            .description("barr")
            .tags(            
                "foo",
                "terraform")
            .build());

        var v1 = new Version("v1", VersionArgs.builder()
            .description("version1")
            .secretId(main.id())
            .data("my_new_secret")
            .build());

    }
}
Copy
resources:
  main:
    type: scaleway:secrets:Secret
    properties:
      name: foo
      description: barr
      tags:
        - foo
        - terraform
  v1:
    type: scaleway:secrets:Version
    properties:
      description: version1
      secretId: ${main.id}
      data: my_new_secret
Copy

Create SecretVersion Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SecretVersion(name: string, args: SecretVersionArgs, opts?: CustomResourceOptions);
@overload
def SecretVersion(resource_name: str,
                  args: SecretVersionInitArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def SecretVersion(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  data: Optional[str] = None,
                  description: Optional[str] = None,
                  region: Optional[str] = None,
                  secret_id: Optional[str] = None)
func NewSecretVersion(ctx *Context, name string, args SecretVersionArgs, opts ...ResourceOption) (*SecretVersion, error)
public SecretVersion(string name, SecretVersionArgs args, CustomResourceOptions? opts = null)
public SecretVersion(String name, SecretVersionArgs args)
public SecretVersion(String name, SecretVersionArgs args, CustomResourceOptions options)
type: scaleway:SecretVersion
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SecretVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SecretVersionInitArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SecretVersionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SecretVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SecretVersionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SecretVersion Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SecretVersion resource accepts the following input properties:

Data
This property is required.
Changes to this property will trigger replacement.
string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
SecretId This property is required. string
The ID of the secret associated with the version.
Description string
Description of the secret version (e.g. my-new-description).
Region Changes to this property will trigger replacement. string
). The region where the resource exists.
Data
This property is required.
Changes to this property will trigger replacement.
string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
SecretId This property is required. string
The ID of the secret associated with the version.
Description string
Description of the secret version (e.g. my-new-description).
Region Changes to this property will trigger replacement. string
). The region where the resource exists.
data
This property is required.
Changes to this property will trigger replacement.
String
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
secretId This property is required. String
The ID of the secret associated with the version.
description String
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. String
). The region where the resource exists.
data
This property is required.
Changes to this property will trigger replacement.
string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
secretId This property is required. string
The ID of the secret associated with the version.
description string
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. string
). The region where the resource exists.
data
This property is required.
Changes to this property will trigger replacement.
str
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
secret_id This property is required. str
The ID of the secret associated with the version.
description str
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. str
). The region where the resource exists.
data
This property is required.
Changes to this property will trigger replacement.
String
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
secretId This property is required. String
The ID of the secret associated with the version.
description String
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. String
). The region where the resource exists.

Outputs

All input properties are implicitly available as output properties. Additionally, the SecretVersion resource produces the following output properties:

CreatedAt string
The date and time of the secret version's creation (in RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
Revision string
The revision number of the secret version.
Status string
The status of the secret version.
UpdatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
CreatedAt string
The date and time of the secret version's creation (in RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
Revision string
The revision number of the secret version.
Status string
The status of the secret version.
UpdatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
createdAt String
The date and time of the secret version's creation (in RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
revision String
The revision number of the secret version.
status String
The status of the secret version.
updatedAt String
The date and time of the secret version's last update (in RFC 3339 format).
createdAt string
The date and time of the secret version's creation (in RFC 3339 format).
id string
The provider-assigned unique ID for this managed resource.
revision string
The revision number of the secret version.
status string
The status of the secret version.
updatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
created_at str
The date and time of the secret version's creation (in RFC 3339 format).
id str
The provider-assigned unique ID for this managed resource.
revision str
The revision number of the secret version.
status str
The status of the secret version.
updated_at str
The date and time of the secret version's last update (in RFC 3339 format).
createdAt String
The date and time of the secret version's creation (in RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
revision String
The revision number of the secret version.
status String
The status of the secret version.
updatedAt String
The date and time of the secret version's last update (in RFC 3339 format).

Look up Existing SecretVersion Resource

Get an existing SecretVersion resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SecretVersionState, opts?: CustomResourceOptions): SecretVersion
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        data: Optional[str] = None,
        description: Optional[str] = None,
        region: Optional[str] = None,
        revision: Optional[str] = None,
        secret_id: Optional[str] = None,
        status: Optional[str] = None,
        updated_at: Optional[str] = None) -> SecretVersion
func GetSecretVersion(ctx *Context, name string, id IDInput, state *SecretVersionState, opts ...ResourceOption) (*SecretVersion, error)
public static SecretVersion Get(string name, Input<string> id, SecretVersionState? state, CustomResourceOptions? opts = null)
public static SecretVersion get(String name, Output<String> id, SecretVersionState state, CustomResourceOptions options)
resources:  _:    type: scaleway:SecretVersion    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CreatedAt string
The date and time of the secret version's creation (in RFC 3339 format).
Data Changes to this property will trigger replacement. string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
Description string
Description of the secret version (e.g. my-new-description).
Region Changes to this property will trigger replacement. string
). The region where the resource exists.
Revision string
The revision number of the secret version.
SecretId string
The ID of the secret associated with the version.
Status string
The status of the secret version.
UpdatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
CreatedAt string
The date and time of the secret version's creation (in RFC 3339 format).
Data Changes to this property will trigger replacement. string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
Description string
Description of the secret version (e.g. my-new-description).
Region Changes to this property will trigger replacement. string
). The region where the resource exists.
Revision string
The revision number of the secret version.
SecretId string
The ID of the secret associated with the version.
Status string
The status of the secret version.
UpdatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
createdAt String
The date and time of the secret version's creation (in RFC 3339 format).
data Changes to this property will trigger replacement. String
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
description String
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. String
). The region where the resource exists.
revision String
The revision number of the secret version.
secretId String
The ID of the secret associated with the version.
status String
The status of the secret version.
updatedAt String
The date and time of the secret version's last update (in RFC 3339 format).
createdAt string
The date and time of the secret version's creation (in RFC 3339 format).
data Changes to this property will trigger replacement. string
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
description string
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. string
). The region where the resource exists.
revision string
The revision number of the secret version.
secretId string
The ID of the secret associated with the version.
status string
The status of the secret version.
updatedAt string
The date and time of the secret version's last update (in RFC 3339 format).
created_at str
The date and time of the secret version's creation (in RFC 3339 format).
data Changes to this property will trigger replacement. str
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
description str
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. str
). The region where the resource exists.
revision str
The revision number of the secret version.
secret_id str
The ID of the secret associated with the version.
status str
The status of the secret version.
updated_at str
The date and time of the secret version's last update (in RFC 3339 format).
createdAt String
The date and time of the secret version's creation (in RFC 3339 format).
data Changes to this property will trigger replacement. String
The data payload of the secret version. Must not exceed 64KiB in size (e.g. my-secret-version-payload). Find out more on the data section.
description String
Description of the secret version (e.g. my-new-description).
region Changes to this property will trigger replacement. String
). The region where the resource exists.
revision String
The revision number of the secret version.
secretId String
The ID of the secret associated with the version.
status String
The status of the secret version.
updatedAt String
The date and time of the secret version's last update (in RFC 3339 format).

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

$ pulumi import scaleway:index/secretVersion:SecretVersion main fr-par/11111111-1111-1111-1111-111111111111/2
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.