1. Packages
  2. Artifactory
  3. API Docs
  4. Keypair
artifactory v6.4.2 published on Thursday, Mar 28, 2024 by Pulumi

artifactory.Keypair

Explore with Pulumi AI

artifactory logo
artifactory v6.4.2 published on Thursday, Mar 28, 2024 by Pulumi

    RSA key pairs are used to sign and verify the Alpine Linux index files in JFrog Artifactory, while GPG key pairs are used to sign and validate packages integrity in JFrog Distribution. The JFrog Platform enables you to manage multiple RSA and GPG signing keys through the Keys Management UI and REST API. The JFrog Platform supports managing multiple pairs of GPG signing keys to sign packages for authentication of several package types such as Debian, Opkg, and RPM through the Keys Management UI and REST API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    import * as fs from "fs";
    
    const some_keypair_6543461672124900137 = new artifactory.Keypair("some-keypair-6543461672124900137", {
        pairName: "some-keypair-6543461672124900137",
        pairType: "RSA",
        alias: "some-alias-6543461672124900137",
        privateKey: fs.readFileSync("samples/rsa.priv", "utf8"),
        publicKey: fs.readFileSync("samples/rsa.pub", "utf8"),
        passphrase: "PASSPHRASE",
    });
    
    import pulumi
    import pulumi_artifactory as artifactory
    
    some_keypair_6543461672124900137 = artifactory.Keypair("some-keypair-6543461672124900137",
        pair_name="some-keypair-6543461672124900137",
        pair_type="RSA",
        alias="some-alias-6543461672124900137",
        private_key=(lambda path: open(path).read())("samples/rsa.priv"),
        public_key=(lambda path: open(path).read())("samples/rsa.pub"),
        passphrase="PASSPHRASE")
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := artifactory.NewKeypair(ctx, "some-keypair-6543461672124900137", &artifactory.KeypairArgs{
    			PairName:   pulumi.String("some-keypair-6543461672124900137"),
    			PairType:   pulumi.String("RSA"),
    			Alias:      pulumi.String("some-alias-6543461672124900137"),
    			PrivateKey: readFileOrPanic("samples/rsa.priv"),
    			PublicKey:  readFileOrPanic("samples/rsa.pub"),
    			Passphrase: pulumi.String("PASSPHRASE"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Artifactory = Pulumi.Artifactory;
    
    return await Deployment.RunAsync(() => 
    {
        var some_keypair_6543461672124900137 = new Artifactory.Keypair("some-keypair-6543461672124900137", new()
        {
            PairName = "some-keypair-6543461672124900137",
            PairType = "RSA",
            Alias = "some-alias-6543461672124900137",
            PrivateKey = File.ReadAllText("samples/rsa.priv"),
            PublicKey = File.ReadAllText("samples/rsa.pub"),
            Passphrase = "PASSPHRASE",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.Keypair;
    import com.pulumi.artifactory.KeypairArgs;
    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 some_keypair_6543461672124900137 = new Keypair("some-keypair-6543461672124900137", KeypairArgs.builder()        
                .pairName("some-keypair-6543461672124900137")
                .pairType("RSA")
                .alias("some-alias-6543461672124900137")
                .privateKey(Files.readString(Paths.get("samples/rsa.priv")))
                .publicKey(Files.readString(Paths.get("samples/rsa.pub")))
                .passphrase("PASSPHRASE")
                .build());
    
        }
    }
    
    resources:
      some-keypair-6543461672124900137:
        type: artifactory:Keypair
        properties:
          pairName: some-keypair-6543461672124900137
          pairType: RSA
          alias: some-alias-6543461672124900137
          privateKey:
            fn::readFile: samples/rsa.priv
          publicKey:
            fn::readFile: samples/rsa.pub
          passphrase: PASSPHRASE
    

    Create Keypair Resource

    new Keypair(name: string, args: KeypairArgs, opts?: CustomResourceOptions);
    @overload
    def Keypair(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                alias: Optional[str] = None,
                pair_name: Optional[str] = None,
                pair_type: Optional[str] = None,
                passphrase: Optional[str] = None,
                private_key: Optional[str] = None,
                public_key: Optional[str] = None)
    @overload
    def Keypair(resource_name: str,
                args: KeypairArgs,
                opts: Optional[ResourceOptions] = None)
    func NewKeypair(ctx *Context, name string, args KeypairArgs, opts ...ResourceOption) (*Keypair, error)
    public Keypair(string name, KeypairArgs args, CustomResourceOptions? opts = null)
    public Keypair(String name, KeypairArgs args)
    public Keypair(String name, KeypairArgs args, CustomResourceOptions options)
    
    type: artifactory:Keypair
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args KeypairArgs
    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 KeypairArgs
    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 KeypairArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeypairArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeypairArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Alias string
    Will be used as a filename when retrieving the public key via REST API.
    PairName string
    A unique identifier for the Key Pair record.
    PairType string
    Key Pair type. Supported types - GPG and RSA.
    PrivateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    PublicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    Passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    Alias string
    Will be used as a filename when retrieving the public key via REST API.
    PairName string
    A unique identifier for the Key Pair record.
    PairType string
    Key Pair type. Supported types - GPG and RSA.
    PrivateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    PublicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    Passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    alias String
    Will be used as a filename when retrieving the public key via REST API.
    pairName String
    A unique identifier for the Key Pair record.
    pairType String
    Key Pair type. Supported types - GPG and RSA.
    privateKey String
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey String

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    passphrase String
    Passphrase will be used to decrypt the private key. Validated server side.
    alias string
    Will be used as a filename when retrieving the public key via REST API.
    pairName string
    A unique identifier for the Key Pair record.
    pairType string
    Key Pair type. Supported types - GPG and RSA.
    privateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    alias str
    Will be used as a filename when retrieving the public key via REST API.
    pair_name str
    A unique identifier for the Key Pair record.
    pair_type str
    Key Pair type. Supported types - GPG and RSA.
    private_key str
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    public_key str

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    passphrase str
    Passphrase will be used to decrypt the private key. Validated server side.
    alias String
    Will be used as a filename when retrieving the public key via REST API.
    pairName String
    A unique identifier for the Key Pair record.
    pairType String
    Key Pair type. Supported types - GPG and RSA.
    privateKey String
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey String

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    passphrase String
    Passphrase will be used to decrypt the private key. Validated server side.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Keypair 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 Keypair Resource

    Get an existing Keypair 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?: KeypairState, opts?: CustomResourceOptions): Keypair
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alias: Optional[str] = None,
            pair_name: Optional[str] = None,
            pair_type: Optional[str] = None,
            passphrase: Optional[str] = None,
            private_key: Optional[str] = None,
            public_key: Optional[str] = None) -> Keypair
    func GetKeypair(ctx *Context, name string, id IDInput, state *KeypairState, opts ...ResourceOption) (*Keypair, error)
    public static Keypair Get(string name, Input<string> id, KeypairState? state, CustomResourceOptions? opts = null)
    public static Keypair get(String name, Output<String> id, KeypairState 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:
    Alias string
    Will be used as a filename when retrieving the public key via REST API.
    PairName string
    A unique identifier for the Key Pair record.
    PairType string
    Key Pair type. Supported types - GPG and RSA.
    Passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    PrivateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    PublicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    Alias string
    Will be used as a filename when retrieving the public key via REST API.
    PairName string
    A unique identifier for the Key Pair record.
    PairType string
    Key Pair type. Supported types - GPG and RSA.
    Passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    PrivateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    PublicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    alias String
    Will be used as a filename when retrieving the public key via REST API.
    pairName String
    A unique identifier for the Key Pair record.
    pairType String
    Key Pair type. Supported types - GPG and RSA.
    passphrase String
    Passphrase will be used to decrypt the private key. Validated server side.
    privateKey String
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey String

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    alias string
    Will be used as a filename when retrieving the public key via REST API.
    pairName string
    A unique identifier for the Key Pair record.
    pairType string
    Key Pair type. Supported types - GPG and RSA.
    passphrase string
    Passphrase will be used to decrypt the private key. Validated server side.
    privateKey string
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey string

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    alias str
    Will be used as a filename when retrieving the public key via REST API.
    pair_name str
    A unique identifier for the Key Pair record.
    pair_type str
    Key Pair type. Supported types - GPG and RSA.
    passphrase str
    Passphrase will be used to decrypt the private key. Validated server side.
    private_key str
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    public_key str

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    alias String
    Will be used as a filename when retrieving the public key via REST API.
    pairName String
    A unique identifier for the Key Pair record.
    pairType String
    Key Pair type. Supported types - GPG and RSA.
    passphrase String
    Passphrase will be used to decrypt the private key. Validated server side.
    privateKey String
    Private key. PEM format will be validated. Must not include extranous spaces or tabs.
    publicKey String

    Public key. PEM format will be validated. Must not include extranous spaces or tabs.

    Artifactory REST API call 'Get Key Pair' doesn't return attributes private_key and passphrase, but consumes these keys in the POST call.

    Import

    Keypair can be imported using the pair name, e.g.

    $ pulumi import artifactory:index/keypair:Keypair my-keypair my-keypair-name
    

    Package Details

    Repository
    artifactory pulumi/pulumi-artifactory
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the artifactory Terraform Provider.
    artifactory logo
    artifactory v6.4.2 published on Thursday, Mar 28, 2024 by Pulumi