1. Packages
  2. Packages
  3. Bitbucket Provider
  4. API Docs
  5. GpgKey
Viewing docs for bitbucket 2.52.0
published on Monday, Jul 20, 2026 by drfaust92
Viewing docs for bitbucket 2.52.0
published on Monday, Jul 20, 2026 by drfaust92

    Provides a Bitbucket GPG Key resource.

    This allows you to manage your GPG Keys for a user.

    • OAuth2 Scopes: account and account:write
    • API token permissions: read:gpg-key:bitbucket, write:gpg-key:bitbucket, and delete:gpg-key:bitbucket

    Create GpgKey Resource

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

    Constructor syntax

    new GpgKey(name: string, args: GpgKeyArgs, opts?: CustomResourceOptions);
    @overload
    def GpgKey(resource_name: str,
               args: GpgKeyArgs,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def GpgKey(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               key: Optional[str] = None,
               user: Optional[str] = None,
               gpg_key_id: Optional[str] = None,
               name: Optional[str] = None)
    func NewGpgKey(ctx *Context, name string, args GpgKeyArgs, opts ...ResourceOption) (*GpgKey, error)
    public GpgKey(string name, GpgKeyArgs args, CustomResourceOptions? opts = null)
    public GpgKey(String name, GpgKeyArgs args)
    public GpgKey(String name, GpgKeyArgs args, CustomResourceOptions options)
    
    type: bitbucket:GpgKey
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "bitbucket_gpg_key" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args GpgKeyArgs
    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 GpgKeyArgs
    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 GpgKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GpgKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GpgKeyArgs
    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 gpgKeyResource = new Bitbucket.GpgKey("gpgKeyResource", new()
    {
        Key = "string",
        User = "string",
        GpgKeyId = "string",
        Name = "string",
    });
    
    example, err := bitbucket.NewGpgKey(ctx, "gpgKeyResource", &bitbucket.GpgKeyArgs{
    	Key:      pulumi.String("string"),
    	User:     pulumi.String("string"),
    	GpgKeyId: pulumi.String("string"),
    	Name:     pulumi.String("string"),
    })
    
    resource "bitbucket_gpg_key" "gpgKeyResource" {
      lifecycle {
        create_before_destroy = true
      }
      key        = "string"
      user       = "string"
      gpg_key_id = "string"
      name       = "string"
    }
    
    var gpgKeyResource = new GpgKey("gpgKeyResource", GpgKeyArgs.builder()
        .key("string")
        .user("string")
        .gpgKeyId("string")
        .name("string")
        .build());
    
    gpg_key_resource = bitbucket.GpgKey("gpgKeyResource",
        key="string",
        user="string",
        gpg_key_id="string",
        name="string")
    
    const gpgKeyResource = new bitbucket.GpgKey("gpgKeyResource", {
        key: "string",
        user: "string",
        gpgKeyId: "string",
        name: "string",
    });
    
    type: bitbucket:GpgKey
    properties:
        gpgKeyId: string
        key: string
        name: string
        user: string
    

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

    Key string
    The GPG public key value in ASCII-armored format.
    User string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    GpgKeyId string
    Name string
    The user-defined label for the GPG key.
    Key string
    The GPG public key value in ASCII-armored format.
    User string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    GpgKeyId string
    Name string
    The user-defined label for the GPG key.
    key string
    The GPG public key value in ASCII-armored format.
    user string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    gpg_key_id string
    name string
    The user-defined label for the GPG key.
    key String
    The GPG public key value in ASCII-armored format.
    user String
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    gpgKeyId String
    name String
    The user-defined label for the GPG key.
    key string
    The GPG public key value in ASCII-armored format.
    user string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    gpgKeyId string
    name string
    The user-defined label for the GPG key.
    key str
    The GPG public key value in ASCII-armored format.
    user str
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    gpg_key_id str
    name str
    The user-defined label for the GPG key.
    key String
    The GPG public key value in ASCII-armored format.
    user String
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    gpgKeyId String
    name String
    The user-defined label for the GPG key.

    Outputs

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

    Fingerprint string
    The GPG key fingerprint.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The unique identifier for the GPG key.
    Fingerprint string
    The GPG key fingerprint.
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The unique identifier for the GPG key.
    fingerprint string
    The GPG key fingerprint.
    id string
    The provider-assigned unique ID for this managed resource.
    key_id string
    The unique identifier for the GPG key.
    fingerprint String
    The GPG key fingerprint.
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The unique identifier for the GPG key.
    fingerprint string
    The GPG key fingerprint.
    id string
    The provider-assigned unique ID for this managed resource.
    keyId string
    The unique identifier for the GPG key.
    fingerprint str
    The GPG key fingerprint.
    id str
    The provider-assigned unique ID for this managed resource.
    key_id str
    The unique identifier for the GPG key.
    fingerprint String
    The GPG key fingerprint.
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The unique identifier for the GPG key.

    Look up Existing GpgKey Resource

    Get an existing GpgKey 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?: GpgKeyState, opts?: CustomResourceOptions): GpgKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            fingerprint: Optional[str] = None,
            gpg_key_id: Optional[str] = None,
            key: Optional[str] = None,
            key_id: Optional[str] = None,
            name: Optional[str] = None,
            user: Optional[str] = None) -> GpgKey
    func GetGpgKey(ctx *Context, name string, id IDInput, state *GpgKeyState, opts ...ResourceOption) (*GpgKey, error)
    public static GpgKey Get(string name, Input<string> id, GpgKeyState? state, CustomResourceOptions? opts = null)
    public static GpgKey get(String name, Output<String> id, GpgKeyState state, CustomResourceOptions options)
    resources:  _:    type: bitbucket:GpgKey    get:      id: ${id}
    import {
      to = bitbucket_gpg_key.example
      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:
    Fingerprint string
    The GPG key fingerprint.
    GpgKeyId string
    Key string
    The GPG public key value in ASCII-armored format.
    KeyId string
    The unique identifier for the GPG key.
    Name string
    The user-defined label for the GPG key.
    User string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    Fingerprint string
    The GPG key fingerprint.
    GpgKeyId string
    Key string
    The GPG public key value in ASCII-armored format.
    KeyId string
    The unique identifier for the GPG key.
    Name string
    The user-defined label for the GPG key.
    User string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    fingerprint string
    The GPG key fingerprint.
    gpg_key_id string
    key string
    The GPG public key value in ASCII-armored format.
    key_id string
    The unique identifier for the GPG key.
    name string
    The user-defined label for the GPG key.
    user string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    fingerprint String
    The GPG key fingerprint.
    gpgKeyId String
    key String
    The GPG public key value in ASCII-armored format.
    keyId String
    The unique identifier for the GPG key.
    name String
    The user-defined label for the GPG key.
    user String
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    fingerprint string
    The GPG key fingerprint.
    gpgKeyId string
    key string
    The GPG public key value in ASCII-armored format.
    keyId string
    The unique identifier for the GPG key.
    name string
    The user-defined label for the GPG key.
    user string
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    fingerprint str
    The GPG key fingerprint.
    gpg_key_id str
    key str
    The GPG public key value in ASCII-armored format.
    key_id str
    The unique identifier for the GPG key.
    name str
    The user-defined label for the GPG key.
    user str
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.
    fingerprint String
    The GPG key fingerprint.
    gpgKeyId String
    key String
    The GPG public key value in ASCII-armored format.
    keyId String
    The unique identifier for the GPG key.
    name String
    The user-defined label for the GPG key.
    user String
    This can either be the UUID of the account, surrounded by curly-braces, for example: {account UUID}, OR an Atlassian Account ID.

    Import

    GPG Keys can be imported using their user/fingerprint ID, e.g.

    $ pulumi import bitbucket:index/gpgKey:GpgKey test user-id/fingerprint
    

    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.
    Viewing docs for bitbucket 2.52.0
    published on Monday, Jul 20, 2026 by drfaust92

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial