UNPKG

@pulumi/tls

Version:

A Pulumi package to create TLS resources in Pulumi programs.

76 lines 3.24 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getPublicKeyOutput = exports.getPublicKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Get a public key from a PEM-encoded private key. * * Use this data source to get the public key from a [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) or [OpenSSH PEM (RFC 4716)](https://datatracker.ietf.org/doc/html/rfc4716) formatted private key, for use in other resources. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as tls from "@pulumi/tls"; * * const ed25519_example = new tls.PrivateKey("ed25519-example", {algorithm: "ED25519"}); * // Public key loaded from a terraform-generated private key, using the PEM (RFC 1421) format * const privateKeyPem_example = tls.getPublicKeyOutput({ * privateKeyPem: ed25519_example.privateKeyPem, * }); * // Public key loaded from filesystem, using the Open SSH (RFC 4716) format * const privateKeyOpenssh_example = std.file({ * input: "~/.ssh/id_rsa_rfc4716", * }).then(invoke => tls.getPublicKey({ * privateKeyOpenssh: invoke.result, * })); * ``` */ function getPublicKey(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("tls:index/getPublicKey:getPublicKey", { "privateKeyOpenssh": args.privateKeyOpenssh, "privateKeyPem": args.privateKeyPem, }, opts); } exports.getPublicKey = getPublicKey; /** * Get a public key from a PEM-encoded private key. * * Use this data source to get the public key from a [PEM (RFC 1421)](https://datatracker.ietf.org/doc/html/rfc1421) or [OpenSSH PEM (RFC 4716)](https://datatracker.ietf.org/doc/html/rfc4716) formatted private key, for use in other resources. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as std from "@pulumi/std"; * import * as tls from "@pulumi/tls"; * * const ed25519_example = new tls.PrivateKey("ed25519-example", {algorithm: "ED25519"}); * // Public key loaded from a terraform-generated private key, using the PEM (RFC 1421) format * const privateKeyPem_example = tls.getPublicKeyOutput({ * privateKeyPem: ed25519_example.privateKeyPem, * }); * // Public key loaded from filesystem, using the Open SSH (RFC 4716) format * const privateKeyOpenssh_example = std.file({ * input: "~/.ssh/id_rsa_rfc4716", * }).then(invoke => tls.getPublicKey({ * privateKeyOpenssh: invoke.result, * })); * ``` */ function getPublicKeyOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("tls:index/getPublicKey:getPublicKey", { "privateKeyOpenssh": args.privateKeyOpenssh, "privateKeyPem": args.privateKeyPem, }, opts); } exports.getPublicKeyOutput = getPublicKeyOutput; //# sourceMappingURL=getPublicKey.js.map