aws.transfer.HostKey
Manages a host key for a server. This is an additional server host key.
Example Usage
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 pulumi
import pulumi_aws as aws
example = aws.transfer.HostKey("example",
server_id=example_aws_transfer_server["id"],
description="example additional host key",
host_key_body_wo="# Private key PEM.\n")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/transfer"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := transfer.NewHostKey(ctx, "example", &transfer.HostKeyArgs{
ServerId: pulumi.Any(exampleAwsTransferServer.Id),
Description: pulumi.String("example additional host key"),
HostKeyBodyWo: pulumi.String("# Private key PEM.\n"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Transfer.HostKey("example", new()
{
ServerId = exampleAwsTransferServer.Id,
Description = "example additional host key",
HostKeyBodyWo = @"# Private key PEM.
",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.transfer.HostKey;
import com.pulumi.aws.transfer.HostKeyArgs;
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 example = new HostKey("example", HostKeyArgs.builder()
.serverId(exampleAwsTransferServer.id())
.description("example additional host key")
.hostKeyBodyWo("""
# Private key PEM.
""")
.build());
}
}
resources:
example:
type: aws:transfer:HostKey
properties:
serverId: ${exampleAwsTransferServer.id}
description: example additional host key
hostKeyBodyWo: |
# Private key PEM.
Create HostKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HostKey(name: string, args: HostKeyArgs, opts?: CustomResourceOptions);@overload
def HostKey(resource_name: str,
args: HostKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HostKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
server_id: Optional[str] = None,
description: Optional[str] = None,
host_key_body: Optional[str] = None,
host_key_body_wo: Optional[str] = None,
region: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)func NewHostKey(ctx *Context, name string, args HostKeyArgs, opts ...ResourceOption) (*HostKey, error)public HostKey(string name, HostKeyArgs args, CustomResourceOptions? opts = null)
public HostKey(String name, HostKeyArgs args)
public HostKey(String name, HostKeyArgs args, CustomResourceOptions options)
type: aws:transfer:HostKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args HostKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args HostKeyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args HostKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var hostKeyResource = new Aws.Transfer.HostKey("hostKeyResource", new()
{
ServerId = "string",
Description = "string",
HostKeyBody = "string",
HostKeyBodyWo = "string",
Region = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := transfer.NewHostKey(ctx, "hostKeyResource", &transfer.HostKeyArgs{
ServerId: pulumi.String("string"),
Description: pulumi.String("string"),
HostKeyBody: pulumi.String("string"),
HostKeyBodyWo: pulumi.String("string"),
Region: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var hostKeyResource = new HostKey("hostKeyResource", HostKeyArgs.builder()
.serverId("string")
.description("string")
.hostKeyBody("string")
.hostKeyBodyWo("string")
.region("string")
.tags(Map.of("string", "string"))
.build());
host_key_resource = aws.transfer.HostKey("hostKeyResource",
server_id="string",
description="string",
host_key_body="string",
host_key_body_wo="string",
region="string",
tags={
"string": "string",
})
const hostKeyResource = new aws.transfer.HostKey("hostKeyResource", {
serverId: "string",
description: "string",
hostKeyBody: "string",
hostKeyBodyWo: "string",
region: "string",
tags: {
string: "string",
},
});
type: aws:transfer:HostKey
properties:
description: string
hostKeyBody: string
hostKeyBodyWo: string
region: string
serverId: string
tags:
string: string
HostKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The HostKey resource accepts the following input properties:
- Server
Id string - Server ID.
- Description string
- Text description.
- Host
Key stringBody - Private key portion of an SSH key pair.
- Host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- Server
Id string - Server ID.
- Description string
- Text description.
- Host
Key stringBody - Private key portion of an SSH key pair.
- Host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- server
Id String - Server ID.
- description String
- Text description.
- host
Key StringBody - Private key portion of an SSH key pair.
- host
Key StringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- server
Id string - Server ID.
- description string
- Text description.
- host
Key stringBody - Private key portion of an SSH key pair.
- host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- server_
id str - Server ID.
- description str
- Text description.
- host_
key_ strbody - Private key portion of an SSH key pair.
- host_
key_ strbody_ wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
- server
Id String - Server ID.
- description String
- Text description.
- host
Key StringBody - Private key portion of an SSH key pair.
- host
Key StringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the HostKey resource produces the following output properties:
- Arn string
- Amazon Resource Name (ARN) of host key.
- Host
Key stringFingerprint - Public key fingerprint.
- Host
Key stringId - ID of the host key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- Arn string
- Amazon Resource Name (ARN) of host key.
- Host
Key stringFingerprint - Public key fingerprint.
- Host
Key stringId - ID of the host key.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn String
- Amazon Resource Name (ARN) of host key.
- host
Key StringFingerprint - Public key fingerprint.
- host
Key StringId - ID of the host key.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn string
- Amazon Resource Name (ARN) of host key.
- host
Key stringFingerprint - Public key fingerprint.
- host
Key stringId - ID of the host key.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn str
- Amazon Resource Name (ARN) of host key.
- host_
key_ strfingerprint - Public key fingerprint.
- host_
key_ strid - ID of the host key.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn String
- Amazon Resource Name (ARN) of host key.
- host
Key StringFingerprint - Public key fingerprint.
- host
Key StringId - ID of the host key.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
Look up Existing HostKey Resource
Get an existing HostKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: HostKeyState, opts?: CustomResourceOptions): HostKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
description: Optional[str] = None,
host_key_body: Optional[str] = None,
host_key_body_wo: Optional[str] = None,
host_key_fingerprint: Optional[str] = None,
host_key_id: Optional[str] = None,
region: Optional[str] = None,
server_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> HostKeyfunc GetHostKey(ctx *Context, name string, id IDInput, state *HostKeyState, opts ...ResourceOption) (*HostKey, error)public static HostKey Get(string name, Input<string> id, HostKeyState? state, CustomResourceOptions? opts = null)public static HostKey get(String name, Output<String> id, HostKeyState state, CustomResourceOptions options)resources: _: type: aws:transfer:HostKey get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- Amazon Resource Name (ARN) of host key.
- Description string
- Text description.
- Host
Key stringBody - Private key portion of an SSH key pair.
- Host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - Host
Key stringFingerprint - Public key fingerprint.
- Host
Key stringId - ID of the host key.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Server
Id string - Server ID.
- Dictionary<string, string>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- Arn string
- Amazon Resource Name (ARN) of host key.
- Description string
- Text description.
- Host
Key stringBody - Private key portion of an SSH key pair.
- Host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - Host
Key stringFingerprint - Public key fingerprint.
- Host
Key stringId - ID of the host key.
- Region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- Server
Id string - Server ID.
- map[string]string
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn String
- Amazon Resource Name (ARN) of host key.
- description String
- Text description.
- host
Key StringBody - Private key portion of an SSH key pair.
- host
Key StringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - host
Key StringFingerprint - Public key fingerprint.
- host
Key StringId - ID of the host key.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- server
Id String - Server ID.
- Map<String,String>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn string
- Amazon Resource Name (ARN) of host key.
- description string
- Text description.
- host
Key stringBody - Private key portion of an SSH key pair.
- host
Key stringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - host
Key stringFingerprint - Public key fingerprint.
- host
Key stringId - ID of the host key.
- region string
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- server
Id string - Server ID.
- {[key: string]: string}
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn str
- Amazon Resource Name (ARN) of host key.
- description str
- Text description.
- host_
key_ strbody - Private key portion of an SSH key pair.
- host_
key_ strbody_ wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - host_
key_ strfingerprint - Public key fingerprint.
- host_
key_ strid - ID of the host key.
- region str
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- server_
id str - Server ID.
- Mapping[str, str]
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
- arn String
- Amazon Resource Name (ARN) of host key.
- description String
- Text description.
- host
Key StringBody - Private key portion of an SSH key pair.
- host
Key StringBody Wo - NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only private key portion of an SSH key pair, guaranteed not to be written to plan or state artifacts. One of
host_key_bodyorhost_key_body_womust be configured. - host
Key StringFingerprint - Public key fingerprint.
- host
Key StringId - ID of the host key.
- region String
- Region where this resource will be managed. Defaults to the Region set in the provider configuration.
- server
Id String - Server ID.
- Map<String>
- A map of tags to assign to the resource. If configured with a provider
default_tagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tagsconfiguration block.
Import
Using pulumi import, import host keys using the server_id and host_key_id separated by ,. For example:
$ pulumi import aws:transfer/hostKey:HostKey example s-12345678,key-12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
