1. Packages
  2. Artifactory Provider
  3. API Docs
  4. DistributionPublicKey
artifactory v8.4.1 published on Monday, Nov 25, 2024 by Pulumi

artifactory.DistributionPublicKey

Explore with Pulumi AI

artifactory logo
artifactory v8.4.1 published on Monday, Nov 25, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    import * as std from "@pulumi/std";
    
    const my_key = new artifactory.DistributionPublicKey("my-key", {
        alias: "my-key",
        publicKey: std.file({
            input: "samples/rsa.pub",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_artifactory as artifactory
    import pulumi_std as std
    
    my_key = artifactory.DistributionPublicKey("my-key",
        alias="my-key",
        public_key=std.file(input="samples/rsa.pub").result)
    
    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.pub",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = artifactory.NewDistributionPublicKey(ctx, "my-key", &artifactory.DistributionPublicKeyArgs{
    			Alias:     pulumi.String("my-key"),
    			PublicKey: pulumi.String(invokeFile.Result),
    		})
    		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 my_key = new Artifactory.DistributionPublicKey("my-key", new()
        {
            Alias = "my-key",
            PublicKey = Std.File.Invoke(new()
            {
                Input = "samples/rsa.pub",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    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(StdFunctions.file(FileArgs.builder()
                    .input("samples/rsa.pub")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      my-key:
        type: artifactory:DistributionPublicKey
        properties:
          alias: my-key
          publicKey:
            fn::invoke:
              Function: std:file
              Arguments:
                input: samples/rsa.pub
              Return: result
    

    Create DistributionPublicKey Resource

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

    Constructor syntax

    new DistributionPublicKey(name: string, args: DistributionPublicKeyArgs, opts?: CustomResourceOptions);
    @overload
    def DistributionPublicKey(resource_name: str,
                              args: DistributionPublicKeyArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def DistributionPublicKey(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              alias: Optional[str] = None,
                              public_key: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var distributionPublicKeyResource = new Artifactory.DistributionPublicKey("distributionPublicKeyResource", new()
    {
        Alias = "string",
        PublicKey = "string",
    });
    
    example, err := artifactory.NewDistributionPublicKey(ctx, "distributionPublicKeyResource", &artifactory.DistributionPublicKeyArgs{
    	Alias:     pulumi.String("string"),
    	PublicKey: pulumi.String("string"),
    })
    
    var distributionPublicKeyResource = new DistributionPublicKey("distributionPublicKeyResource", DistributionPublicKeyArgs.builder()
        .alias("string")
        .publicKey("string")
        .build());
    
    distribution_public_key_resource = artifactory.DistributionPublicKey("distributionPublicKeyResource",
        alias="string",
        public_key="string")
    
    const distributionPublicKeyResource = new artifactory.DistributionPublicKey("distributionPublicKeyResource", {
        alias: "string",
        publicKey: "string",
    });
    
    type: artifactory:DistributionPublicKey
    properties:
        alias: string
        publicKey: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The DistributionPublicKey resource accepts the following input properties:

    Alias string
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    PublicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    Alias string
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    PublicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    alias String
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    publicKey String

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    alias string
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    publicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    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:

    alias String
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    publicKey String

    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.
    IssuedBy string
    Returns the name and eMail address of issuer
    IssuedOn string
    Returns the date/time when this GPG key was created
    KeyId string
    Returns the key id by which this key is referenced in Artifactory
    ValidUntil 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.
    IssuedBy string
    Returns the name and eMail address of issuer
    IssuedOn string
    Returns the date/time when this GPG key was created
    KeyId string
    Returns the key id by which this key is referenced in Artifactory
    ValidUntil 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.
    issuedBy String
    Returns the name and eMail address of issuer
    issuedOn String
    Returns the date/time when this GPG key was created
    keyId String
    Returns the key id by which this key is referenced in Artifactory
    validUntil 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.
    issuedBy string
    Returns the name and eMail address of issuer
    issuedOn string
    Returns the date/time when this GPG key was created
    keyId string
    Returns the key id by which this key is referenced in Artifactory
    validUntil 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.
    issuedBy String
    Returns the name and eMail address of issuer
    issuedOn String
    Returns the date/time when this GPG key was created
    keyId String
    Returns the key id by which this key is referenced in Artifactory
    validUntil 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.
    The following state arguments are supported:
    Alias string
    Will be used as an identifier when uploading/retrieving the public key via REST API.
    Fingerprint string
    Returns the computed key fingerprint
    IssuedBy string
    Returns the name and eMail address of issuer
    IssuedOn string
    Returns the date/time when this GPG key was created
    KeyId string
    Returns the key id by which this key is referenced in Artifactory
    PublicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    ValidUntil 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
    IssuedBy string
    Returns the name and eMail address of issuer
    IssuedOn string
    Returns the date/time when this GPG key was created
    KeyId string
    Returns the key id by which this key is referenced in Artifactory
    PublicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    ValidUntil 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
    issuedBy String
    Returns the name and eMail address of issuer
    issuedOn String
    Returns the date/time when this GPG key was created
    keyId String
    Returns the key id by which this key is referenced in Artifactory
    publicKey String

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    validUntil 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
    issuedBy string
    Returns the name and eMail address of issuer
    issuedOn string
    Returns the date/time when this GPG key was created
    keyId string
    Returns the key id by which this key is referenced in Artifactory
    publicKey string

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    validUntil 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
    issuedBy String
    Returns the name and eMail address of issuer
    issuedOn String
    Returns the date/time when this GPG key was created
    keyId String
    Returns the key id by which this key is referenced in Artifactory
    publicKey String

    The Public key to add as a trusted distribution GPG key.

    The following additional attributes are exported:

    validUntil 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
    

    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.
    artifactory logo
    artifactory v8.4.1 published on Monday, Nov 25, 2024 by Pulumi