1. Packages
  2. Scaleway
  3. API Docs
  4. SecretVersion
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

scaleway.SecretVersion

Explore with Pulumi AI

scaleway logo
Scaleway v1.12.1 published on Monday, Apr 15, 2024 by pulumiverse

    Creates and manages Scaleway Secret Versions. For more information, see the documentation.

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const main = new scaleway.Secret("main", {
        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",
        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{
    			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()
        {
            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()        
                .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:
          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.

    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

    The SecretVersion resource accepts the following input properties:

    Data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    SecretId string
    The Secret ID associated wit the secret version.
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    region) The region in which the resource exists.
    Data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    SecretId string
    The Secret ID associated wit the secret version.
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    region) The region in which the resource exists.
    data String
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    secretId String
    The Secret ID associated wit the secret version.
    description String
    Description of the secret version (e.g. my-new-description).
    region String
    region) The region in which the resource exists.
    data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    secretId string
    The Secret ID associated wit the secret version.
    description string
    Description of the secret version (e.g. my-new-description).
    region string
    region) The region in which the resource exists.
    data str
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    secret_id str
    The Secret ID associated wit the secret version.
    description str
    Description of the secret version (e.g. my-new-description).
    region str
    region) The region in which the resource exists.
    data String
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    secretId String
    The Secret ID associated wit the secret version.
    description String
    Description of the secret version (e.g. my-new-description).
    region String
    region) The region in which the resource exists.

    Outputs

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

    CreatedAt string
    Date and time of secret version's creation (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Revision string
    The revision for this Secret Version.
    Status string
    The status of the Secret Version.
    UpdatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    CreatedAt string
    Date and time of secret version's creation (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Revision string
    The revision for this Secret Version.
    Status string
    The status of the Secret Version.
    UpdatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    createdAt String
    Date and time of secret version's creation (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    revision String
    The revision for this Secret Version.
    status String
    The status of the Secret Version.
    updatedAt String
    Date and time of secret version's last update (RFC 3339 format).
    createdAt string
    Date and time of secret version's creation (RFC 3339 format).
    id string
    The provider-assigned unique ID for this managed resource.
    revision string
    The revision for this Secret Version.
    status string
    The status of the Secret Version.
    updatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    created_at str
    Date and time of secret version's creation (RFC 3339 format).
    id str
    The provider-assigned unique ID for this managed resource.
    revision str
    The revision for this Secret Version.
    status str
    The status of the Secret Version.
    updated_at str
    Date and time of secret version's last update (RFC 3339 format).
    createdAt String
    Date and time of secret version's creation (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    revision String
    The revision for this Secret Version.
    status String
    The status of the Secret Version.
    updatedAt String
    Date and time of secret version's last update (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
    Date and time of secret version's creation (RFC 3339 format).
    Data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    region) The region in which the resource exists.
    Revision string
    The revision for this Secret Version.
    SecretId string
    The Secret ID associated wit the secret version.
    Status string
    The status of the Secret Version.
    UpdatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    CreatedAt string
    Date and time of secret version's creation (RFC 3339 format).
    Data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    Description string
    Description of the secret version (e.g. my-new-description).
    Region string
    region) The region in which the resource exists.
    Revision string
    The revision for this Secret Version.
    SecretId string
    The Secret ID associated wit the secret version.
    Status string
    The status of the Secret Version.
    UpdatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    createdAt String
    Date and time of secret version's creation (RFC 3339 format).
    data String
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    description String
    Description of the secret version (e.g. my-new-description).
    region String
    region) The region in which the resource exists.
    revision String
    The revision for this Secret Version.
    secretId String
    The Secret ID associated wit the secret version.
    status String
    The status of the Secret Version.
    updatedAt String
    Date and time of secret version's last update (RFC 3339 format).
    createdAt string
    Date and time of secret version's creation (RFC 3339 format).
    data string
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    description string
    Description of the secret version (e.g. my-new-description).
    region string
    region) The region in which the resource exists.
    revision string
    The revision for this Secret Version.
    secretId string
    The Secret ID associated wit the secret version.
    status string
    The status of the Secret Version.
    updatedAt string
    Date and time of secret version's last update (RFC 3339 format).
    created_at str
    Date and time of secret version's creation (RFC 3339 format).
    data str
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    description str
    Description of the secret version (e.g. my-new-description).
    region str
    region) The region in which the resource exists.
    revision str
    The revision for this Secret Version.
    secret_id str
    The Secret ID associated wit the secret version.
    status str
    The status of the Secret Version.
    updated_at str
    Date and time of secret version's last update (RFC 3339 format).
    createdAt String
    Date and time of secret version's creation (RFC 3339 format).
    data String
    The data payload of the secret version. Must be no larger than 64KiB. (e.g. my-secret-version-payload). more on the data section
    description String
    Description of the secret version (e.g. my-new-description).
    region String
    region) The region in which the resource exists.
    revision String
    The revision for this Secret Version.
    secretId String
    The Secret ID associated wit the secret version.
    status String
    The status of the Secret Version.
    updatedAt String
    Date and time of secret version's last update (RFC 3339 format).

    Import

    The Secret Version can be imported using the {region}/{id}/{revision}, e.g.

    ~> Important: Be aware if you import with revision latest you will overwrite the version you used before.

    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.12.1 published on Monday, Apr 15, 2024 by pulumiverse