# SftpContainerResource

- Module: [CommunityToolkit.Aspire.Hosting.Sftp](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire)

A resource that represents an SFTP container.

## Definition

```typescript
interface SftpContainerResource
  extends IComputeResource,
    IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithArgs,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IValueProvider,
    IValueWithReferences {
  readonly connectionStringExpression: ReferenceExpression;
  readonly host: EndpointReferenceExpression;
  readonly port: EndpointReferenceExpression;
  readonly uriExpression: ReferenceExpression;
  withHostKeyFile(
      keyFile: string,
      keyType: KeyType): SftpContainerResource;
  withUserKeyFile(
      username: string,
      keyFile: string,
      keyType: KeyType): SftpContainerResource;
  withUsersFile(usersFile: string): SftpContainerResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- ConnectionString for the atmoz SFTP server in the form of sftp://host:port.
- `host`: `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- `port`: `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- `uriExpression`: `ReferenceExpression` `get` -- Gets the connection URI expression for the atmoz SFTP endpoint.

## Methods

- [withHostKeyFile](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/sftpcontainerresource/withhostkeyfile.md) -- `method` -- Adds a bind mount for the specified host key file to an SFTP container resource.
    ```typescript
  withHostKeyFile(keyFile: string, keyType: KeyType): SftpContainerResource
  ```
- [withUserKeyFile](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/sftpcontainerresource/withuserkeyfile.md) -- `method` -- Adds a bind mount for the public key file of the specified user to an SFTP container resource.
    ```typescript
  withUserKeyFile(username: string, keyFile: string, keyType: KeyType): SftpContainerResource
  ```
- [withUsersFile](/reference/api/typescript/communitytoolkit.aspire.hosting.sftp/sftpcontainerresource/withusersfile.md) -- `method` -- Adds a bind mount for the users.conf file to an SFTP container resource.
    ```typescript
  withUsersFile(usersFile: string): SftpContainerResource
  ```
