1. Packages
  2. Scaleway
  3. API Docs
  4. Secret
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

scaleway.Secret

Explore with Pulumi AI

scaleway logo
Scaleway v1.14.0 published on Thursday, Jun 6, 2024 by pulumiverse

    Creates and manages Scaleway Secrets. 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",
        ],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    main = scaleway.Secret("main",
        description="barr",
        tags=[
            "foo",
            "terraform",
        ])
    
    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 {
    		_, 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
    		}
    		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",
            },
        });
    
    });
    
    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 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());
    
        }
    }
    
    resources:
      main:
        type: scaleway:Secret
        properties:
          description: barr
          tags:
            - foo
            - terraform
    

    Create Secret Resource

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

    Constructor syntax

    new Secret(name: string, args?: SecretArgs, opts?: CustomResourceOptions);
    @overload
    def Secret(resource_name: str,
               args: Optional[SecretArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Secret(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               path: Optional[str] = None,
               project_id: Optional[str] = None,
               region: Optional[str] = None,
               tags: Optional[Sequence[str]] = None)
    func NewSecret(ctx *Context, name string, args *SecretArgs, opts ...ResourceOption) (*Secret, error)
    public Secret(string name, SecretArgs? args = null, CustomResourceOptions? opts = null)
    public Secret(String name, SecretArgs args)
    public Secret(String name, SecretArgs args, CustomResourceOptions options)
    
    type: scaleway:Secret
    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 SecretArgs
    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 SecretArgs
    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 SecretArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecretArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecretArgs
    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 secretResource = new Scaleway.Secret("secretResource", new()
    {
        Description = "string",
        Name = "string",
        Path = "string",
        ProjectId = "string",
        Region = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := scaleway.NewSecret(ctx, "secretResource", &scaleway.SecretArgs{
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Path:        pulumi.String("string"),
    	ProjectId:   pulumi.String("string"),
    	Region:      pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var secretResource = new Secret("secretResource", SecretArgs.builder()
        .description("string")
        .name("string")
        .path("string")
        .projectId("string")
        .region("string")
        .tags("string")
        .build());
    
    secret_resource = scaleway.Secret("secretResource",
        description="string",
        name="string",
        path="string",
        project_id="string",
        region="string",
        tags=["string"])
    
    const secretResource = new scaleway.Secret("secretResource", {
        description: "string",
        name: "string",
        path: "string",
        projectId: "string",
        region: "string",
        tags: ["string"],
    });
    
    type: scaleway:Secret
    properties:
        description: string
        name: string
        path: string
        projectId: string
        region: string
        tags:
            - string
    

    Secret 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 Secret resource accepts the following input properties:

    Description string
    Description of the secret (e.g. my-new-description).
    Name string
    Name of the secret (e.g. my-secret).
    Path string
    Path of the secret, defaults to /.
    ProjectId string
    The project ID containing is the secret.
    Region string
    region) The region in which the resource exists.
    Tags List<string>
    Tags of the secret (e.g. ["tag", "secret"]).
    Description string
    Description of the secret (e.g. my-new-description).
    Name string
    Name of the secret (e.g. my-secret).
    Path string
    Path of the secret, defaults to /.
    ProjectId string
    The project ID containing is the secret.
    Region string
    region) The region in which the resource exists.
    Tags []string
    Tags of the secret (e.g. ["tag", "secret"]).
    description String
    Description of the secret (e.g. my-new-description).
    name String
    Name of the secret (e.g. my-secret).
    path String
    Path of the secret, defaults to /.
    projectId String
    The project ID containing is the secret.
    region String
    region) The region in which the resource exists.
    tags List<String>
    Tags of the secret (e.g. ["tag", "secret"]).
    description string
    Description of the secret (e.g. my-new-description).
    name string
    Name of the secret (e.g. my-secret).
    path string
    Path of the secret, defaults to /.
    projectId string
    The project ID containing is the secret.
    region string
    region) The region in which the resource exists.
    tags string[]
    Tags of the secret (e.g. ["tag", "secret"]).
    description str
    Description of the secret (e.g. my-new-description).
    name str
    Name of the secret (e.g. my-secret).
    path str
    Path of the secret, defaults to /.
    project_id str
    The project ID containing is the secret.
    region str
    region) The region in which the resource exists.
    tags Sequence[str]
    Tags of the secret (e.g. ["tag", "secret"]).
    description String
    Description of the secret (e.g. my-new-description).
    name String
    Name of the secret (e.g. my-secret).
    path String
    Path of the secret, defaults to /.
    projectId String
    The project ID containing is the secret.
    region String
    region) The region in which the resource exists.
    tags List<String>
    Tags of the secret (e.g. ["tag", "secret"]).

    Outputs

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

    CreatedAt string
    Date and time of secret's creation (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Secret.
    UpdatedAt string
    Date and time of secret's last update (RFC 3339 format).
    VersionCount int
    The number of versions for this Secret.
    CreatedAt string
    Date and time of secret's creation (RFC 3339 format).
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the Secret.
    UpdatedAt string
    Date and time of secret's last update (RFC 3339 format).
    VersionCount int
    The number of versions for this Secret.
    createdAt String
    Date and time of secret's creation (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Secret.
    updatedAt String
    Date and time of secret's last update (RFC 3339 format).
    versionCount Integer
    The number of versions for this Secret.
    createdAt string
    Date and time of secret's creation (RFC 3339 format).
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the Secret.
    updatedAt string
    Date and time of secret's last update (RFC 3339 format).
    versionCount number
    The number of versions for this Secret.
    created_at str
    Date and time of secret's creation (RFC 3339 format).
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the Secret.
    updated_at str
    Date and time of secret's last update (RFC 3339 format).
    version_count int
    The number of versions for this Secret.
    createdAt String
    Date and time of secret's creation (RFC 3339 format).
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the Secret.
    updatedAt String
    Date and time of secret's last update (RFC 3339 format).
    versionCount Number
    The number of versions for this Secret.

    Look up Existing Secret Resource

    Get an existing Secret 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?: SecretState, opts?: CustomResourceOptions): Secret
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            path: Optional[str] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            updated_at: Optional[str] = None,
            version_count: Optional[int] = None) -> Secret
    func GetSecret(ctx *Context, name string, id IDInput, state *SecretState, opts ...ResourceOption) (*Secret, error)
    public static Secret Get(string name, Input<string> id, SecretState? state, CustomResourceOptions? opts = null)
    public static Secret get(String name, Output<String> id, SecretState 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's creation (RFC 3339 format).
    Description string
    Description of the secret (e.g. my-new-description).
    Name string
    Name of the secret (e.g. my-secret).
    Path string
    Path of the secret, defaults to /.
    ProjectId string
    The project ID containing is the secret.
    Region string
    region) The region in which the resource exists.
    Status string
    The status of the Secret.
    Tags List<string>
    Tags of the secret (e.g. ["tag", "secret"]).
    UpdatedAt string
    Date and time of secret's last update (RFC 3339 format).
    VersionCount int
    The number of versions for this Secret.
    CreatedAt string
    Date and time of secret's creation (RFC 3339 format).
    Description string
    Description of the secret (e.g. my-new-description).
    Name string
    Name of the secret (e.g. my-secret).
    Path string
    Path of the secret, defaults to /.
    ProjectId string
    The project ID containing is the secret.
    Region string
    region) The region in which the resource exists.
    Status string
    The status of the Secret.
    Tags []string
    Tags of the secret (e.g. ["tag", "secret"]).
    UpdatedAt string
    Date and time of secret's last update (RFC 3339 format).
    VersionCount int
    The number of versions for this Secret.
    createdAt String
    Date and time of secret's creation (RFC 3339 format).
    description String
    Description of the secret (e.g. my-new-description).
    name String
    Name of the secret (e.g. my-secret).
    path String
    Path of the secret, defaults to /.
    projectId String
    The project ID containing is the secret.
    region String
    region) The region in which the resource exists.
    status String
    The status of the Secret.
    tags List<String>
    Tags of the secret (e.g. ["tag", "secret"]).
    updatedAt String
    Date and time of secret's last update (RFC 3339 format).
    versionCount Integer
    The number of versions for this Secret.
    createdAt string
    Date and time of secret's creation (RFC 3339 format).
    description string
    Description of the secret (e.g. my-new-description).
    name string
    Name of the secret (e.g. my-secret).
    path string
    Path of the secret, defaults to /.
    projectId string
    The project ID containing is the secret.
    region string
    region) The region in which the resource exists.
    status string
    The status of the Secret.
    tags string[]
    Tags of the secret (e.g. ["tag", "secret"]).
    updatedAt string
    Date and time of secret's last update (RFC 3339 format).
    versionCount number
    The number of versions for this Secret.
    created_at str
    Date and time of secret's creation (RFC 3339 format).
    description str
    Description of the secret (e.g. my-new-description).
    name str
    Name of the secret (e.g. my-secret).
    path str
    Path of the secret, defaults to /.
    project_id str
    The project ID containing is the secret.
    region str
    region) The region in which the resource exists.
    status str
    The status of the Secret.
    tags Sequence[str]
    Tags of the secret (e.g. ["tag", "secret"]).
    updated_at str
    Date and time of secret's last update (RFC 3339 format).
    version_count int
    The number of versions for this Secret.
    createdAt String
    Date and time of secret's creation (RFC 3339 format).
    description String
    Description of the secret (e.g. my-new-description).
    name String
    Name of the secret (e.g. my-secret).
    path String
    Path of the secret, defaults to /.
    projectId String
    The project ID containing is the secret.
    region String
    region) The region in which the resource exists.
    status String
    The status of the Secret.
    tags List<String>
    Tags of the secret (e.g. ["tag", "secret"]).
    updatedAt String
    Date and time of secret's last update (RFC 3339 format).
    versionCount Number
    The number of versions for this Secret.

    Import

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

    bash

    $ pulumi import scaleway:index/secret:Secret main fr-par/11111111-1111-1111-1111-111111111111
    

    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.14.0 published on Thursday, Jun 6, 2024 by pulumiverse