artifactory.Keypair
Explore with Pulumi AI
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 std from "@pulumi/std";
const some_keypair_6543461672124900137 = new artifactory.Keypair("some-keypair-6543461672124900137", {
pairName: "some-keypair-6543461672124900137",
pairType: "RSA",
alias: "some-alias-6543461672124900137",
privateKey: std.file({
input: "samples/rsa.priv",
}).then(invoke => invoke.result),
publicKey: std.file({
input: "samples/rsa.pub",
}).then(invoke => invoke.result),
passphrase: "PASSPHRASE",
});
import pulumi
import pulumi_artifactory as artifactory
import pulumi_std as std
some_keypair_6543461672124900137 = artifactory.Keypair("some-keypair-6543461672124900137",
pair_name="some-keypair-6543461672124900137",
pair_type="RSA",
alias="some-alias-6543461672124900137",
private_key=std.file(input="samples/rsa.priv").result,
public_key=std.file(input="samples/rsa.pub").result,
passphrase="PASSPHRASE")
package main
import (
"github.com/pulumi/pulumi-artifactory/sdk/v8/go/artifactory"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "samples/rsa.priv",
}, nil)
if err != nil {
return err
}
invokeFile1, err := std.File(ctx, &std.FileArgs{
Input: "samples/rsa.pub",
}, nil)
if err != nil {
return err
}
_, 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: pulumi.String(invokeFile.Result),
PublicKey: pulumi.String(invokeFile1.Result),
Passphrase: pulumi.String("PASSPHRASE"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;
using Std = Pulumi.Std;
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 = Std.File.Invoke(new()
{
Input = "samples/rsa.priv",
}).Apply(invoke => invoke.Result),
PublicKey = Std.File.Invoke(new()
{
Input = "samples/rsa.pub",
}).Apply(invoke => invoke.Result),
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(StdFunctions.file(FileArgs.builder()
.input("samples/rsa.priv")
.build()).result())
.publicKey(StdFunctions.file(FileArgs.builder()
.input("samples/rsa.pub")
.build()).result())
.passphrase("PASSPHRASE")
.build());
}
}
resources:
some-keypair-6543461672124900137:
type: artifactory:Keypair
properties:
pairName: some-keypair-6543461672124900137
pairType: RSA
alias: some-alias-6543461672124900137
privateKey:
fn::invoke:
Function: std:file
Arguments:
input: samples/rsa.priv
Return: result
publicKey:
fn::invoke:
Function: std:file
Arguments:
input: samples/rsa.pub
Return: result
passphrase: PASSPHRASE
Create Keypair Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Keypair(name: string, args: KeypairArgs, opts?: CustomResourceOptions);
@overload
def Keypair(resource_name: str,
args: KeypairArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Keypair(resource_name: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
pair_name: Optional[str] = None,
pair_type: Optional[str] = None,
private_key: Optional[str] = None,
public_key: Optional[str] = None,
passphrase: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var keypairResource = new Artifactory.Keypair("keypairResource", new()
{
Alias = "string",
PairName = "string",
PairType = "string",
PrivateKey = "string",
PublicKey = "string",
Passphrase = "string",
});
example, err := artifactory.NewKeypair(ctx, "keypairResource", &artifactory.KeypairArgs{
Alias: pulumi.String("string"),
PairName: pulumi.String("string"),
PairType: pulumi.String("string"),
PrivateKey: pulumi.String("string"),
PublicKey: pulumi.String("string"),
Passphrase: pulumi.String("string"),
})
var keypairResource = new Keypair("keypairResource", KeypairArgs.builder()
.alias("string")
.pairName("string")
.pairType("string")
.privateKey("string")
.publicKey("string")
.passphrase("string")
.build());
keypair_resource = artifactory.Keypair("keypairResource",
alias="string",
pair_name="string",
pair_type="string",
private_key="string",
public_key="string",
passphrase="string")
const keypairResource = new artifactory.Keypair("keypairResource", {
alias: "string",
pairName: "string",
pairType: "string",
privateKey: "string",
publicKey: "string",
passphrase: "string",
});
type: artifactory:Keypair
properties:
alias: string
pairName: string
pairType: string
passphrase: string
privateKey: string
publicKey: string
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.
- Pair
Name string - A unique identifier for the Key Pair record.
- Pair
Type string - Key Pair type. Supported types - GPG and RSA.
- Private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- Public
Key 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
andpassphrase
, 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.
- Pair
Name string - A unique identifier for the Key Pair record.
- Pair
Type string - Key Pair type. Supported types - GPG and RSA.
- Private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- Public
Key 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
andpassphrase
, 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.
- pair
Name String - A unique identifier for the Key Pair record.
- pair
Type String - Key Pair type. Supported types - GPG and RSA.
- private
Key String - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, 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.
- pair
Name string - A unique identifier for the Key Pair record.
- pair
Type string - Key Pair type. Supported types - GPG and RSA.
- private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, 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
andpassphrase
, 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.
- pair
Name String - A unique identifier for the Key Pair record.
- pair
Type String - Key Pair type. Supported types - GPG and RSA.
- private
Key String - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, 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.
- Alias string
- Will be used as a filename when retrieving the public key via REST API.
- Pair
Name string - A unique identifier for the Key Pair record.
- Pair
Type string - Key Pair type. Supported types - GPG and RSA.
- Passphrase string
- Passphrase will be used to decrypt the private key. Validated server side.
- Private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- Public
Key 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
andpassphrase
, but consumes these keys in the POST call.
- Alias string
- Will be used as a filename when retrieving the public key via REST API.
- Pair
Name string - A unique identifier for the Key Pair record.
- Pair
Type string - Key Pair type. Supported types - GPG and RSA.
- Passphrase string
- Passphrase will be used to decrypt the private key. Validated server side.
- Private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- Public
Key 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
andpassphrase
, but consumes these keys in the POST call.
- alias String
- Will be used as a filename when retrieving the public key via REST API.
- pair
Name String - A unique identifier for the Key Pair record.
- pair
Type String - Key Pair type. Supported types - GPG and RSA.
- passphrase String
- Passphrase will be used to decrypt the private key. Validated server side.
- private
Key String - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, but consumes these keys in the POST call.
- alias string
- Will be used as a filename when retrieving the public key via REST API.
- pair
Name string - A unique identifier for the Key Pair record.
- pair
Type string - Key Pair type. Supported types - GPG and RSA.
- passphrase string
- Passphrase will be used to decrypt the private key. Validated server side.
- private
Key string - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, 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
andpassphrase
, but consumes these keys in the POST call.
- alias String
- Will be used as a filename when retrieving the public key via REST API.
- pair
Name String - A unique identifier for the Key Pair record.
- pair
Type String - Key Pair type. Supported types - GPG and RSA.
- passphrase String
- Passphrase will be used to decrypt the private key. Validated server side.
- private
Key String - Private key. PEM format will be validated. Must not include extranous spaces or tabs.
- public
Key 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
andpassphrase
, 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- artifactory pulumi/pulumi-artifactory
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
artifactory
Terraform Provider.