SshKeyArgs

data class SshKeyArgs(val body: Output<String>? = null, val serverId: Output<String>? = null, val userName: Output<String>? = null) : ConvertibleToJava<SshKeyArgs>

Provides a AWS Transfer User SSH Key resource.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.transfer.Server;
import com.pulumi.aws.transfer.ServerArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.transfer.User;
import com.pulumi.aws.transfer.UserArgs;
import com.pulumi.aws.transfer.SshKey;
import com.pulumi.aws.transfer.SshKeyArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
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) {
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.identityProviderType("SERVICE_MANAGED")
.tags(Map.of("NAME", "tf-acc-test-transfer-server"))
.build());
var exampleRole = new Role("exampleRole", RoleArgs.builder()
.assumeRolePolicy("""
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "transfer.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
""")
.build());
var exampleUser = new User("exampleUser", UserArgs.builder()
.serverId(exampleServer.id())
.userName("tftestuser")
.role(exampleRole.arn())
.tags(Map.of("NAME", "tftestuser"))
.build());
var exampleSshKey = new SshKey("exampleSshKey", SshKeyArgs.builder()
.serverId(exampleServer.id())
.userName(exampleUser.userName())
.body("... SSH key ...")
.build());
var exampleRolePolicy = new RolePolicy("exampleRolePolicy", RolePolicyArgs.builder()
.role(exampleRole.id())
.policy("""
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowFullAccesstoS3",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": "*"
}
]
}
""")
.build());
}
}

Import

Transfer SSH Public Key can be imported using the server_id and user_name and ssh_public_key_id separated by /.

$ pulumi import aws:transfer/sshKey:SshKey bar s-12345678/test-username/key-12345

Constructors

Link copied to clipboard
fun SshKeyArgs(body: Output<String>? = null, serverId: Output<String>? = null, userName: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): SshKeyArgs

Properties

Link copied to clipboard
val body: Output<String>? = null

The public key portion of an SSH key pair.

Link copied to clipboard
val serverId: Output<String>? = null

The Server ID of the Transfer Server (e.g., s-12345678)

Link copied to clipboard
val userName: Output<String>? = null

The name of the user account that is assigned to one or more servers.