1. Packages
  2. Scaleway
  3. API Docs
  4. SecretVersion
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.SecretVersion

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    The scaleway.SecretVersion 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.Secret("main", {
        name: "foo",
        description: "barr",
        tags: [
            "foo",
            "terraform",
        ],
    });
    const v1 = new scaleway.SecretVersion("v1", {
        description: "version1",
        secretId: main.id,
        data: "my_new_secret",
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.Secret("main",
        name="foo",
        description="barr",
        tags=[
            "foo",
            "terraform",
        ])
    v1 = scaleway.SecretVersion("v1",
        description="version1",
        secret_id=main.id,
        data="my_new_secret")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := scaleway.NewSecret(ctx, "main", &scaleway.SecretArgs{
    			Name:        pulumi.String("foo"),
    			Description: pulumi.String("barr"),
    			Tags: pulumi.StringArray{
    				pulumi.String("foo"),
    				pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.NewSecretVersion(ctx, "v1", &scaleway.SecretVersionArgs{
    			Description: pulumi.String("version1"),
    			SecretId:    main.ID(),
    			Data:        pulumi.String("my_new_secret"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Scaleway.Secret("main", new()
        {
            Name = "foo",
            Description = "barr",
            Tags = new[]
            {
                "foo",
                "terraform",
            },
        });
    
        var v1 = new Scaleway.SecretVersion("v1", new()
        {
            Description = "version1",
            SecretId = main.Id,
            Data = "my_new_secret",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.Secret;
    import com.pulumi.scaleway.SecretArgs;
    import com.pulumi.scaleway.SecretVersion;
    import com.pulumi.scaleway.SecretVersionArgs;
    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 SecretVersion("v1", SecretVersionArgs.builder()
                .description("version1")
                .secretId(main.id())
                .data("my_new_secret")
                .build());
    
        }
    }
    
    resources:
      main:
        type: scaleway:Secret
        properties:
          name: foo
          description: barr
          tags:
            - foo
            - terraform
      v1:
        type: scaleway:SecretVersion
        properties:
          description: version1
          secretId: ${main.id}
          data: my_new_secret
    

    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: SecretVersionArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecretVersion(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      data: Optional[str] = None,
                      secret_id: Optional[str] = None,
                      description: Optional[str] = None,
                      region: 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 string
    The unique name of the resource.
    args SecretVersionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SecretVersionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SecretVersionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretVersionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretVersionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var secretVersionResource = new Scaleway.SecretVersion("secretVersionResource", new()
    {
        Data = "string",
        SecretId = "string",
        Description = "string",
        Region = "string",
    });
    
    example, err := scaleway.NewSecretVersion(ctx, "secretVersionResource", &scaleway.SecretVersionArgs{
    	Data:        pulumi.String("string"),
    	SecretId:    pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Region:      pulumi.String("string"),
    })
    
    var secretVersionResource = new SecretVersion("secretVersionResource", SecretVersionArgs.builder()
        .data("string")
        .secretId("string")
        .description("string")
        .region("string")
        .build());
    
    secret_version_resource = scaleway.SecretVersion("secretVersionResource",
        data="string",
        secret_id="string",
        description="string",
        region="string")
    
    const secretVersionResource = new scaleway.SecretVersion("secretVersionResource", {
        data: "string",
        secretId: "string",
        description: "string",
        region: "string",
    });
    
    type: scaleway:SecretVersion
    properties:
        data: string
        description: string
        region: string
        secretId: string
    

    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 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 string
    The ID of the secret associated with the version.
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    ). The region where the resource exists.
    Data 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 string
    The ID of the secret associated with the version.
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    ). The region where the resource exists.
    data 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 String
    The ID of the secret associated with the version.
    description String
    Description of the secret version (e.g. my-new-description).
    region String
    ). The region where the resource exists.
    data 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 string
    The ID of the secret associated with the version.
    description string
    Description of the secret version (e.g. my-new-description).
    region string
    ). The region where the resource exists.
    data 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 str
    The ID of the secret associated with the version.
    description str
    Description of the secret version (e.g. my-new-description).
    region str
    ). The region where the resource exists.
    data 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 String
    The ID of the secret associated with the version.
    description String
    Description of the secret version (e.g. my-new-description).
    region 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 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 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 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 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 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 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 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 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 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 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 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 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
    

    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.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse