1. Packages
  2. Nexus Provider
  3. API Docs
  4. getSecuritySsl
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

nexus.getSecuritySsl

Explore with Pulumi AI

nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

Use this data source to retrieve a SSL certificate from any Nexus-external hostvia Nexus. This resource does NOT retrieve a certificate from the Nexus truststore

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as nexus from "@pulumi/nexus";

const ldapCertSecuritySsl = nexus.getSecuritySsl({
    host: "google.de",
    port: 443,
});
// Import Cert into Nexus
const ldapCertSecuritySslTruststore = new nexus.SecuritySslTruststore("ldapCertSecuritySslTruststore", {pem: ldapCertSecuritySsl.then(ldapCertSecuritySsl => ldapCertSecuritySsl.pem)});
Copy
import pulumi
import pulumi_nexus as nexus

ldap_cert_security_ssl = nexus.get_security_ssl(host="google.de",
    port=443)
# Import Cert into Nexus
ldap_cert_security_ssl_truststore = nexus.SecuritySslTruststore("ldapCertSecuritySslTruststore", pem=ldap_cert_security_ssl.pem)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nexus/v2/nexus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ldapCertSecuritySsl, err := nexus.GetSecuritySsl(ctx, &nexus.GetSecuritySslArgs{
			Host: "google.de",
			Port: pulumi.Float64Ref(443),
		}, nil)
		if err != nil {
			return err
		}
		// Import Cert into Nexus
		_, err = nexus.NewSecuritySslTruststore(ctx, "ldapCertSecuritySslTruststore", &nexus.SecuritySslTruststoreArgs{
			Pem: pulumi.String(ldapCertSecuritySsl.Pem),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nexus = Pulumi.Nexus;

return await Deployment.RunAsync(() => 
{
    var ldapCertSecuritySsl = Nexus.GetSecuritySsl.Invoke(new()
    {
        Host = "google.de",
        Port = 443,
    });

    // Import Cert into Nexus
    var ldapCertSecuritySslTruststore = new Nexus.SecuritySslTruststore("ldapCertSecuritySslTruststore", new()
    {
        Pem = ldapCertSecuritySsl.Apply(getSecuritySslResult => getSecuritySslResult.Pem),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nexus.NexusFunctions;
import com.pulumi.nexus.inputs.GetSecuritySslArgs;
import com.pulumi.nexus.SecuritySslTruststore;
import com.pulumi.nexus.SecuritySslTruststoreArgs;
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) {
        final var ldapCertSecuritySsl = NexusFunctions.getSecuritySsl(GetSecuritySslArgs.builder()
            .host("google.de")
            .port(443)
            .build());

        // Import Cert into Nexus
        var ldapCertSecuritySslTruststore = new SecuritySslTruststore("ldapCertSecuritySslTruststore", SecuritySslTruststoreArgs.builder()
            .pem(ldapCertSecuritySsl.applyValue(getSecuritySslResult -> getSecuritySslResult.pem()))
            .build());

    }
}
Copy
resources:
  # Import Cert into Nexus
  ldapCertSecuritySslTruststore:
    type: nexus:SecuritySslTruststore
    properties:
      pem: ${ldapCertSecuritySsl.pem}
variables:
  ldapCertSecuritySsl:
    fn::invoke:
      function: nexus:getSecuritySsl
      arguments:
        host: google.de
        port: 443
Copy

Using getSecuritySsl

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getSecuritySsl(args: GetSecuritySslArgs, opts?: InvokeOptions): Promise<GetSecuritySslResult>
function getSecuritySslOutput(args: GetSecuritySslOutputArgs, opts?: InvokeOptions): Output<GetSecuritySslResult>
Copy
def get_security_ssl(host: Optional[str] = None,
                     port: Optional[float] = None,
                     opts: Optional[InvokeOptions] = None) -> GetSecuritySslResult
def get_security_ssl_output(host: Optional[pulumi.Input[str]] = None,
                     port: Optional[pulumi.Input[float]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetSecuritySslResult]
Copy
func GetSecuritySsl(ctx *Context, args *GetSecuritySslArgs, opts ...InvokeOption) (*GetSecuritySslResult, error)
func GetSecuritySslOutput(ctx *Context, args *GetSecuritySslOutputArgs, opts ...InvokeOption) GetSecuritySslResultOutput
Copy

> Note: This function is named GetSecuritySsl in the Go SDK.

public static class GetSecuritySsl 
{
    public static Task<GetSecuritySslResult> InvokeAsync(GetSecuritySslArgs args, InvokeOptions? opts = null)
    public static Output<GetSecuritySslResult> Invoke(GetSecuritySslInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSecuritySslResult> getSecuritySsl(GetSecuritySslArgs args, InvokeOptions options)
public static Output<GetSecuritySslResult> getSecuritySsl(GetSecuritySslArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: nexus:index/getSecuritySsl:getSecuritySsl
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Host This property is required. string
Hostname for looking up certificate
Port double
Port for looking up certificate
Host This property is required. string
Hostname for looking up certificate
Port float64
Port for looking up certificate
host This property is required. String
Hostname for looking up certificate
port Double
Port for looking up certificate
host This property is required. string
Hostname for looking up certificate
port number
Port for looking up certificate
host This property is required. str
Hostname for looking up certificate
port float
Port for looking up certificate
host This property is required. String
Hostname for looking up certificate
port Number
Port for looking up certificate

getSecuritySsl Result

The following output properties are available:

ExpiresOn double
expiresOn field of the retrieved cert
Fingerprint string
fingerprint field of the retrieved cert
Host string
Hostname for looking up certificate
Id string
Used to identify data source at nexus
IssuedOn double
issuedOn field of the retrieved cert
IssuerCommonName string
issuerCommonName field of the retrieved cert
IssuerOrganization string
issuerOrganization field of the retrieved cert
IssuerOrganizationUnit string
issuerOrganizationUnit field of the retrieved cert
Pem string
pem field of the retrieved cert
SerialNumber string
serialNumber field of the retrieved cert
SubjectCommonName string
subjectCommonName field of the retrieved cert
SubjectOrganization string
subjectOrganization field of the retrieved cert
SubjectOrganizationUnit string
subjectOrganizationUnit field of the retrieved cert
Port double
Port for looking up certificate
ExpiresOn float64
expiresOn field of the retrieved cert
Fingerprint string
fingerprint field of the retrieved cert
Host string
Hostname for looking up certificate
Id string
Used to identify data source at nexus
IssuedOn float64
issuedOn field of the retrieved cert
IssuerCommonName string
issuerCommonName field of the retrieved cert
IssuerOrganization string
issuerOrganization field of the retrieved cert
IssuerOrganizationUnit string
issuerOrganizationUnit field of the retrieved cert
Pem string
pem field of the retrieved cert
SerialNumber string
serialNumber field of the retrieved cert
SubjectCommonName string
subjectCommonName field of the retrieved cert
SubjectOrganization string
subjectOrganization field of the retrieved cert
SubjectOrganizationUnit string
subjectOrganizationUnit field of the retrieved cert
Port float64
Port for looking up certificate
expiresOn Double
expiresOn field of the retrieved cert
fingerprint String
fingerprint field of the retrieved cert
host String
Hostname for looking up certificate
id String
Used to identify data source at nexus
issuedOn Double
issuedOn field of the retrieved cert
issuerCommonName String
issuerCommonName field of the retrieved cert
issuerOrganization String
issuerOrganization field of the retrieved cert
issuerOrganizationUnit String
issuerOrganizationUnit field of the retrieved cert
pem String
pem field of the retrieved cert
serialNumber String
serialNumber field of the retrieved cert
subjectCommonName String
subjectCommonName field of the retrieved cert
subjectOrganization String
subjectOrganization field of the retrieved cert
subjectOrganizationUnit String
subjectOrganizationUnit field of the retrieved cert
port Double
Port for looking up certificate
expiresOn number
expiresOn field of the retrieved cert
fingerprint string
fingerprint field of the retrieved cert
host string
Hostname for looking up certificate
id string
Used to identify data source at nexus
issuedOn number
issuedOn field of the retrieved cert
issuerCommonName string
issuerCommonName field of the retrieved cert
issuerOrganization string
issuerOrganization field of the retrieved cert
issuerOrganizationUnit string
issuerOrganizationUnit field of the retrieved cert
pem string
pem field of the retrieved cert
serialNumber string
serialNumber field of the retrieved cert
subjectCommonName string
subjectCommonName field of the retrieved cert
subjectOrganization string
subjectOrganization field of the retrieved cert
subjectOrganizationUnit string
subjectOrganizationUnit field of the retrieved cert
port number
Port for looking up certificate
expires_on float
expiresOn field of the retrieved cert
fingerprint str
fingerprint field of the retrieved cert
host str
Hostname for looking up certificate
id str
Used to identify data source at nexus
issued_on float
issuedOn field of the retrieved cert
issuer_common_name str
issuerCommonName field of the retrieved cert
issuer_organization str
issuerOrganization field of the retrieved cert
issuer_organization_unit str
issuerOrganizationUnit field of the retrieved cert
pem str
pem field of the retrieved cert
serial_number str
serialNumber field of the retrieved cert
subject_common_name str
subjectCommonName field of the retrieved cert
subject_organization str
subjectOrganization field of the retrieved cert
subject_organization_unit str
subjectOrganizationUnit field of the retrieved cert
port float
Port for looking up certificate
expiresOn Number
expiresOn field of the retrieved cert
fingerprint String
fingerprint field of the retrieved cert
host String
Hostname for looking up certificate
id String
Used to identify data source at nexus
issuedOn Number
issuedOn field of the retrieved cert
issuerCommonName String
issuerCommonName field of the retrieved cert
issuerOrganization String
issuerOrganization field of the retrieved cert
issuerOrganizationUnit String
issuerOrganizationUnit field of the retrieved cert
pem String
pem field of the retrieved cert
serialNumber String
serialNumber field of the retrieved cert
subjectCommonName String
subjectCommonName field of the retrieved cert
subjectOrganization String
subjectOrganization field of the retrieved cert
subjectOrganizationUnit String
subjectOrganizationUnit field of the retrieved cert
port Number
Port for looking up certificate

Package Details

Repository
nexus datadrivers/terraform-provider-nexus
License
Notes
This Pulumi package is based on the nexus Terraform Provider.
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers