UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

160 lines (159 loc) 5.63 kB
import * as pulumi from "@pulumi/pulumi"; /** * Provides a AWS Transfer User SSH Key resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as std from "@pulumi/std"; * import * as tls from "@pulumi/tls"; * * const examplePrivateKey = new tls.index.PrivateKey("example", { * algorithm: "RSA", * rsaBits: 4096, * }); * const exampleServer = new aws.transfer.Server("example", { * identityProviderType: "SERVICE_MANAGED", * tags: { * NAME: "tf-acc-test-transfer-server", * }, * }); * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["transfer.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const exampleRole = new aws.iam.Role("example", { * name: "tf-test-transfer-user-iam-role", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const exampleUser = new aws.transfer.User("example", { * serverId: exampleServer.id, * userName: "tftestuser", * role: exampleRole.arn, * tags: { * NAME: "tftestuser", * }, * }); * const exampleSshKey = new aws.transfer.SshKey("example", { * serverId: exampleServer.id, * userName: exampleUser.userName, * body: std.trimspace({ * input: examplePrivateKey.publicKeyOpenssh, * }).then(invoke => invoke.result), * }); * const example = aws.iam.getPolicyDocument({ * statements: [{ * sid: "AllowFullAccesstoS3", * effect: "Allow", * actions: ["s3:*"], * resources: ["*"], * }], * }); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * name: "tf-test-transfer-user-iam-policy", * role: exampleRole.id, * policy: example.then(example => example.json), * }); * ``` * * ## Import * * Using `pulumi import`, import Transfer SSH Public Key using the `server_id` and `user_name` and `ssh_public_key_id` separated by `/`. For example: * * ```sh * $ pulumi import aws:transfer/sshKey:SshKey bar s-12345678/test-username/key-12345 * ``` */ export declare class SshKey extends pulumi.CustomResource { /** * Get an existing SshKey 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: string, id: pulumi.Input<pulumi.ID>, state?: SshKeyState, opts?: pulumi.CustomResourceOptions): SshKey; /** * Returns true if the given object is an instance of SshKey. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is SshKey; /** * The public key portion of an SSH key pair. */ readonly body: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * The Server ID of the Transfer Server (e.g., `s-12345678`) */ readonly serverId: pulumi.Output<string>; readonly sshKeyId: pulumi.Output<string>; /** * The name of the user account that is assigned to one or more servers. */ readonly userName: pulumi.Output<string>; /** * Create a SshKey resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: SshKeyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SshKey resources. */ export interface SshKeyState { /** * The public key portion of an SSH key pair. */ body?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * The Server ID of the Transfer Server (e.g., `s-12345678`) */ serverId?: pulumi.Input<string>; sshKeyId?: pulumi.Input<string>; /** * The name of the user account that is assigned to one or more servers. */ userName?: pulumi.Input<string>; } /** * The set of arguments for constructing a SshKey resource. */ export interface SshKeyArgs { /** * The public key portion of an SSH key pair. */ body: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * The Server ID of the Transfer Server (e.g., `s-12345678`) */ serverId: pulumi.Input<string>; /** * The name of the user account that is assigned to one or more servers. */ userName: pulumi.Input<string>; }