Class SshKey
Provides a AWS Transfer User SSH Key resource.
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fooServer = new Aws.Transfer.Server("fooServer", new Aws.Transfer.ServerArgs
{
IdentityProviderType = "SERVICE_MANAGED",
Tags =
{
{ "NAME", "tf-acc-test-transfer-server" },
},
});
var fooRole = new Aws.Iam.Role("fooRole", new Aws.Iam.RoleArgs
{
AssumeRolePolicy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Effect"": ""Allow"",
""Principal"": {
""Service"": ""transfer.amazonaws.com""
},
""Action"": ""sts:AssumeRole""
}
]
}
",
});
var fooRolePolicy = new Aws.Iam.RolePolicy("fooRolePolicy", new Aws.Iam.RolePolicyArgs
{
Policy = @"{
""Version"": ""2012-10-17"",
""Statement"": [
{
""Sid"": ""AllowFullAccesstoS3"",
""Effect"": ""Allow"",
""Action"": [
""s3:*""
],
""Resource"": ""*""
}
]
}
",
Role = fooRole.Id,
});
var fooUser = new Aws.Transfer.User("fooUser", new Aws.Transfer.UserArgs
{
Role = fooRole.Arn,
ServerId = fooServer.Id,
Tags =
{
{ "NAME", "tftestuser" },
},
UserName = "tftestuser",
});
var fooSshKey = new Aws.Transfer.SshKey("fooSshKey", new Aws.Transfer.SshKeyArgs
{
Body = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 example@example.com",
ServerId = fooServer.Id,
UserName = fooUser.UserName,
});
}
}
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Transfer
Assembly: Pulumi.Aws.dll
Syntax
public class SshKey : CustomResource
Constructors
View SourceSshKey(String, SshKeyArgs, CustomResourceOptions)
Create a SshKey resource with the given unique name, arguments, and options.
Declaration
public SshKey(string name, SshKeyArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| SshKeyArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBody
The public key portion of an SSH key pair.
Declaration
public Output<string> Body { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ServerId
The Server ID of the Transfer Server (e.g. s-12345678)
Declaration
public Output<string> ServerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
UserName
The name of the user account that is assigned to one or more servers.
Declaration
public Output<string> UserName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, SshKeyState, CustomResourceOptions)
Get an existing SshKey resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static SshKey Get(string name, Input<string> id, SshKeyState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| SshKeyState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| SshKey |