1. Packages
  2. GitHub
  3. API Docs
  4. UserGpgKey
GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi

github.UserGpgKey

Explore with Pulumi AI

github logo
GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi

    Provides a GitHub user’s GPG key resource.

    This resource allows you to add/remove GPG keys from your user account.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const example = new github.UserGpgKey("example", {armoredPublicKey: `-----BEGIN PGP PUBLIC KEY BLOCK-----
    ...
    -----END PGP PUBLIC KEY BLOCK-----`});
    
    import pulumi
    import pulumi_github as github
    
    example = github.UserGpgKey("example", armored_public_key="""-----BEGIN PGP PUBLIC KEY BLOCK-----
    ...
    -----END PGP PUBLIC KEY BLOCK-----""")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := github.NewUserGpgKey(ctx, "example", &github.UserGpgKeyArgs{
    			ArmoredPublicKey: pulumi.String("-----BEGIN PGP PUBLIC KEY BLOCK-----\n...\n-----END PGP PUBLIC KEY BLOCK-----"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Github.UserGpgKey("example", new()
        {
            ArmoredPublicKey = @"-----BEGIN PGP PUBLIC KEY BLOCK-----
    ...
    -----END PGP PUBLIC KEY BLOCK-----",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.UserGpgKey;
    import com.pulumi.github.UserGpgKeyArgs;
    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 UserGpgKey("example", UserGpgKeyArgs.builder()
                .armoredPublicKey("""
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    ...
    -----END PGP PUBLIC KEY BLOCK-----            """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: github:UserGpgKey
        properties:
          armoredPublicKey: |-
            -----BEGIN PGP PUBLIC KEY BLOCK-----
            ...
            -----END PGP PUBLIC KEY BLOCK-----        
    

    Create UserGpgKey Resource

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

    Constructor syntax

    new UserGpgKey(name: string, args: UserGpgKeyArgs, opts?: CustomResourceOptions);
    @overload
    def UserGpgKey(resource_name: str,
                   args: UserGpgKeyArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserGpgKey(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   armored_public_key: Optional[str] = None)
    func NewUserGpgKey(ctx *Context, name string, args UserGpgKeyArgs, opts ...ResourceOption) (*UserGpgKey, error)
    public UserGpgKey(string name, UserGpgKeyArgs args, CustomResourceOptions? opts = null)
    public UserGpgKey(String name, UserGpgKeyArgs args)
    public UserGpgKey(String name, UserGpgKeyArgs args, CustomResourceOptions options)
    
    type: github:UserGpgKey
    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 UserGpgKeyArgs
    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 UserGpgKeyArgs
    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 UserGpgKeyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserGpgKeyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserGpgKeyArgs
    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 userGpgKeyResource = new Github.UserGpgKey("userGpgKeyResource", new()
    {
        ArmoredPublicKey = "string",
    });
    
    example, err := github.NewUserGpgKey(ctx, "userGpgKeyResource", &github.UserGpgKeyArgs{
    	ArmoredPublicKey: pulumi.String("string"),
    })
    
    var userGpgKeyResource = new UserGpgKey("userGpgKeyResource", UserGpgKeyArgs.builder()
        .armoredPublicKey("string")
        .build());
    
    user_gpg_key_resource = github.UserGpgKey("userGpgKeyResource", armored_public_key="string")
    
    const userGpgKeyResource = new github.UserGpgKey("userGpgKeyResource", {armoredPublicKey: "string"});
    
    type: github:UserGpgKey
    properties:
        armoredPublicKey: string
    

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

    ArmoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    ArmoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    armoredPublicKey String
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    armoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    armored_public_key str
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    armoredPublicKey String
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.

    Outputs

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

    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    etag string
    id string
    The provider-assigned unique ID for this managed resource.
    keyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    etag str
    id str
    The provider-assigned unique ID for this managed resource.
    key_id str
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    keyId String
    The key ID of the GPG key, e.g. 3262EFF25BA0D270

    Look up Existing UserGpgKey Resource

    Get an existing UserGpgKey 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?: UserGpgKeyState, opts?: CustomResourceOptions): UserGpgKey
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            armored_public_key: Optional[str] = None,
            etag: Optional[str] = None,
            key_id: Optional[str] = None) -> UserGpgKey
    func GetUserGpgKey(ctx *Context, name string, id IDInput, state *UserGpgKeyState, opts ...ResourceOption) (*UserGpgKey, error)
    public static UserGpgKey Get(string name, Input<string> id, UserGpgKeyState? state, CustomResourceOptions? opts = null)
    public static UserGpgKey get(String name, Output<String> id, UserGpgKeyState 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:
    ArmoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    Etag string
    KeyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    ArmoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    Etag string
    KeyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    armoredPublicKey String
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    etag String
    keyId String
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    armoredPublicKey string
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    etag string
    keyId string
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    armored_public_key str
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    etag str
    key_id str
    The key ID of the GPG key, e.g. 3262EFF25BA0D270
    armoredPublicKey String
    Your public GPG key, generated in ASCII-armored format. See Generating a new GPG key for help on creating a GPG key.
    etag String
    keyId String
    The key ID of the GPG key, e.g. 3262EFF25BA0D270

    Import

    GPG keys are not importable due to the fact that API

    does not return previously uploaded GPG key.

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

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.3.0 published on Monday, Sep 16, 2024 by Pulumi