1. Packages
  2. Bitwarden Provider
  3. API Docs
  4. getItemSshKey
bitwarden 0.14.0 published on Tuesday, Jun 17, 2025 by maxlaverse

bitwarden.getItemSshKey

Explore with Pulumi AI

bitwarden logo
bitwarden 0.14.0 published on Tuesday, Jun 17, 2025 by maxlaverse

    Use this data source to get information on an existing SSH key item.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitwarden from "@pulumi/bitwarden";
    import * as local from "@pulumi/local";
    
    const gitSshKey = bitwarden.getItemSshKey({
        search: "Git/SSH Key",
    });
    const idRsa = new local.index.Local_sensitive_file("idRsa", {
        filename: "id_rsa",
        filePermission: "600",
        content: data.bitwarden_item_ssh_key.id_rsa.private_key,
    });
    
    import pulumi
    import pulumi_bitwarden as bitwarden
    import pulumi_local as local
    
    git_ssh_key = bitwarden.get_item_ssh_key(search="Git/SSH Key")
    id_rsa = local.index.Local_sensitive_file("idRsa",
        filename=id_rsa,
        file_permission=600,
        content=data.bitwarden_item_ssh_key.id_rsa.private_key)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-local/sdk/go/local"
    	"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.LookupItemSshKey(ctx, &bitwarden.LookupItemSshKeyArgs{
    			Search: pulumi.StringRef("Git/SSH Key"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = local.NewLocal_sensitive_file(ctx, "idRsa", &local.Local_sensitive_fileArgs{
    			Filename:       "id_rsa",
    			FilePermission: "600",
    			Content:        data.Bitwarden_item_ssh_key.Id_rsa.Private_key,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Bitwarden = Pulumi.Bitwarden;
    using Local = Pulumi.Local;
    
    return await Deployment.RunAsync(() => 
    {
        var gitSshKey = Bitwarden.GetItemSshKey.Invoke(new()
        {
            Search = "Git/SSH Key",
        });
    
        var idRsa = new Local.Index.Local_sensitive_file("idRsa", new()
        {
            Filename = "id_rsa",
            FilePermission = "600",
            Content = data.Bitwarden_item_ssh_key.Id_rsa.Private_key,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitwarden.BitwardenFunctions;
    import com.pulumi.bitwarden.inputs.GetItemSshKeyArgs;
    import com.pulumi.local.local_sensitive_file;
    import com.pulumi.local.Local_sensitive_fileArgs;
    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) {
            final var gitSshKey = BitwardenFunctions.getItemSshKey(GetItemSshKeyArgs.builder()
                .search("Git/SSH Key")
                .build());
    
            var idRsa = new Local_sensitive_file("idRsa", Local_sensitive_fileArgs.builder()
                .filename("id_rsa")
                .filePermission("600")
                .content(data.bitwarden_item_ssh_key().id_rsa().private_key())
                .build());
    
        }
    }
    
    resources:
      idRsa:
        type: local:local_sensitive_file
        properties:
          filename: id_rsa
          filePermission: '600'
          content: ${data.bitwarden_item_ssh_key.id_rsa.private_key}
    variables:
      gitSshKey:
        fn::invoke:
          function: bitwarden:getItemSshKey
          arguments:
            search: Git/SSH Key
    

    Using getItemSshKey

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getItemSshKey(args: GetItemSshKeyArgs, opts?: InvokeOptions): Promise<GetItemSshKeyResult>
    function getItemSshKeyOutput(args: GetItemSshKeyOutputArgs, opts?: InvokeOptions): Output<GetItemSshKeyResult>
    def get_item_ssh_key(filter_collection_id: Optional[str] = None,
                         filter_folder_id: Optional[str] = None,
                         filter_organization_id: Optional[str] = None,
                         id: Optional[str] = None,
                         search: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetItemSshKeyResult
    def get_item_ssh_key_output(filter_collection_id: Optional[pulumi.Input[str]] = None,
                         filter_folder_id: Optional[pulumi.Input[str]] = None,
                         filter_organization_id: Optional[pulumi.Input[str]] = None,
                         id: Optional[pulumi.Input[str]] = None,
                         search: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetItemSshKeyResult]
    func LookupItemSshKey(ctx *Context, args *LookupItemSshKeyArgs, opts ...InvokeOption) (*LookupItemSshKeyResult, error)
    func LookupItemSshKeyOutput(ctx *Context, args *LookupItemSshKeyOutputArgs, opts ...InvokeOption) LookupItemSshKeyResultOutput

    > Note: This function is named LookupItemSshKey in the Go SDK.

    public static class GetItemSshKey 
    {
        public static Task<GetItemSshKeyResult> InvokeAsync(GetItemSshKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetItemSshKeyResult> Invoke(GetItemSshKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetItemSshKeyResult> getItemSshKey(GetItemSshKeyArgs args, InvokeOptions options)
    public static Output<GetItemSshKeyResult> getItemSshKey(GetItemSshKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: bitwarden:index/getItemSshKey:getItemSshKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    FilterCollectionId string
    Filter search results by collection ID.
    FilterFolderId string
    Filter search results by folder ID.
    FilterOrganizationId string
    Filter search results by organization ID.
    Id string
    Identifier.
    Search string
    Search items matching the search string.
    FilterCollectionId string
    Filter search results by collection ID.
    FilterFolderId string
    Filter search results by folder ID.
    FilterOrganizationId string
    Filter search results by organization ID.
    Id string
    Identifier.
    Search string
    Search items matching the search string.
    filterCollectionId String
    Filter search results by collection ID.
    filterFolderId String
    Filter search results by folder ID.
    filterOrganizationId String
    Filter search results by organization ID.
    id String
    Identifier.
    search String
    Search items matching the search string.
    filterCollectionId string
    Filter search results by collection ID.
    filterFolderId string
    Filter search results by folder ID.
    filterOrganizationId string
    Filter search results by organization ID.
    id string
    Identifier.
    search string
    Search items matching the search string.
    filter_collection_id str
    Filter search results by collection ID.
    filter_folder_id str
    Filter search results by folder ID.
    filter_organization_id str
    Filter search results by organization ID.
    id str
    Identifier.
    search str
    Search items matching the search string.
    filterCollectionId String
    Filter search results by collection ID.
    filterFolderId String
    Filter search results by folder ID.
    filterOrganizationId String
    Filter search results by organization ID.
    id String
    Identifier.
    search String
    Search items matching the search string.

    getItemSshKey Result

    The following output properties are available:

    CollectionIds List<string>
    Identifier of the collections the item belongs to.
    CreationDate string
    Date the item was created.
    DeletedDate string
    Date the item was deleted.
    Fields List<GetItemSshKeyField>
    Extra fields.
    FolderId string
    Identifier of the folder.
    KeyFingerprint string
    Key fingerprint.
    Name string
    Name.
    Notes string
    Notes.
    OrganizationId string
    Identifier of the organization.
    PrivateKey string
    Private key.
    PublicKey string
    Public key.
    Reprompt bool
    Require master password 're-prompt' when displaying secret in the UI.
    RevisionDate string
    Last time the item was updated.
    FilterCollectionId string
    Filter search results by collection ID.
    FilterFolderId string
    Filter search results by folder ID.
    FilterOrganizationId string
    Filter search results by organization ID.
    Id string
    Identifier.
    Search string
    Search items matching the search string.
    CollectionIds []string
    Identifier of the collections the item belongs to.
    CreationDate string
    Date the item was created.
    DeletedDate string
    Date the item was deleted.
    Fields []GetItemSshKeyField
    Extra fields.
    FolderId string
    Identifier of the folder.
    KeyFingerprint string
    Key fingerprint.
    Name string
    Name.
    Notes string
    Notes.
    OrganizationId string
    Identifier of the organization.
    PrivateKey string
    Private key.
    PublicKey string
    Public key.
    Reprompt bool
    Require master password 're-prompt' when displaying secret in the UI.
    RevisionDate string
    Last time the item was updated.
    FilterCollectionId string
    Filter search results by collection ID.
    FilterFolderId string
    Filter search results by folder ID.
    FilterOrganizationId string
    Filter search results by organization ID.
    Id string
    Identifier.
    Search string
    Search items matching the search string.
    collectionIds List<String>
    Identifier of the collections the item belongs to.
    creationDate String
    Date the item was created.
    deletedDate String
    Date the item was deleted.
    fields List<GetItemSshKeyField>
    Extra fields.
    folderId String
    Identifier of the folder.
    keyFingerprint String
    Key fingerprint.
    name String
    Name.
    notes String
    Notes.
    organizationId String
    Identifier of the organization.
    privateKey String
    Private key.
    publicKey String
    Public key.
    reprompt Boolean
    Require master password 're-prompt' when displaying secret in the UI.
    revisionDate String
    Last time the item was updated.
    filterCollectionId String
    Filter search results by collection ID.
    filterFolderId String
    Filter search results by folder ID.
    filterOrganizationId String
    Filter search results by organization ID.
    id String
    Identifier.
    search String
    Search items matching the search string.
    collectionIds string[]
    Identifier of the collections the item belongs to.
    creationDate string
    Date the item was created.
    deletedDate string
    Date the item was deleted.
    fields GetItemSshKeyField[]
    Extra fields.
    folderId string
    Identifier of the folder.
    keyFingerprint string
    Key fingerprint.
    name string
    Name.
    notes string
    Notes.
    organizationId string
    Identifier of the organization.
    privateKey string
    Private key.
    publicKey string
    Public key.
    reprompt boolean
    Require master password 're-prompt' when displaying secret in the UI.
    revisionDate string
    Last time the item was updated.
    filterCollectionId string
    Filter search results by collection ID.
    filterFolderId string
    Filter search results by folder ID.
    filterOrganizationId string
    Filter search results by organization ID.
    id string
    Identifier.
    search string
    Search items matching the search string.
    collection_ids Sequence[str]
    Identifier of the collections the item belongs to.
    creation_date str
    Date the item was created.
    deleted_date str
    Date the item was deleted.
    fields Sequence[GetItemSshKeyField]
    Extra fields.
    folder_id str
    Identifier of the folder.
    key_fingerprint str
    Key fingerprint.
    name str
    Name.
    notes str
    Notes.
    organization_id str
    Identifier of the organization.
    private_key str
    Private key.
    public_key str
    Public key.
    reprompt bool
    Require master password 're-prompt' when displaying secret in the UI.
    revision_date str
    Last time the item was updated.
    filter_collection_id str
    Filter search results by collection ID.
    filter_folder_id str
    Filter search results by folder ID.
    filter_organization_id str
    Filter search results by organization ID.
    id str
    Identifier.
    search str
    Search items matching the search string.
    collectionIds List<String>
    Identifier of the collections the item belongs to.
    creationDate String
    Date the item was created.
    deletedDate String
    Date the item was deleted.
    fields List<Property Map>
    Extra fields.
    folderId String
    Identifier of the folder.
    keyFingerprint String
    Key fingerprint.
    name String
    Name.
    notes String
    Notes.
    organizationId String
    Identifier of the organization.
    privateKey String
    Private key.
    publicKey String
    Public key.
    reprompt Boolean
    Require master password 're-prompt' when displaying secret in the UI.
    revisionDate String
    Last time the item was updated.
    filterCollectionId String
    Filter search results by collection ID.
    filterFolderId String
    Filter search results by folder ID.
    filterOrganizationId String
    Filter search results by organization ID.
    id String
    Identifier.
    search String
    Search items matching the search string.

    Supporting Types

    GetItemSshKeyField

    Boolean bool
    Hidden string
    Linked string
    Name string
    Text string
    Boolean bool
    Hidden string
    Linked string
    Name string
    Text string
    boolean_ Boolean
    hidden String
    linked String
    name String
    text String
    boolean boolean
    hidden string
    linked string
    name string
    text string
    boolean bool
    hidden str
    linked str
    name str
    text str
    boolean Boolean
    hidden String
    linked String
    name String
    text String

    Package Details

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