1. Packages
  2. Bitbucket Provider
  3. API Docs
  4. DeployKey
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

bitbucket.DeployKey

Explore with Pulumi AI

bitbucket logo
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

    Provides a Bitbucket Deploy Key resource.

    This allows you to manage your Deploy Keys for a repository.

    OAuth2 Scopes: repository and repository:admin

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitbucket from "@pulumi/bitbucket";
    
    const test = new bitbucket.DeployKey("test", {
        key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY",
        label: "test-key",
        repository: "example",
        workspace: "example",
    });
    
    import pulumi
    import pulumi_bitbucket as bitbucket
    
    test = bitbucket.DeployKey("test",
        key="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY",
        label="test-key",
        repository="example",
        workspace="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := bitbucket.NewDeployKey(ctx, "test", &bitbucket.DeployKeyArgs{
    			Key:        pulumi.String("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY"),
    			Label:      pulumi.String("test-key"),
    			Repository: pulumi.String("example"),
    			Workspace:  pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Bitbucket = Pulumi.Bitbucket;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Bitbucket.DeployKey("test", new()
        {
            Key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY",
            Label = "test-key",
            Repository = "example",
            Workspace = "example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitbucket.DeployKey;
    import com.pulumi.bitbucket.DeployKeyArgs;
    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 test = new DeployKey("test", DeployKeyArgs.builder()
                .key("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY")
                .label("test-key")
                .repository("example")
                .workspace("example")
                .build());
    
        }
    }
    
    resources:
      test:
        type: bitbucket:DeployKey
        properties:
          key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY
          label: test-key
          repository: example
          workspace: example
    

    Create DeployKey Resource

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

    Constructor syntax

    new DeployKey(name: string, args: DeployKeyArgs, opts?: CustomResourceOptions);
    @overload
    def DeployKey(resource_name: str,
                  args: DeployKeyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeployKey(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  repository: Optional[str] = None,
                  workspace: Optional[str] = None,
                  deploy_key_id: Optional[str] = None,
                  key: Optional[str] = None,
                  label: Optional[str] = None)
    func NewDeployKey(ctx *Context, name string, args DeployKeyArgs, opts ...ResourceOption) (*DeployKey, error)
    public DeployKey(string name, DeployKeyArgs args, CustomResourceOptions? opts = null)
    public DeployKey(String name, DeployKeyArgs args)
    public DeployKey(String name, DeployKeyArgs args, CustomResourceOptions options)
    
    type: bitbucket:DeployKey
    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 DeployKeyArgs
    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 DeployKeyArgs
    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 DeployKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeployKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeployKeyArgs
    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 deployKeyResource = new Bitbucket.DeployKey("deployKeyResource", new()
    {
        Repository = "string",
        Workspace = "string",
        DeployKeyId = "string",
        Key = "string",
        Label = "string",
    });
    
    example, err := bitbucket.NewDeployKey(ctx, "deployKeyResource", &bitbucket.DeployKeyArgs{
    	Repository:  pulumi.String("string"),
    	Workspace:   pulumi.String("string"),
    	DeployKeyId: pulumi.String("string"),
    	Key:         pulumi.String("string"),
    	Label:       pulumi.String("string"),
    })
    
    var deployKeyResource = new DeployKey("deployKeyResource", DeployKeyArgs.builder()
        .repository("string")
        .workspace("string")
        .deployKeyId("string")
        .key("string")
        .label("string")
        .build());
    
    deploy_key_resource = bitbucket.DeployKey("deployKeyResource",
        repository="string",
        workspace="string",
        deploy_key_id="string",
        key="string",
        label="string")
    
    const deployKeyResource = new bitbucket.DeployKey("deployKeyResource", {
        repository: "string",
        workspace: "string",
        deployKeyId: "string",
        key: "string",
        label: "string",
    });
    
    type: bitbucket:DeployKey
    properties:
        deployKeyId: string
        key: string
        label: string
        repository: string
        workspace: string
    

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

    Repository string
    The Repository to create deploy key in.
    Workspace string
    The Workspace where the repository resides.
    DeployKeyId string
    Key string
    The SSH public key value in OpenSSH format.
    Label string
    The user-defined label for the Deploy key
    Repository string
    The Repository to create deploy key in.
    Workspace string
    The Workspace where the repository resides.
    DeployKeyId string
    Key string
    The SSH public key value in OpenSSH format.
    Label string
    The user-defined label for the Deploy key
    repository String
    The Repository to create deploy key in.
    workspace String
    The Workspace where the repository resides.
    deployKeyId String
    key String
    The SSH public key value in OpenSSH format.
    label String
    The user-defined label for the Deploy key
    repository string
    The Repository to create deploy key in.
    workspace string
    The Workspace where the repository resides.
    deployKeyId string
    key string
    The SSH public key value in OpenSSH format.
    label string
    The user-defined label for the Deploy key
    repository str
    The Repository to create deploy key in.
    workspace str
    The Workspace where the repository resides.
    deploy_key_id str
    key str
    The SSH public key value in OpenSSH format.
    label str
    The user-defined label for the Deploy key
    repository String
    The Repository to create deploy key in.
    workspace String
    The Workspace where the repository resides.
    deployKeyId String
    key String
    The SSH public key value in OpenSSH format.
    label String
    The user-defined label for the Deploy key

    Outputs

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

    Comment string
    The comment parsed from the Deploy key (if present)
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The Deploy key's ID.
    Comment string
    The comment parsed from the Deploy key (if present)
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The Deploy key's ID.
    comment String
    The comment parsed from the Deploy key (if present)
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The Deploy key's ID.
    comment string
    The comment parsed from the Deploy key (if present)
    id string
    The provider-assigned unique ID for this managed resource.
    keyId string
    The Deploy key's ID.
    comment str
    The comment parsed from the Deploy key (if present)
    id str
    The provider-assigned unique ID for this managed resource.
    key_id str
    The Deploy key's ID.
    comment String
    The comment parsed from the Deploy key (if present)
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The Deploy key's ID.

    Look up Existing DeployKey Resource

    Get an existing DeployKey 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?: DeployKeyState, opts?: CustomResourceOptions): DeployKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            comment: Optional[str] = None,
            deploy_key_id: Optional[str] = None,
            key: Optional[str] = None,
            key_id: Optional[str] = None,
            label: Optional[str] = None,
            repository: Optional[str] = None,
            workspace: Optional[str] = None) -> DeployKey
    func GetDeployKey(ctx *Context, name string, id IDInput, state *DeployKeyState, opts ...ResourceOption) (*DeployKey, error)
    public static DeployKey Get(string name, Input<string> id, DeployKeyState? state, CustomResourceOptions? opts = null)
    public static DeployKey get(String name, Output<String> id, DeployKeyState state, CustomResourceOptions options)
    resources:  _:    type: bitbucket:DeployKey    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:
    Comment string
    The comment parsed from the Deploy key (if present)
    DeployKeyId string
    Key string
    The SSH public key value in OpenSSH format.
    KeyId string
    The Deploy key's ID.
    Label string
    The user-defined label for the Deploy key
    Repository string
    The Repository to create deploy key in.
    Workspace string
    The Workspace where the repository resides.
    Comment string
    The comment parsed from the Deploy key (if present)
    DeployKeyId string
    Key string
    The SSH public key value in OpenSSH format.
    KeyId string
    The Deploy key's ID.
    Label string
    The user-defined label for the Deploy key
    Repository string
    The Repository to create deploy key in.
    Workspace string
    The Workspace where the repository resides.
    comment String
    The comment parsed from the Deploy key (if present)
    deployKeyId String
    key String
    The SSH public key value in OpenSSH format.
    keyId String
    The Deploy key's ID.
    label String
    The user-defined label for the Deploy key
    repository String
    The Repository to create deploy key in.
    workspace String
    The Workspace where the repository resides.
    comment string
    The comment parsed from the Deploy key (if present)
    deployKeyId string
    key string
    The SSH public key value in OpenSSH format.
    keyId string
    The Deploy key's ID.
    label string
    The user-defined label for the Deploy key
    repository string
    The Repository to create deploy key in.
    workspace string
    The Workspace where the repository resides.
    comment str
    The comment parsed from the Deploy key (if present)
    deploy_key_id str
    key str
    The SSH public key value in OpenSSH format.
    key_id str
    The Deploy key's ID.
    label str
    The user-defined label for the Deploy key
    repository str
    The Repository to create deploy key in.
    workspace str
    The Workspace where the repository resides.
    comment String
    The comment parsed from the Deploy key (if present)
    deployKeyId String
    key String
    The SSH public key value in OpenSSH format.
    keyId String
    The Deploy key's ID.
    label String
    The user-defined label for the Deploy key
    repository String
    The Repository to create deploy key in.
    workspace String
    The Workspace where the repository resides.

    Import

    Deploy Keys can be imported using their workspace/repo-slug/key-id ID, e.g.

    $ pulumi import bitbucket:index/deployKey:DeployKey key workspace/repo-slug/key-id
    

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

    Package Details

    Repository
    bitbucket drfaust92/terraform-provider-bitbucket
    License
    Notes
    This Pulumi package is based on the bitbucket Terraform Provider.
    bitbucket logo
    bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92