@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
96 lines • 4.16 kB
JavaScript
;
// *** 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.HostKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a host key for a server. This is an [_additional server host key_](https://docs.aws.amazon.com/transfer/latest/userguide/server-host-key-add.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.transfer.HostKey("example", {
* serverId: exampleAwsTransferServer.id,
* description: "example additional host key",
* hostKeyBodyWo: "# Private key PEM.\n",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import host keys using the `server_id` and `host_key_id` separated by `,`. For example:
*
* ```sh
* $ pulumi import aws:transfer/hostKey:HostKey example s-12345678,key-12345
* ```
*/
class HostKey extends pulumi.CustomResource {
/**
* Get an existing HostKey resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new HostKey(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of HostKey. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === HostKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["hostKeyBody"] = state?.hostKeyBody;
resourceInputs["hostKeyBodyWo"] = state?.hostKeyBodyWo;
resourceInputs["hostKeyFingerprint"] = state?.hostKeyFingerprint;
resourceInputs["hostKeyId"] = state?.hostKeyId;
resourceInputs["region"] = state?.region;
resourceInputs["serverId"] = state?.serverId;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.serverId === undefined && !opts.urn) {
throw new Error("Missing required property 'serverId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["hostKeyBody"] = args?.hostKeyBody ? pulumi.secret(args.hostKeyBody) : undefined;
resourceInputs["hostKeyBodyWo"] = args?.hostKeyBodyWo ? pulumi.secret(args.hostKeyBodyWo) : undefined;
resourceInputs["region"] = args?.region;
resourceInputs["serverId"] = args?.serverId;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["hostKeyFingerprint"] = undefined /*out*/;
resourceInputs["hostKeyId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["hostKeyBody", "hostKeyBodyWo"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(HostKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.HostKey = HostKey;
/** @internal */
HostKey.__pulumiType = 'aws:transfer/hostKey:HostKey';
//# sourceMappingURL=hostKey.js.map