1. Packages
  2. Artifactory
  3. API Docs
  4. Certificate
artifactory v7.2.0 published on Wednesday, Jul 17, 2024 by Pulumi

artifactory.Certificate

Explore with Pulumi AI

artifactory logo
artifactory v7.2.0 published on Wednesday, Jul 17, 2024 by Pulumi

    Provides an Artifactory certificate resource. This can be used to create and manage Artifactory certificates which can be used as client authentication against remote repositories.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    import * as std from "@pulumi/std";
    
    // Create a new Artifactory certificate called my-cert
    const my_cert = new artifactory.Certificate("my-cert", {
        alias: "my-cert",
        content: std.file({
            input: "/path/to/bundle.pem",
        }).then(invoke => invoke.result),
    });
    // This can then be used by a remote repository
    const my_remote = new artifactory.RemoteMavenRepository("my-remote", {clientTlsCertificate: my_cert.alias});
    
    import pulumi
    import pulumi_artifactory as artifactory
    import pulumi_std as std
    
    # Create a new Artifactory certificate called my-cert
    my_cert = artifactory.Certificate("my-cert",
        alias="my-cert",
        content=std.file(input="/path/to/bundle.pem").result)
    # This can then be used by a remote repository
    my_remote = artifactory.RemoteMavenRepository("my-remote", client_tls_certificate=my_cert.alias)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-artifactory/sdk/v7/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: "/path/to/bundle.pem",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create a new Artifactory certificate called my-cert
    		_, err = artifactory.NewCertificate(ctx, "my-cert", &artifactory.CertificateArgs{
    			Alias:   pulumi.String("my-cert"),
    			Content: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		// This can then be used by a remote repository
    		_, err = artifactory.NewRemoteMavenRepository(ctx, "my-remote", &artifactory.RemoteMavenRepositoryArgs{
    			ClientTlsCertificate: my_cert.Alias,
    		})
    		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(() => 
    {
        // Create a new Artifactory certificate called my-cert
        var my_cert = new Artifactory.Certificate("my-cert", new()
        {
            Alias = "my-cert",
            Content = Std.File.Invoke(new()
            {
                Input = "/path/to/bundle.pem",
            }).Apply(invoke => invoke.Result),
        });
    
        // This can then be used by a remote repository
        var my_remote = new Artifactory.RemoteMavenRepository("my-remote", new()
        {
            ClientTlsCertificate = my_cert.Alias,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.Certificate;
    import com.pulumi.artifactory.CertificateArgs;
    import com.pulumi.artifactory.RemoteMavenRepository;
    import com.pulumi.artifactory.RemoteMavenRepositoryArgs;
    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) {
            // Create a new Artifactory certificate called my-cert
            var my_cert = new Certificate("my-cert", CertificateArgs.builder()
                .alias("my-cert")
                .content(StdFunctions.file(FileArgs.builder()
                    .input("/path/to/bundle.pem")
                    .build()).result())
                .build());
    
            // This can then be used by a remote repository
            var my_remote = new RemoteMavenRepository("my-remote", RemoteMavenRepositoryArgs.builder()
                .clientTlsCertificate(my_cert.alias())
                .build());
    
        }
    }
    
    resources:
      # Create a new Artifactory certificate called my-cert
      my-cert:
        type: artifactory:Certificate
        properties:
          alias: my-cert
          content:
            fn::invoke:
              Function: std:file
              Arguments:
                input: /path/to/bundle.pem
              Return: result
      # This can then be used by a remote repository
      my-remote:
        type: artifactory:RemoteMavenRepository
        properties:
          clientTlsCertificate: ${["my-cert"].alias}
    

    Create Certificate Resource

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

    Constructor syntax

    new Certificate(name: string, args: CertificateArgs, opts?: CustomResourceOptions);
    @overload
    def Certificate(resource_name: str,
                    args: CertificateArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def Certificate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    alias: Optional[str] = None,
                    content: Optional[str] = None,
                    file: Optional[str] = None)
    func NewCertificate(ctx *Context, name string, args CertificateArgs, opts ...ResourceOption) (*Certificate, error)
    public Certificate(string name, CertificateArgs args, CustomResourceOptions? opts = null)
    public Certificate(String name, CertificateArgs args)
    public Certificate(String name, CertificateArgs args, CustomResourceOptions options)
    
    type: artifactory:Certificate
    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 CertificateArgs
    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 CertificateArgs
    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 CertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateArgs
    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 certificateResource = new Artifactory.Certificate("certificateResource", new()
    {
        Alias = "string",
        Content = "string",
        File = "string",
    });
    
    example, err := artifactory.NewCertificate(ctx, "certificateResource", &artifactory.CertificateArgs{
    	Alias:   pulumi.String("string"),
    	Content: pulumi.String("string"),
    	File:    pulumi.String("string"),
    })
    
    var certificateResource = new Certificate("certificateResource", CertificateArgs.builder()
        .alias("string")
        .content("string")
        .file("string")
        .build());
    
    certificate_resource = artifactory.Certificate("certificateResource",
        alias="string",
        content="string",
        file="string")
    
    const certificateResource = new artifactory.Certificate("certificateResource", {
        alias: "string",
        content: "string",
        file: "string",
    });
    
    type: artifactory:Certificate
    properties:
        alias: string
        content: string
        file: string
    

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

    Alias string
    Name of certificate.
    Content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    File string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    Alias string
    Name of certificate.
    Content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    File string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    alias String
    Name of certificate.
    content String
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file String
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    alias string
    Name of certificate.
    content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    alias str
    Name of certificate.
    content str
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file str
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    alias String
    Name of certificate.
    content String
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file String
    Path to the PEM file. Cannot be set with content attribute simultaneously.

    Outputs

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

    Fingerprint string
    SHA256 fingerprint of the certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    IssuedBy string
    Name of the certificate authority that issued the certificate.
    IssuedOn string
    The time & date when the certificate is valid from.
    IssuedTo string
    Name of whom the certificate has been issued to.
    ValidUntil string
    The time & date when the certificate expires.
    Fingerprint string
    SHA256 fingerprint of the certificate.
    Id string
    The provider-assigned unique ID for this managed resource.
    IssuedBy string
    Name of the certificate authority that issued the certificate.
    IssuedOn string
    The time & date when the certificate is valid from.
    IssuedTo string
    Name of whom the certificate has been issued to.
    ValidUntil string
    The time & date when the certificate expires.
    fingerprint String
    SHA256 fingerprint of the certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    issuedBy String
    Name of the certificate authority that issued the certificate.
    issuedOn String
    The time & date when the certificate is valid from.
    issuedTo String
    Name of whom the certificate has been issued to.
    validUntil String
    The time & date when the certificate expires.
    fingerprint string
    SHA256 fingerprint of the certificate.
    id string
    The provider-assigned unique ID for this managed resource.
    issuedBy string
    Name of the certificate authority that issued the certificate.
    issuedOn string
    The time & date when the certificate is valid from.
    issuedTo string
    Name of whom the certificate has been issued to.
    validUntil string
    The time & date when the certificate expires.
    fingerprint str
    SHA256 fingerprint of the certificate.
    id str
    The provider-assigned unique ID for this managed resource.
    issued_by str
    Name of the certificate authority that issued the certificate.
    issued_on str
    The time & date when the certificate is valid from.
    issued_to str
    Name of whom the certificate has been issued to.
    valid_until str
    The time & date when the certificate expires.
    fingerprint String
    SHA256 fingerprint of the certificate.
    id String
    The provider-assigned unique ID for this managed resource.
    issuedBy String
    Name of the certificate authority that issued the certificate.
    issuedOn String
    The time & date when the certificate is valid from.
    issuedTo String
    Name of whom the certificate has been issued to.
    validUntil String
    The time & date when the certificate expires.

    Look up Existing Certificate Resource

    Get an existing Certificate 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?: CertificateState, opts?: CustomResourceOptions): Certificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alias: Optional[str] = None,
            content: Optional[str] = None,
            file: Optional[str] = None,
            fingerprint: Optional[str] = None,
            issued_by: Optional[str] = None,
            issued_on: Optional[str] = None,
            issued_to: Optional[str] = None,
            valid_until: Optional[str] = None) -> Certificate
    func GetCertificate(ctx *Context, name string, id IDInput, state *CertificateState, opts ...ResourceOption) (*Certificate, error)
    public static Certificate Get(string name, Input<string> id, CertificateState? state, CustomResourceOptions? opts = null)
    public static Certificate get(String name, Output<String> id, CertificateState 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
    Name of certificate.
    Content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    File string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    Fingerprint string
    SHA256 fingerprint of the certificate.
    IssuedBy string
    Name of the certificate authority that issued the certificate.
    IssuedOn string
    The time & date when the certificate is valid from.
    IssuedTo string
    Name of whom the certificate has been issued to.
    ValidUntil string
    The time & date when the certificate expires.
    Alias string
    Name of certificate.
    Content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    File string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    Fingerprint string
    SHA256 fingerprint of the certificate.
    IssuedBy string
    Name of the certificate authority that issued the certificate.
    IssuedOn string
    The time & date when the certificate is valid from.
    IssuedTo string
    Name of whom the certificate has been issued to.
    ValidUntil string
    The time & date when the certificate expires.
    alias String
    Name of certificate.
    content String
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file String
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    fingerprint String
    SHA256 fingerprint of the certificate.
    issuedBy String
    Name of the certificate authority that issued the certificate.
    issuedOn String
    The time & date when the certificate is valid from.
    issuedTo String
    Name of whom the certificate has been issued to.
    validUntil String
    The time & date when the certificate expires.
    alias string
    Name of certificate.
    content string
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file string
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    fingerprint string
    SHA256 fingerprint of the certificate.
    issuedBy string
    Name of the certificate authority that issued the certificate.
    issuedOn string
    The time & date when the certificate is valid from.
    issuedTo string
    Name of whom the certificate has been issued to.
    validUntil string
    The time & date when the certificate expires.
    alias str
    Name of certificate.
    content str
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file str
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    fingerprint str
    SHA256 fingerprint of the certificate.
    issued_by str
    Name of the certificate authority that issued the certificate.
    issued_on str
    The time & date when the certificate is valid from.
    issued_to str
    Name of whom the certificate has been issued to.
    valid_until str
    The time & date when the certificate expires.
    alias String
    Name of certificate.
    content String
    PEM-encoded client certificate and private key. Cannot be set with file attribute simultaneously.
    file String
    Path to the PEM file. Cannot be set with content attribute simultaneously.
    fingerprint String
    SHA256 fingerprint of the certificate.
    issuedBy String
    Name of the certificate authority that issued the certificate.
    issuedOn String
    The time & date when the certificate is valid from.
    issuedTo String
    Name of whom the certificate has been issued to.
    validUntil String
    The time & date when the certificate expires.

    Import

    Certificates can be imported using their alias, e.g.

    $ pulumi import artifactory:index/certificate:Certificate my-cert my-cert
    

    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 v7.2.0 published on Wednesday, Jul 17, 2024 by Pulumi