artifactory.DistributionPublicKey
Explore with Pulumi AI
Provides an Artifactory Distribution Public Key resource. This can be used to create and manage Artifactory Distribution Public Keys.
See API description in the Artifactory documentation for more details. Also the UI documentation has further details on where to find these keys in Artifactory.
Example Usage
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;
return await Deployment.RunAsync(() =>
{
var my_key = new Artifactory.DistributionPublicKey("my-key", new()
{
Alias = "my-key",
PublicKey = File.ReadAllText("samples/rsa.pub"),
});
});
package main
import (
"os"
"github.com/pulumi/pulumi-artifactory/sdk/v4/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.NewDistributionPublicKey(ctx, "my-key", &artifactory.DistributionPublicKeyArgs{
Alias: pulumi.String("my-key"),
PublicKey: readFileOrPanic("samples/rsa.pub"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.DistributionPublicKey;
import com.pulumi.artifactory.DistributionPublicKeyArgs;
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 my_key = new DistributionPublicKey("my-key", DistributionPublicKeyArgs.builder()
.alias("my-key")
.publicKey(Files.readString(Paths.get("samples/rsa.pub")))
.build());
}
}
import pulumi
import pulumi_artifactory as artifactory
my_key = artifactory.DistributionPublicKey("my-key",
alias="my-key",
public_key=(lambda path: open(path).read())("samples/rsa.pub"))
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";
import * as fs from "fs";
const my_key = new artifactory.DistributionPublicKey("my-key", {
alias: "my-key",
publicKey: fs.readFileSync("samples/rsa.pub"),
});
resources:
my-key:
type: artifactory:DistributionPublicKey
properties:
alias: my-key
publicKey:
fn::readFile: samples/rsa.pub
Create DistributionPublicKey Resource
new DistributionPublicKey(name: string, args: DistributionPublicKeyArgs, opts?: CustomResourceOptions);
@overload
def DistributionPublicKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
public_key: Optional[str] = None)
@overload
def DistributionPublicKey(resource_name: str,
args: DistributionPublicKeyArgs,
opts: Optional[ResourceOptions] = None)
func NewDistributionPublicKey(ctx *Context, name string, args DistributionPublicKeyArgs, opts ...ResourceOption) (*DistributionPublicKey, error)
public DistributionPublicKey(string name, DistributionPublicKeyArgs args, CustomResourceOptions? opts = null)
public DistributionPublicKey(String name, DistributionPublicKeyArgs args)
public DistributionPublicKey(String name, DistributionPublicKeyArgs args, CustomResourceOptions options)
type: artifactory:DistributionPublicKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DistributionPublicKeyArgs
- 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 DistributionPublicKeyArgs
- 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 DistributionPublicKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DistributionPublicKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DistributionPublicKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
DistributionPublicKey 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 DistributionPublicKey resource accepts the following input properties:
- alias str
Will be used as an identifier when uploading/retrieving the public key via REST API.
- public_
key str The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
Outputs
All input properties are implicitly available as output properties. Additionally, the DistributionPublicKey resource produces the following output properties:
- Fingerprint string
Returns the computed key fingerprint
- Id string
The provider-assigned unique ID for this managed resource.
- Issued
By string Returns the name and eMail address of issuer
- Issued
On string Returns the date/time when this GPG key was created
- Key
Id string Returns the key id by which this key is referenced in Artifactory
- Valid
Until string Returns the date/time when this GPG key expires.
- Fingerprint string
Returns the computed key fingerprint
- Id string
The provider-assigned unique ID for this managed resource.
- Issued
By string Returns the name and eMail address of issuer
- Issued
On string Returns the date/time when this GPG key was created
- Key
Id string Returns the key id by which this key is referenced in Artifactory
- Valid
Until string Returns the date/time when this GPG key expires.
- fingerprint String
Returns the computed key fingerprint
- id String
The provider-assigned unique ID for this managed resource.
- issued
By String Returns the name and eMail address of issuer
- issued
On String Returns the date/time when this GPG key was created
- key
Id String Returns the key id by which this key is referenced in Artifactory
- valid
Until String Returns the date/time when this GPG key expires.
- fingerprint string
Returns the computed key fingerprint
- id string
The provider-assigned unique ID for this managed resource.
- issued
By string Returns the name and eMail address of issuer
- issued
On string Returns the date/time when this GPG key was created
- key
Id string Returns the key id by which this key is referenced in Artifactory
- valid
Until string Returns the date/time when this GPG key expires.
- fingerprint str
Returns the computed key fingerprint
- id str
The provider-assigned unique ID for this managed resource.
- issued_
by str Returns the name and eMail address of issuer
- issued_
on str Returns the date/time when this GPG key was created
- key_
id str Returns the key id by which this key is referenced in Artifactory
- valid_
until str Returns the date/time when this GPG key expires.
- fingerprint String
Returns the computed key fingerprint
- id String
The provider-assigned unique ID for this managed resource.
- issued
By String Returns the name and eMail address of issuer
- issued
On String Returns the date/time when this GPG key was created
- key
Id String Returns the key id by which this key is referenced in Artifactory
- valid
Until String Returns the date/time when this GPG key expires.
Look up Existing DistributionPublicKey Resource
Get an existing DistributionPublicKey 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?: DistributionPublicKeyState, opts?: CustomResourceOptions): DistributionPublicKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alias: Optional[str] = None,
fingerprint: Optional[str] = None,
issued_by: Optional[str] = None,
issued_on: Optional[str] = None,
key_id: Optional[str] = None,
public_key: Optional[str] = None,
valid_until: Optional[str] = None) -> DistributionPublicKey
func GetDistributionPublicKey(ctx *Context, name string, id IDInput, state *DistributionPublicKeyState, opts ...ResourceOption) (*DistributionPublicKey, error)
public static DistributionPublicKey Get(string name, Input<string> id, DistributionPublicKeyState? state, CustomResourceOptions? opts = null)
public static DistributionPublicKey get(String name, Output<String> id, DistributionPublicKeyState 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 an identifier when uploading/retrieving the public key via REST API.
- Fingerprint string
Returns the computed key fingerprint
- Issued
By string Returns the name and eMail address of issuer
- Issued
On string Returns the date/time when this GPG key was created
- Key
Id string Returns the key id by which this key is referenced in Artifactory
- Public
Key string The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- Valid
Until string Returns the date/time when this GPG key expires.
- Alias string
Will be used as an identifier when uploading/retrieving the public key via REST API.
- Fingerprint string
Returns the computed key fingerprint
- Issued
By string Returns the name and eMail address of issuer
- Issued
On string Returns the date/time when this GPG key was created
- Key
Id string Returns the key id by which this key is referenced in Artifactory
- Public
Key string The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- Valid
Until string Returns the date/time when this GPG key expires.
- alias String
Will be used as an identifier when uploading/retrieving the public key via REST API.
- fingerprint String
Returns the computed key fingerprint
- issued
By String Returns the name and eMail address of issuer
- issued
On String Returns the date/time when this GPG key was created
- key
Id String Returns the key id by which this key is referenced in Artifactory
- public
Key String The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- valid
Until String Returns the date/time when this GPG key expires.
- alias string
Will be used as an identifier when uploading/retrieving the public key via REST API.
- fingerprint string
Returns the computed key fingerprint
- issued
By string Returns the name and eMail address of issuer
- issued
On string Returns the date/time when this GPG key was created
- key
Id string Returns the key id by which this key is referenced in Artifactory
- public
Key string The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- valid
Until string Returns the date/time when this GPG key expires.
- alias str
Will be used as an identifier when uploading/retrieving the public key via REST API.
- fingerprint str
Returns the computed key fingerprint
- issued_
by str Returns the name and eMail address of issuer
- issued_
on str Returns the date/time when this GPG key was created
- key_
id str Returns the key id by which this key is referenced in Artifactory
- public_
key str The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- valid_
until str Returns the date/time when this GPG key expires.
- alias String
Will be used as an identifier when uploading/retrieving the public key via REST API.
- fingerprint String
Returns the computed key fingerprint
- issued
By String Returns the name and eMail address of issuer
- issued
On String Returns the date/time when this GPG key was created
- key
Id String Returns the key id by which this key is referenced in Artifactory
- public
Key String The Public key to add as a trusted distribution GPG key.
The following additional attributes are exported:
- valid
Until String Returns the date/time when this GPG key expires.
Import
Distribution Public Key can be imported using the key id, e.g.
$ pulumi import artifactory:index/distributionPublicKey:DistributionPublicKey my-key keyid
Package Details
- Repository
- artifactory pulumi/pulumi-artifactory
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
artifactory
Terraform Provider.