1. Packages
  2. Bitwarden Provider
  3. API Docs
  4. Secret
bitwarden 0.13.6 published on Thursday, Apr 17, 2025 by maxlaverse

bitwarden.Secret

Explore with Pulumi AI

bitwarden logo
bitwarden 0.13.6 published on Thursday, Apr 17, 2025 by maxlaverse

    Manages a secret.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitwarden from "@pulumi/bitwarden";
    
    const example = new bitwarden.Secret("example", {
        key: "DB_ACCESS_KEY_ID",
        note: "This is the main account",
        projectId: "59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15",
        value: "2oOXi4GXtJ3JAkhgBmmBuA==",
    });
    
    import pulumi
    import pulumi_bitwarden as bitwarden
    
    example = bitwarden.Secret("example",
        key="DB_ACCESS_KEY_ID",
        note="This is the main account",
        project_id="59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15",
        value="2oOXi4GXtJ3JAkhgBmmBuA==")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitwarden/bitwarden"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bitwarden.NewSecret(ctx, "example", &bitwarden.SecretArgs{
    			Key:       pulumi.String("DB_ACCESS_KEY_ID"),
    			Note:      pulumi.String("This is the main account"),
    			ProjectId: pulumi.String("59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15"),
    			Value:     pulumi.String("2oOXi4GXtJ3JAkhgBmmBuA=="),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Bitwarden = Pulumi.Bitwarden;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Bitwarden.Secret("example", new()
        {
            Key = "DB_ACCESS_KEY_ID",
            Note = "This is the main account",
            ProjectId = "59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15",
            Value = "2oOXi4GXtJ3JAkhgBmmBuA==",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitwarden.Secret;
    import com.pulumi.bitwarden.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 example = new Secret("example", SecretArgs.builder()
                .key("DB_ACCESS_KEY_ID")
                .note("This is the main account")
                .projectId("59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15")
                .value("2oOXi4GXtJ3JAkhgBmmBuA==")
                .build());
    
        }
    }
    
    resources:
      example:
        type: bitwarden:Secret
        properties:
          key: DB_ACCESS_KEY_ID
          note: This is the main account
          projectId: 59f5d6eb-1f17-4ebb-a6c2-b1fc01355b15
          value: 2oOXi4GXtJ3JAkhgBmmBuA==
    

    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: SecretArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def Secret(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               key: Optional[str] = None,
               note: Optional[str] = None,
               project_id: Optional[str] = None,
               value: Optional[str] = None,
               organization_id: Optional[str] = None,
               secret_id: Optional[str] = None)
    func NewSecret(ctx *Context, name string, args SecretArgs, opts ...ResourceOption) (*Secret, error)
    public Secret(string name, SecretArgs args, CustomResourceOptions? opts = null)
    public Secret(String name, SecretArgs args)
    public Secret(String name, SecretArgs args, CustomResourceOptions options)
    
    type: bitwarden: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 Bitwarden.Secret("secretResource", new()
    {
        Key = "string",
        Note = "string",
        ProjectId = "string",
        Value = "string",
        OrganizationId = "string",
        SecretId = "string",
    });
    
    example, err := bitwarden.NewSecret(ctx, "secretResource", &bitwarden.SecretArgs{
    	Key:            pulumi.String("string"),
    	Note:           pulumi.String("string"),
    	ProjectId:      pulumi.String("string"),
    	Value:          pulumi.String("string"),
    	OrganizationId: pulumi.String("string"),
    	SecretId:       pulumi.String("string"),
    })
    
    var secretResource = new Secret("secretResource", SecretArgs.builder()
        .key("string")
        .note("string")
        .projectId("string")
        .value("string")
        .organizationId("string")
        .secretId("string")
        .build());
    
    secret_resource = bitwarden.Secret("secretResource",
        key="string",
        note="string",
        project_id="string",
        value="string",
        organization_id="string",
        secret_id="string")
    
    const secretResource = new bitwarden.Secret("secretResource", {
        key: "string",
        note: "string",
        projectId: "string",
        value: "string",
        organizationId: "string",
        secretId: "string",
    });
    
    type: bitwarden:Secret
    properties:
        key: string
        note: string
        organizationId: string
        projectId: string
        secretId: string
        value: 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

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

    The Secret resource accepts the following input properties:

    Key string
    Name.
    Note string
    Note.
    ProjectId string
    Identifier of the project.
    Value string
    Value.
    OrganizationId string
    Identifier of the organization.
    SecretId string
    Identifier.
    Key string
    Name.
    Note string
    Note.
    ProjectId string
    Identifier of the project.
    Value string
    Value.
    OrganizationId string
    Identifier of the organization.
    SecretId string
    Identifier.
    key String
    Name.
    note String
    Note.
    projectId String
    Identifier of the project.
    value String
    Value.
    organizationId String
    Identifier of the organization.
    secretId String
    Identifier.
    key string
    Name.
    note string
    Note.
    projectId string
    Identifier of the project.
    value string
    Value.
    organizationId string
    Identifier of the organization.
    secretId string
    Identifier.
    key str
    Name.
    note str
    Note.
    project_id str
    Identifier of the project.
    value str
    Value.
    organization_id str
    Identifier of the organization.
    secret_id str
    Identifier.
    key String
    Name.
    note String
    Note.
    projectId String
    Identifier of the project.
    value String
    Value.
    organizationId String
    Identifier of the organization.
    secretId String
    Identifier.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    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,
            key: Optional[str] = None,
            note: Optional[str] = None,
            organization_id: Optional[str] = None,
            project_id: Optional[str] = None,
            secret_id: Optional[str] = None,
            value: Optional[str] = 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)
    resources:  _:    type: bitwarden:Secret    get:      id: ${id}
    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:
    Key string
    Name.
    Note string
    Note.
    OrganizationId string
    Identifier of the organization.
    ProjectId string
    Identifier of the project.
    SecretId string
    Identifier.
    Value string
    Value.
    Key string
    Name.
    Note string
    Note.
    OrganizationId string
    Identifier of the organization.
    ProjectId string
    Identifier of the project.
    SecretId string
    Identifier.
    Value string
    Value.
    key String
    Name.
    note String
    Note.
    organizationId String
    Identifier of the organization.
    projectId String
    Identifier of the project.
    secretId String
    Identifier.
    value String
    Value.
    key string
    Name.
    note string
    Note.
    organizationId string
    Identifier of the organization.
    projectId string
    Identifier of the project.
    secretId string
    Identifier.
    value string
    Value.
    key str
    Name.
    note str
    Note.
    organization_id str
    Identifier of the organization.
    project_id str
    Identifier of the project.
    secret_id str
    Identifier.
    value str
    Value.
    key String
    Name.
    note String
    Note.
    organizationId String
    Identifier of the organization.
    projectId String
    Identifier of the project.
    secretId String
    Identifier.
    value String
    Value.

    Import

    $ pulumi import bitwarden:index/secret:Secret example <secret_id>
    

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

    Package Details

    Repository
    bitwarden maxlaverse/terraform-provider-bitwarden
    License
    Notes
    This Pulumi package is based on the bitwarden Terraform Provider.
    bitwarden logo
    bitwarden 0.13.6 published on Thursday, Apr 17, 2025 by maxlaverse