1. Packages
  2. Artifactory Provider
  3. API Docs
  4. Certificate
artifactory v8.8.1 published on Wednesday, Apr 9, 2025 by Pulumi

artifactory.Certificate

Explore with Pulumi AI

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});
Copy
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)
Copy
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: "/path/to/bundle.pem",
		}, nil)
		if err != nil {
			return err
		}
		// Create a new Artifactory certificate called my-cert
		my_cert, err := artifactory.NewCertificate(ctx, "my-cert", &artifactory.CertificateArgs{
			Alias:   pulumi.String("my-cert"),
			Content: pulumi.String(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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
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}
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CertificateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := artifactory.NewCertificate(ctx, "certificateResource", &artifactory.CertificateArgs{
	Alias:   pulumi.String("string"),
	Content: pulumi.String("string"),
	File:    pulumi.String("string"),
})
Copy
var certificateResource = new Certificate("certificateResource", CertificateArgs.builder()
    .alias("string")
    .content("string")
    .file("string")
    .build());
Copy
certificate_resource = artifactory.Certificate("certificateResource",
    alias="string",
    content="string",
    file="string")
Copy
const certificateResource = new artifactory.Certificate("certificateResource", {
    alias: "string",
    content: "string",
    file: "string",
});
Copy
type: artifactory:Certificate
properties:
    alias: string
    content: string
    file: string
Copy

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

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

The Certificate resource accepts the following input properties:

Alias This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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)
resources:  _:    type: artifactory:Certificate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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
Copy

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.