133
AWS Transfer for SFTP ユーザーガイド

AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTPユーザーガイド

Page 2: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

AWS Transfer for SFTP: ユーザーガイドCopyright © 2020 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.

Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's,in any manner that is likely to cause confusion among customers, or in any manner that disparages or discreditsAmazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may notbe affiliated with, connected to, or sponsored by Amazon.

Page 3: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

Table of ContentsAWS Transfer for SFTP とは ............................................................................................................... 1AWS Transfer for SFTP の詳細 ............................................................................................................ 2セットアップ ..................................................................................................................................... 3

AWS サインアップ ..................................................................................................................... 3Amazon S3 バケットの要件 ......................................................................................................... 3SFTP のための IAM ポリシーおよびロールの作成 ........................................................................... 4

開始方法 ............................................................................................................................................ 8ログイン .................................................................................................................................... 8SFTP サーバーの作成 ................................................................................................................. 8ユーザーの追加 ......................................................................................................................... 11AWS SFTP を使用してファイルを転送する .................................................................................. 13

OpenSSH を使用する ........................................................................................................ 14WinSCP を使用する .......................................................................................................... 14Cyberduck を使用する ....................................................................................................... 16FileZilla を使用する ........................................................................................................... 17

SFTP サーバー設定の編集 ................................................................................................................. 18サーバーに関する情報の確認 ...................................................................................................... 18SFTP サーバーのオンラインとオフラインの切り替え ..................................................................... 19サーバーの設定 ......................................................................................................................... 20AWS SFTP サーバーのホストキーの変更 .................................................................................... 21

ユーザー設定の編集 .......................................................................................................................... 22IAM ポリシーの使用 .................................................................................................................. 23

S3 バケットアクセスポリシーの作成 ................................................................................... 24スコープダウンポリシーの作成 ........................................................................................... 25ユーザーによる S3 バケットでのディレクトリの作成を無効にする ........................................... 26

ID プロバイダーの使用 ...................................................................................................................... 27カスタム ID プロバイダー .......................................................................................................... 27

カスタムホスト名の使用 .................................................................................................................... 30Amazon Route 53 を DNS プロバイダーとして使用する ................................................................. 30他の DNS プロバイダーの使用 .................................................................................................... 31

VPC での SFTP サーバーの作成 ......................................................................................................... 32VPC エンドポイントの作成 ........................................................................................................ 32.............................................................................................................................................. 34

使用状況のモニタリング .................................................................................................................... 36CloudTrail ログ記録の有効化 ...................................................................................................... 36アクティビティのログ記録 ......................................................................................................... 36

セキュリティの管理 .......................................................................................................................... 38SSH キーの生成 ....................................................................................................................... 38

Windows での SSH キーの作成 .......................................................................................... 39SSH キーのローテーション ........................................................................................................ 39データの暗号化 ......................................................................................................................... 41AWS CloudTrail を使用した API コールのログ作成 ........................................................................ 41

CloudTrail 内の AWS Transfer for SFTP 情報 ........................................................................ 42AWS Transfer for SFTP ログファイルエントリの概要 ............................................................ 42

API リファレンス .............................................................................................................................. 44ようこそ .................................................................................................................................. 44Actions .................................................................................................................................... 45

CreateServer .................................................................................................................... 47CreateUser ...................................................................................................................... 52DeleteServer .................................................................................................................... 58DeleteSshPublicKey .......................................................................................................... 60DeleteUser ....................................................................................................................... 63DescribeServer ................................................................................................................. 65DescribeUser .................................................................................................................... 68

iii

Page 4: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

ImportSshPublicKey .......................................................................................................... 72ListServers ....................................................................................................................... 76ListTagsForResource ......................................................................................................... 79ListUsers ......................................................................................................................... 82StartServer ....................................................................................................................... 86StopServer ....................................................................................................................... 88TagResource .................................................................................................................... 90TestIdentityProvider ........................................................................................................... 93UntagResource ................................................................................................................. 97UpdateServer ................................................................................................................... 99UpdateUser .................................................................................................................... 104

Data Types ............................................................................................................................ 108DescribedServer .............................................................................................................. 109DescribedUser ................................................................................................................ 112EndpointDetails ............................................................................................................... 115HomeDirectoryMapEntry ................................................................................................... 117IdentityProviderDetails ...................................................................................................... 118ListedServer ................................................................................................................... 119ListedUser ...................................................................................................................... 121SshPublicKey ................................................................................................................. 123Tag ............................................................................................................................... 124

Common Parameters ............................................................................................................... 124Common Errors ...................................................................................................................... 126

ドキュメント履歴 ............................................................................................................................ 128AWS の用語集 ................................................................................................................................ 129

iv

Page 5: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

AWS Transfer for SFTP とはAWS Transfer for SFTP (AWS SFTP) は完全マネージド型の AWS サービスで、Secure File TransferProtocol (SFTP) を使用して Amazon Simple Storage Service (Amazon S3) との間でファイルを転送します。SFTP は、Secure Shell (SSH) ファイル転送プロトコルとも呼ばれています。SFTP は、金融サービス、医療、広告、リテールなどのさまざまな業界間におけるデータ交換ワークフローに使用されます。

AWS SFTP の一般的ユースケースは以下のとおりです。

• ベンダーやパートナーなどのサードパーティからのアップロード用の AWS のデータレイク。• 顧客によるサブスクリプション型のデータ分散。• 組織内の内部転送。

AWS SFTP を使用することで、サーバーインフラストラクチャを運用することなく、AWS で SFTP サーバーにアクセスできます。このサービスを使用すると、エンドユーザーのクライアントと設定をそのまま維持しながら、SFTP ベースのワークフローを AWS に以降できます。最初にホスト名を SFTP サーバーエンドポイントに関連付けてから、ユーザーを追加して、適切なアクセスレベルをプロビジョニングします。これにより、ユーザーの転送リクエストが AWS SFTP サーバーエンドポイントから直接提供されます。

AWS SFTP には次の利点があります。

• ニーズに合わせてリアルタイムでスケーリングが可能なフルマネージドサービス。• アプリケーションを変更したり、SFTP インフラストラクチャを運用する必要はありません。• データは耐久性のある Amazon S3 ストレージに格納されるため、処理、分析、レポート、監査、およ

びアーカイブ機能にネイティブ AWS のサービスを使用できます。• 前払い料金はなく、サービスの使用料金のみを支払います。

AWS SFTP のさまざまな機能の説明、SFTP サーバーを設定して使用する方法の詳細手順、さまざまなタイプの ID プロバイダーモードを使用する方法、トラブルシューティングのヒント、およびサービスの APIリファレンスについては、以下のページを参照してください。

AWS SFTP の使用を開始するには、以下を参照してください。

• AWS Transfer for SFTP の詳細 (p. 2)• セットアップ (p. 3)• 開始方法 (p. 8)

1

Page 6: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

AWS Transfer for SFTP の詳細AWS Transfer for SFTP (AWS SFTP) はフルマネージド型の AWS のサービスで、Secure File TransferProtocol (SFTP) を使用して Amazon S3 バケットとの間でファイルを転送します。SFTP は、SecureShell (SSH) ファイル転送プロトコルとも呼ばれています。

AWS SFTP の使用を開始するには、SFTP サーバーを作成し、ユーザーがそのサーバーを使用するよう割り当てます。SFTP ユーザーの転送リクエストを処理するには、IAM ロールを作成して S3 バケットにアクセスします。

AWS SFTP を使用するには、次の必要な手順に従います。

1. 「Amazon S3 バケットの要件 (p. 3)」の説明に従って、Amazon S3 バケットを作成します。2. 次の 2 つの IAM ポリシーを含む IAM ロールを作成します。

• AWS SFTP が S3 バケットにアクセスするためのアクセス許可が含まれる IAM ポリシー。この IAMポリシーは、SFTP ユーザーに提供するアクセスのレベルを決定します。

• AWS SFTP との信頼関係を確立する IAM ポリシー。

IAM ポリシーの作成に関する詳細については、「IAM ポリシーを使用した AWS SFTP へのアクセスの制御 (p. 23)」を参照してください。

3. (オプション) 独自の登録済みドメインを所有している場合は、登録済みドメインと SFTP サーバーを関連付けます。

SFTP トラフィックを example.com といったドメインから、またはsftp.accounting.example.com といったサブドメインから、SFTP サーバーエンドポイントにルーティングできます。詳細については、「カスタムホスト名の使用 (p. 30)」を参照してください。

4. SFTP サーバーを作成し、サービスが使用する ID プロバイダータイプを指定して、ユーザーを認証します。

ID プロバイダータイプの詳細については、「ID プロバイダーの使用 (p. 27)」を参照してください。5. カスタム ID プロバイダーではなく、サービスマネージド型 ID プロバイダーで SFTP サーバーを使用し

ている場合、1 人以上のユーザーを追加します。6. SFTP クライアントを開いて接続を設定し、使用する SFTP サーバーの SFTP エンドポイントホスト名

を使用します。このホスト名は、AWS SFTP マネジメントコンソールから取得できます。

AWS SFTP はすべての標準 SFTP クライアントをサポートしています。一般的に使用される SFTP クライアントには次のものがあります。

• OpenSSH – Macintosh と Linux のコマンドラインユーティリティです。• WinSCP – Windows 専用のグラフィカルクライアントです。• Cyberduck – Linux、Macintosh、および Microsoft Windows のグラフィカルクライアントです。• FileZilla – Linux、Macintosh、および Windows のグラフィカルクライアントです。

2

Page 7: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドAWS サインアップ

セットアップ以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低でも、Amazon S3 バケットを作成し、リソースベースのポリシーを通じてそのバケットへのアクセスを提供する必要があります。また、ロールが信頼関係を確立することも必要です。この信頼関係により、AWSSFTP は、S3 バケットにアクセスするための AWS Identity and Access Management (IAM) ロールを引き受け、SFTP ユーザーからのファイル転送リクエストに対応できるようになります。

AWS にサインアップするAWS Transfer for SFTP を使用するには、すべての AWS リソース、フォーラム、サポート、使用状況レポートにアクセスできる AWS アカウントが必要です。サービスを使用するまで、料金は発生しません。AWS アカウントが既にある場合、このステップは省略できます。

サインアップして AWS アカウントを作成するには

1. https://aws.amazon.com を開き、[AWS アカウントの作成] を選択します。

Note

AWS アカウントのルートユーザー認証情報を使用してすでに AWS マネジメントコンソールにサインインしている場合は、[Sign in to a different account (別のアカウントにサインインする)] を選択します。IAM 認証情報を使用して、すでにコンソールにサインインしている場合は、[Sign-in using root account credentials (ルートアカウントの資格情報を使ってサインイン)] を選択します。次に、[新しい AWS アカウントの作成] を選択します。

サインアップ手順の一環として、通話呼び出しを受け取り、電話のキーパッドを用いて確認コードを入力することが求められます。

2. オンラインの手順に従います。

料金については、「AWS Transfer for SFTP の料金」を参照してください。

AWS リージョンの可用性の詳細については、AWS 全般のリファレンスの「AWS のリージョンとエンドポイント」セクションにある AWS Transfer for SFTP のリージョン表を参照してください。

Amazon S3 バケットの要件AWS Transfer for SFTP は、Amazon S3 バケットにアクセスしてユーザーからの転送リクエストに対応します。そのため、SFTP サーバー設定の一部として S3 バケットを指定する必要があります。既存のバケットを使用するか、新しいバケットを作成することができます。

Note

同じ AWS リージョンにある SFTP サーバーと S3 バケットを使用する必要はありませんが、ベストプラクティスとしてそうすることをお勧めします。

ユーザーを設定する際、それぞれのユーザーに IAM ロールを割り当てます。このロールによって、S3 バケットに対するユーザーのアクセスレベルが決まります。

新しいバケットを作成する方法については、Amazon Simple Storage Service コンソールユーザーガイドの「S3 バケットを作成する方法」を参照してください。

3

Page 8: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP のための IAM ポリシーおよびロールの作成

SFTP のための IAM ポリシーおよびロールの作成SFTP ユーザーを作成する際、ユーザーアクセスに関して多数の決定を行う必要があります。それには、ユーザーがどの Amazon S3 バケットにアクセスできるようにするか、各 S3 バケットのどの部分をアクセス可能にするか、ユーザーにどの権限を与えるか (たとえば、PUT または GET) といった決定が含まれます。

アクセスを設定するには、リソースベースの IAM ポリシーと、アクセス情報を提供する IAM ロールを作成します。

このプロセスの一環として、SFTP ユーザーに、ファイル操作のターゲットまたはソースである AmazonS3 バケットへのアクセスを提供します。これを行うには以下のような手順を実行します。手順については、後で詳しい説明があります。

1. IAM ロールを作成し、その一環として AWS Transfer for SFTP サービスとの信頼関係を確立します。2. 新しい IAM ロールで新しい IAM ポリシーを作成します。このトピックの後半に、SFTP に使用して S3

バケットへのアクセスを可能にするサンプルポリシーがあります。3. 新しい IAM ポリシーを IAM ロールにアタッチします。4. (オプション) スコープダウンポリシーを作成してユーザーのアクセスをさらに制限します。このトピッ

クの後半に、home ディレクトリへのユーザーアクセスを制限するためのスコープダウンポリシーのサンプルがあります。

以下で、このプロセスの詳しい実行方法を参照してください。

AWS Transfer for SFTP のための IAM ポリシーを作成するには、次の手順を実行します。

1. https://console.aws.amazon.com/iam/ で IAM コンソールを開きます。2. ナビゲーションペインで [Roles (ロール)]、[Create role (ロールの作成)] の順に選択します。

[Create role (ロールの作成)] ページで [AWS service (AWS サービス)] が選択されていることを確認します。

3. [Transfer (転送)] を選択し、[Next: Permissions (次へ: アクセス権限)] を選択します。4. [Attach permissions policy (アクセス権限ポリシーのアタッチ)] セクションで、[Create policy (ポリ

シーの作成)] を選択します。5. [Create Policy (ポリシーの作成)] ページで、[JSON] タブを選択します。6. エディタが表示されたら、エディタの内容を IAM ロールにアタッチする IAM ポリシーで置き換えま

す。

以下の 2 つのサンプル IAM ポリシーを使用できます。いずれかのポリシーをコピーしてエディタに貼り付け、ポリシーを保存して後のステップで使用します。

以下のサンプルポリシーは、S3 バケットのオブジェクトへの読み取り/書き込みアクセスを付与します。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::bucket_name"

4

Page 9: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP のための IAM ポリシーおよびロールの作成

] }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:GetObjectVersion" ], "Resource": "arn:aws:s3:::bucket_name/*" } ]}

以下のサンプルポリシーは、ユーザーのアクセスを home ディレクトリのみに限定するスコープダウンポリシーです。

Note

スコープダウンポリシーで SFTP ユーザーを home ディレクトリにロックするためには、home ディレクトリに対して割り当てるパスが値 username を含んでいる必要があります。たとえば、username を "bob" に設定した場合、home ディレクトリが "bob" を含む必要があります。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::${transfer:HomeBucket}" ], "Condition": { "StringLike": { "s3:prefix": [ "Optional_path/${transfer:UserName}/*", "Optional_path/${transfer:UserName}" ] } } }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:GetObjectVersion" ], "Resource": "arn:aws:s3:::${transfer:HomeDirectory}*" } ]}

5

Page 10: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP のための IAM ポリシーおよびロールの作成

7. [Review policy (ポリシーの確認)] を選択してポリシーの名前と説明を入力し、[Create policy (ポリシーの作成)] を選択します。

次に IAM ロールを作成し、新しい IAM ポリシーをアタッチします。

IAM ロールを作成するには

1. ナビゲーションペインで [ロール]、[ロールの作成] の順に選択します。

[Create role (ロールの作成)] ページで [AWS service (AWS サービス)] が選択されていることを確認します。

2. サービスリストから [Transfer (転送)] を選択し、[Next: Permissions (次へ: アクセス権限)] を選択します。これにより、AWS Transfer for SFTP と AWS の間で信頼関係が確立されます。

3. [Attach permissions policies (アクセス権限ポリシーをアタッチする)] セクションで、先ほど作成したポリシーを選択し、[Next: Tags (次へ: タグ)] を選択します。

4. (オプション) タグのキーと値を入力し、[Next: Review (次へ: レビュー)] を選択します。5. [Review (レビュー)] ページで新しいロールの名前と説明を入力し、[Create role (ロールの作成)] を選

択します。

次に、AWS Transfer for SFTP と AWS の間に信頼関係を確立します。

信頼関係を確立するには

1. IAM コンソールで、作成したロールを選択します。

2. [Summary (概要)] ページで、[Trust relationships (信頼関係)] を選択し、続いて [Edit trust relationship(信頼関係の編集)] を選択します。

3. [Edit Trust Relationship (信頼関係の編集)] エディタを使用して、アクセスポリシーのstoragegateway を transfer で置き換えます。編集されたアクセスポリシーは次のようになります。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "transfer.amazonaws.com" }, "Action": "sts:AssumeRole" } ]}

4. [信頼ポリシーの更新] を選択してアクセスポリシーを更新します。

これで、SFTP に対し、ユーザーの代理として AWS サービスを呼び出すことを許可する IAM ロールが作成できました。ロールには、SFTP ユーザーにアクセス権限を付与するための IAM ポリシーをアタッチし

6

Page 11: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP のための IAM ポリシーおよびロールの作成

てあります。「開始方法 (p. 8)」セクションで、このロールとポリシーを SFTP ユーザーに割り当てます。

このトピックですでに説明したとおり、オプションで、ユーザーによるアクセスをホームディレクトリのみに限定するスコープダウンポリシーも作成できます。スコープダウンポリシーの詳細については、「スコープダウンポリシーの作成 (p. 25)」を参照してください。

IAM ロールの一般的な情報については、IAM ユーザーガイド の「AWS サービスにアクセス許可を委任するロールの作成」を参照してください。 S3 リソース用のリソースベースのポリシーの詳細については、Amazon Simple Storage Service 開発者ガイド の「Amazon S3 リソースへのアクセス権限の管理」を参照してください。

7

Page 12: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドログイン

開始方法この「開始方法」実習では、次の手順を実行します。

• AWS Transfer for SFTP コンソールにサインインします。• 最初の SFTP サーバーを作成します。• ユーザーを追加します。• SFTP クライアントを使用してファイル転送を実行します。

開始する前に、セットアップ (p. 3)にある要件を満たしてください。この一環として、Amazon S3 バケットと AWS Identity and Access Management (IAM) ユーザーロールを作成します。

SFTP サーバーを作成するときに、そのサーバーがユーザーを認証して Amazon S3 ストレージへのアクセスを提供する方法を決定します。この「開始方法」実習では、AWS SFTP が管理する認証である、サービスマネージド型認証を使用します。サービスマネージド型認証では、Secure Shell (SSH) キーペアが使用されます。

また、独自のカスタム認証メソッドを統合して AWS SFTP を使用できます。このアプローチでは、パスワードとキーベース認証の両方がサポートされています。カスタム認証の詳細については、「カスタム IDプロバイダーの使用 (p. 27)」を参照してください。

AWS SFTP コンソールへの初めてのサインインAWS SFTP コンソールにサインインする前に、サービスへのアクセスを有効にする Amazon S3 バケットと IAM ユーザーロールを作成します。手順については、「セットアップ (p. 3)」を参照してください。

その後、次の手順に従って AWS Transfer for SFTP サービスに初めてサインインします。

AWS SFTP に初めてサインインするには

1. 次のいずれかの方法を使用して、AWS Transfer for SFTP コンソールに移動します。

• ブラウザのアドレスバーに https://console.aws.amazon.com/transfer/ と入力します。• AWS マネジメントコンソール に移動し、サインインして、検索ボックスに AWS Transfer と入力

します。2. [Account ID or alias (アカウント ID またはエイリアス)] に、アカウント ID またはエイリアスを入力し

ます。3. [IAM user name (IAM ユーザー名)] に、SFTP 用に作成したユーザーロールの名前を入力します。4. [Password (パスワード)] に、AWS アカウントパスワードを入力します。5. [Sign In (サインイン)] を選択します。

次のステップ

SFTP サーバーの作成 (p. 8)

SFTP サーバーの作成以下に、SFTP サーバーを作成する方法があります。サーバーを作成するとき、そのサーバーに、SSHキーを使用したサービスマネージド型またはカスタムのどちらかの ID プロバイダータイプを割り当てます。カスタムメソッドは Amazon API Gateway を使用し、ディレクトリサービスを統合して SFTP ユー

8

Page 13: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP サーバーの作成

ザーの認証と許可を実行できるようにします。サービスは、サーバーを一意に識別する識別子を自動的に割り当てます。

必要に応じて、カスタムホスト名を定義できます。これには、Amazon Route 53 サービスまたは任意のドメインネームシステム (DNS) サービスを使用します。

特定の AWS リージョンに SFTP サーバーを作成し、そのサーバーに割り当てられた SFTP ユーザーのファイル操作リクエストを実行します。サーバーにホスト名を割り当てるか、DNS リダイレクトに基づいたカスタムホスト名を使用できます。

キーと値のペアであるタグの形式で、サーバーにメタデータを割り当てることもできます。サーバーホスト名は、作成された AWS リージョンに一意である必要があります。料金は、インスタンス化されたSFTP サーバーとデータ転送に発生します。

この手順では、サービスマネージド型 (SSH キー) メソッドを使用してサーバーを作成し、ホスト名は空白のままにします。

AWS SFTP で最初の SFTP サーバーを作成するには

1. https://console.aws.amazon.com/transfer/ で AWS SFTP コンソールを開きます。2. 次に示すように、[New SFTP server (新しい SFTP サーバー)] セクションで [Create Server (サーバー

の作成)] を選択します。

3. インターネット経由で、またはお客様独自の Virtual Private Cloud (VPC) でのみアクセス可能になるよう SFTP サーバーを設定できます。このチュートリアルでは、インターネット経由でサーバーをアクセス可能にする方法を示します。

[エンドポイント設定] セクションで、次のいずれかの操作を行います。

• [Endpoint type (エンドポイントタイプ)] で Public を選択して、インターネット経由でサーバーをアクセス可能にします。VPC でサーバーをアクセス可能にする方法については、「Virtual PrivateCloud での SFTP サーバーの作成 (p. 32)」を参照してください。

• カスタムドメインを使用しない場合は、[カスタムホスト名] の [なし] を選択します。

この場合、AWS SFTP によって提供された SFTP サーバーホスト名を取得します。サーバーホスト名の形式は serverId.server.transfer.regionId.amazonaws.com です。

• 登録したカスタムホスト名を使用する場合、[Amazon Route 53 DNS alias (Amazon Route 53 DNSエイリアス)] または [Other DNS (他の DNS)] を選択します。

こうすると、SFTP サーバーのエンドポイントと関連付ける名前解決メソッドが指定されます。

たとえば、カスタムドメインは sftp.inbox.example.com である場合があります。カスタムホスト名は、ユーザーが提供し、DNS サービスが解決できる DNS 名を使用します。Route 53 をDNS リゾルバーとして使用するか、独自の DNS サービスプロバイダーを使用できます。AWSSFTP が Route 53 を使用してカスタムドメインから SFTP エンドポイントにトラフィックをルーティングする方法については、「カスタムホスト名の使用 (p. 30)」を参照してください。

4. [Identity provider (ID プロバイダー)] セクションで、[Service managed (サービスマネージド型)] を選択してユーザー ID とキーを AWS SFTP に保存します。

この実習では、サービスマネージド型オプションを使用します。[Custom (カスタム)] を選択した場合、エンドポイントにアクセスするために API Gateway エンドポイントと IAM ロールを提供します。そうすることで、ディレクトリサービスを統合して SFTP ユーザーの認証と許可を実行できます。カスタム ID プロバイダーの使用に関する詳細については、「ID プロバイダーの使用 (p. 27)」を参照してください。

9

Page 14: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP サーバーの作成

5. (オプション) [Logging role (ログ記録ロール)] に、Amazon CloudWatch が SFTP ユーザーアクティビティをログ記録できるようにする IAM ロールを選択します。

CloudWatch ログ記録ロールのセットアップの詳細については、「使用状況のモニタリング (p. 36)」を参照してください。

6. (オプション) [Key (キー)] と [Value (値)] には、1 つ以上のタグをキーと値のペアとして入力します。

サーバーにさらにタグを追加するには、[Add tag (タグの追加)] を選択します。7. [Create (作成)] を選択してサーバーを作成します。次に示すとおり、新しいサーバーが一覧表示され

ている、[Servers (サーバー)] ページに移動します。

新しい SFTP サーバーのステータスが [Online (オンライン)] に変更されるまで数分かかる場合があります。その時点で、サーバーはユーザーのためにファイル操作を実行できます。

次のステップ

ユーザーの追加 (p. 11)

10

Page 15: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドユーザーの追加

ユーザーの追加サービスマネージド型 ID タイプを使用する場合、SFTP サーバーにユーザーを追加します。その場合、各ユーザー名はサーバーで一意である必要があります。

各ユーザーのプロパティの一部として、そのユーザーの Secure Shell (SSH) パブリックキーも保存します。この「使用開始」実習で使用する、キーベースの認証では、そうする必要があります。プライベートキーはユーザーのコンピューターにローカルに保存されます。ユーザーが SFTP クライアントを使用して認証リクエストを SFTP サーバーに送信するときに、サーバーは、ユーザーを正しく認証する前に、関連付けられた SSH プライベートキーにユーザーがアクセスできることを確認します。

さらに、ユーザーの home ディレクトリ、またはランディングディレクトリを指定し、ユーザーに IAMロールを割り当てます。必要に応じて、スコープダウンポリシーを提供してユーザーアクセスを S3 バケットの home ディレクトリのみに限定できます。

SFTP サーバーにユーザーを追加するには

1. [Servers (サーバー)] ページで、ユーザーを追加する SFTP サーバーの横にあるチェックボックスをオンにします。

2. [Add user (ユーザーの追加)] を選択して [Add user (ユーザーの追加)] 画面を開きます。3. [Username (ユーザー名)] にユーザー名を入力します。このユーザー名は、最小 3 文字、最大 32 文

字である必要があります。ユーザー名には、次の文字を使用できます: a-z、A-Z、0-9、下線、ハイフン。ユーザー名をハイフンで始めることはできません。

11

Page 16: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドユーザーの追加

4. [Roles (ロール)] で、以前に作成した、Amazon S3 バケットへのアクセスを提供する IAM ロールを選択します。

この IAM ロールは、「SFTP のための IAM ポリシーおよびロールの作成 (p. 4)」の手順を使用して作成しました。その IAM ロールには、Amazon S3 バケットへのアクセスを提供する IAM ポリシーが含まれます。別の IAM ポリシーで定義された、AWS SFTP サービスとの信頼関係も含まれます。

5. (オプション) 「SFTP のための IAM ポリシーおよびロールの作成 (p. 4)」の説明に従って、スコープダウンポリシーを追加します。スコープダウンポリシーの詳細については、「スコープダウンポリシーの作成 (p. 25)」を参照してください。

6. [Home Directory (ホームディレクトリ)] で、AWS SFTP を使用して転送するデータを保存する S3バケットを選択します。ユーザーが SFTP クライアントを使用してログインしたときにアクセスする、home ディレクトリへのパスを入力します。

このパラメータを空白のままにした場合、Amazon S3 バケットの root ディレクトリが使用されます。この場合、IAM ロールが root ディレクトリへのアクセスを提供することを確認します。

12

Page 17: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドAWS SFTP を使用してファイルを転送する

Note

ユーザーのユーザー名が含まれるディレクトリパスを選択することをお勧めします。そうすることで、スコープダウンポリシーを効果的に使用できます。スコープダウンポリシーは、S3 バケットでのユーザーアクセスを home ディレクトリに制限します。

7. [SSH public key (SSH パブリックキー)] に、SSH キーペアの SSH パブリックキー部分を入力します。

新しいユーザーを追加する前に、キーがサービスによって検証されます。SSH キーの形式はssh-rsa <string> です。SSH キーペアを生成する方法の手順については、「SSH キーの生成 (p. 38)」を参照してください。

8. (オプション) [Key (キー)] と [Value (値)] には、1 つ以上のタグをキーと値のペアとして入力します。9. [Add (追加)] を選択して、新しいユーザーを選択したサーバーに追加します。

次に示すとおり、新しいユーザーは [Servers (サーバー)] ページの [Users (ユーザー)] セクションに表示されます。

次のステップ

AWS SFTP を使用してファイルを転送する (p. 13)

AWS SFTP を使用してファイルを転送するSFTP クライアントで転送操作を指定してファイルを AWS SFTP サービスで転送します。AWS SFTP は次の SFTP クライアントをサポートしています。

• OpenSSH (Macintosh および Linux)

13

Page 18: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドOpenSSH を使用する

• WinSCP (Microsoft Windows のみ)• Cyberduck (Windows、Macintosh、および Linux)• FileZilla (Windows、Macintosh、および Linux)

次で、各クライアントでファイルを転送する方法について説明します。

トピック• OpenSSH を使用する (p. 14)• WinSCP を使用する (p. 14)• Cyberduck を使用する (p. 16)• FileZilla を使用する (p. 17)

OpenSSH を使用する次の手順に従って、OpenSSH を使用してコマンドラインからファイルを転送します。

OpenSSH コマンドラインユーティリティを使用して AWS SFTP でファイルを転送するには

1. Linux または Macintosh の場合、コマンドターミナルを開きます。2. プロンプトで次のコマンドを入力します: % sftp -i transfer-key

sftp_user@service_endpoint、

前述のコマンドでは、sftp_user がユーザー名、transfer-key が SSH プライベートキーです。ここでは、選択された SFTP で AWS SFTP コンソールに示されているとおり、service_endpointが SFTP サーバーのエンドポイントです。

sftp プロンプトが表示されます。3. sftp プロンプトで、次のコマンドを入力します: sftp> pwd4. 次の行で、次のテキストを入力します: /mybucket/home/sftp_user

この「使用開始」実習では、この Amazon S3 バケットがファイル転送のターゲットです。5. 次の行で、次のコマンドを入力します: sftp> put filename.txt

put コマンドはファイルを Amazon S3 バケットに転送します。

次のようなメッセージが表示され、ファイル転送が進行中である、または完了したことを示します。

Uploading filename.txt to /my-bucket/home/sftp_user/filename.txt

some-file.txt 100% 127 0.1KB/s 00:00

Note

サーバーが環境内の DNS サービス用に作成されてから、サーバーエンドポイントホスト名を解決できるようになるまで、数分かかる場合があります。テスト目的では、リージョンのエンドポイントを使用し、user_name.serverid@service_endpoint としてログインします。AWS SFTP の AWS リージョンエンドポイントのリストについては、『AWS 全般のリファレンス』の「AWS リージョンとエンドポイント」の「AWS Transfer for SFTP」を参照してください。

WinSCP を使用する次の手順に従って、WinSCP を使用してコマンドラインからファイルを転送します。

14

Page 19: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドWinSCP を使用する

WinSCP を使用して AWS SFTP でファイルを転送するには

1. WinSCP クライアントを開き、[New Session (新しいセッション)] を選択します。2. [File protocol (ファイルプロトコル)] で、[Login (ログイン)] ダイアログボックスで [SFTP] が選択され

ていることを確認します。3. 次に示すとおり、左にあるフォルダリストから [New Site (新しいサイト)] を選択します。

4. [Host name (ホスト名)] にサーバーエンドポイントを入力します。5. [Username (ユーザー名)] に、ユーザーの追加 (p. 11) で作成したユーザーの名前を入力します。6. 次に示すとおり、[Advanced (アドバンスト)] を選択して [Advanced (アドバンスト)] ダイアログボッ

クスを開き、左側のペインの [SSH] セクションで [Authentication (認証)] を選択します。

7. ファイルシステムで SSH プライベートキーを参照し、選択します。8. 次に示すとおり、WinSCP が SSH プライベートキーを PPK 形式に変換することを提示した場合、

[OK] を選択します。

9. [OK] を選択して [Login (ログイン)] ダイアログボックスに戻り、[Save (保存)] を選択します。10. 次に示すとおり、[Save session as site (セッションをサイトとして保存)] ダイアログボックスで、

[OK] を選択して接続セットアップを完了します。

15

Page 20: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCyberduck を使用する

11. SFTP ファイル転送を実行します。

ドラッグアンドドロップメソッドを使用して、ターゲットウィンドウとソースウィンドウ間でファイルをコピーできます。ツールバーアイコンを使用して、WinSCP にあるファイルのプロパティをアップロード/ダウンロード、削除、編集、または変更できます。

Note

Amazon S3 はオブジェクトタイムスタンプを管理するため、AWS SFTP ファイル転送を実行する前に WinSCP タイムスタンプ設定を無効にしてください。そうするには、[WinSCP Transfersettings (WinSCP 転送設定)] ダイアログボックスで [Set permissions (アクセス許可の設定)] アップロードオプションと [Preserve timestamp (タイムスタンプを保持する)] 一般オプションを無効にします。

Cyberduck を使用する次の手順に従って、Cyberduck を使用してコマンドラインからファイルを転送します。

Cyberduck を使用して AWS SFTP でファイルを転送するには

1. Cyberduck を起動し、[Open Connection (オープン接続)] を選択して [Connection (接続)] ダイアログボックスを開きます。

2. [Protocol (プロトコル)] で [SFTP (SSH File Transfer Protocol) (SFTP (SSH ファイル転送プロトコル))]を選択します。

3. AWS SFTP サーバーページで、使用する SFTP サーバーの名前であるチェックボックスをオンにします。

4. 次に示すとおり、[Server (サーバー)] にサービスエンドポイントを入力します。

16

Page 21: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドFileZilla を使用する

5. [Username (ユーザー名)] に、ユーザーの追加 (p. 11) で作成したユーザーの名前を入力します。6. [SSH Private Key (SSH プライベートキー)] で、SSH プライベートキーを選択します。7. (オプション) [Path (パス)] で [More Options (詳細)] を選択し、ターゲットまたはソース Amazon S3

ディレクトリを入力します。8. [接続] を選択します。

Amazon S3 ディレクトリが、SFTP クライアントのペインの 1 つで開きます。9. ファイルの場所に応じて、次のいずれかを実行します。

• ローカルディレクトリ (ソース) で、転送するファイルを選択し、Amazon S3 ディレクトリ (ターゲット) にドラッグアンドドロップします。

• Amazon S3 ディレクトリ (ソース) で、転送するファイルを選択し、ローカルディレクトリ (ターゲット) にドラッグアンドドロップします。

Cyberduck がファイルを転送します。

FileZilla を使用する次の手順に従って、FileZilla を使用してコマンドラインからファイルを転送します。

FileZilla を SFTP ファイル転送用にセットアップするには

1. [Connect (接続)] を選択して、[Connection (接続)] ダイアログボックスを開きます。

2. 上部にあるリストで、プロトコルとして [SFTP] を選択します。3. [Port (ポート)] に「22」と入力します。4. [Server ()] に、選択されたサーバーの AWS SFTP コンソールに一覧表示されている SFTP サーバーの

hostname.service_endpoint を入力します。5. [Username (ユーザー名)] に、ユーザーの追加 (p. 11) で作成したユーザーの名前を入力しま

す。username.serverId の形式を使用します。serverId は AWS SFTP コンソールに一覧表示されています。

6. [Browse (参照)] を選択し、SSH プライベートキーをこの FileZilla 接続にアップロードします。7. [接続] を選択します。

Note

進行中のファイル転送を中断する場合、AWS SFTP が S3 バケットにオブジェクトの一部を書き込む場合があります。アップロードを中断する場合、続行する前に S3 バケットのファイルサイズがソースオブジェクトのファイルサイズと一致することを確認してください。

17

Page 22: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドサーバーに関する情報の確認

SFTP サーバー設定の編集このセクションでは、AWS Transfer for SFTP の詳細、サーバーを設定する方法、およびサーバーをオンラインまたはオフラインにする方法について説明します。

トピック• サーバーに関する情報の確認 (p. 18)• SFTP サーバーのオンラインとオフラインの切り替え (p. 19)• SFTP サーバーの設定 (p. 20)• AWS SFTP サーバーのホストキーの変更 (p. 21)

サーバーに関する情報の確認AWS Transfer for SFTP コンソールには、選択した AWS リージョンにあるすべての SFTP サーバーのリストが表示されます。

個々の SFTP サーバーの詳細やプロパティのリストも表示されます。サーバーのプロパティには、ステータス、サービスエンドポイント、カスタムホスト名、ログ記録ロール、ユーザー、タグなどがあります。

AWS リージョンにある SFTP サーバーのリストを確認するには、次の手順を実行します。

• AWS マネジメントコンソール にサインインし、AWS SFTP コンソール (https://console.aws.amazon.com/transfer/) を開きます。

現在の AWS リージョンに複数の AWS SFTP サーバーがある場合は、コンソールが開き、サーバーのリストが表示されます。サーバーのリストが表示されない場合は、現在の AWS リージョンにいることを確認してください。ナビゲーションペインで [Servers (サーバー)] を選択することもできます。

以下に [Servers (サーバー)] のリストの例を示します。

SFTP サーバーの詳細を確認するには、次の手順を実行します。

1. AWS SFTP コンソールを開き、[Servers (サーバー)] ページに移動します。2. [Servers (サーバー)] ページで、プロパティを確認する SFTP サーバー名のチェックボックスをオンに

します。3. [Server ID (サーバー ID)] 列で ID を選択すると、次のように [Server Configuration (サーバーの構成)]

ページが開きます。このページで、サーバーのプロパティを変更することができます。エンドポイントタイプを変更する場合は、その手順について「Virtual Private Cloud での SFTP サーバーの作成 (p. 32)」を参照してください。

18

Page 23: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSFTP サーバーのオンラインとオフラインの切り替え

SFTP サーバーのオンラインとオフラインの切り替え

サーバーのオンラインとオフラインを切り替えるには、AWS SFTP コンソールを使用します。

SFTP サーバーをオンラインにするには、次の手順を実行します。

1. AWS SFTP コンソールを開き、ナビゲーションペインで [Servers (サーバー)] を選択します。2. オフラインの SFTP サーバーを選択するため、サーバー名の横にあるチェックボックスをオンにしま

す。3. [Actions (アクション)] で [Start (開始)] を選択します。

SFTP サーバーがオフラインからオンラインに切り替わるまでに数分かかる場合があります。

Note

SFTP サーバーをオフラインにするために停止しても、そのサーバーに対するサービス料金は発生し続けます。SFTP サーバーに対するサービス料金が発生しないようにするには、そのサーバーを削除してください。

SFTP サーバーをオフラインにするには、次の手順を実行します。

1. AWS SFTP コンソールを開き、ナビゲーションペインで [Servers (サーバー)] を選択します。2. オンラインの SFTP サーバーを選択するため、サーバー名の横にあるチェックボックスをオンにしま

す。3. [Actions (アクション)] で [Stop (停止)] を選択します。

19

Page 24: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドサーバーの設定

SFTP サーバーの開始中またはシャットダウン中に、SFTP サーバーを使ってファイル操作を行うことはできません。コンソールには、開始状態や停止状態が表示されません。

エラー状態の START_FAILED または STOP_FAILED が検出された場合は、問題の解決を AWS サポートにご依頼ください。

SFTP サーバーの設定新しい SFTP サーバーを作成する場合は、必要に応じてカスタムホスト名を割り当てたり、AmazonCloudWatch を使った Amazon S3 イベントのログ記録を有効にしたりできます。SFTP サーバーの DNSやログ記録の設定は、後からコンソールで変更できます。

Note

サーバーの作成後に ID プロバイダーのタイプを変更することはできません。ID プロバイダーを変更するには、サーバーを削除し、希望の ID プロバイダーで新しいサーバーを作成する必要があります。

SFTP サーバーの設定を編集するには、次の手順を実行します。

1. AWS SFTP コンソール (https://console.aws.amazon.com/transfer/) を開き、ナビゲーションペインで[Servers (サーバー)] を選択します。

2. [Servers (サーバー)] ページで、設定を編集する SFTP サーバー名の横にあるチェックボックスをオンにします。

3. 次に示すように、[Edit (編集)] を選択して、[Edit Configuration (設定の編集)] ページを表示します。

4. (オプション) [Custom hostname (カスタムホスト名)] を [None (なし)]、[Amazon Route 53 alias(Amazon Route 53 エイリアス)]、[Other DNS provider (他の DNS プロバイダー)] の中から選択します。

登録したカスタムホスト名を使用する場合は、[Amazon Route 53 alias (Amazon Route 53 エイリアス)] または [Other DNS provider (他の DNS プロバイダー)] を選択します。こうすると、SFTP サーバーのエンドポイントと関連付ける名前解決メソッドが指定されます。sftp.inbox.example.comはカスタムドメインの一例です。

カスタムホスト名は、ユーザーが入力し、かつ DNS サービスが解決できる DNS 名を使用します。Route 53 を DNS リゾルバーとして使用するか、独自の DNS サービスプロバイダーを使用できます。AWS SFTP が Route 53 を使ってカスタムドメインからのトラフィックを SFTP エンドポイントにルーティングする仕組みについては、「カスタムホスト名の使用 (p. 30)」を参照してください。Amazon Route 53 は、AWS SFTP がネイティブでサポートしている DNS サービスです。詳細については、Amazon Route 53 開発者ガイド の「Amazon Route 53 とは」を参照してください。

20

Page 25: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドAWS SFTP サーバーのホストキーの変更

5. (オプション) [Logging role (ログ記録ロール)] で、CloudWatch が SFTP ユーザーアクティビティをログ記録できるようにする AWS Identity and Access Management (IAM) ロールを選択します。

ログ記録ロールのセットアップの詳細については、「使用状況のモニタリング (p. 36)」を参照してください。

6. [Save (保存)] を選択して設定を保存します。

AWS SFTP サーバーのホストキーの変更Important

既存のユーザーを既存の SFTP サーバーから新しい AWS SFTP サーバーに移行する計画がない場合、このセクションは無視してください。サーバーのホストキーを誤って変更することは、破壊的な操作になり得えます。

デフォルトでは、AWS Transfer for SFTP によって AWS SFTP サーバーのホストキーが提供されます。デフォルトのホストキーは、別のサーバーのホストキーに置き換えることができます。この操作を行うのは、既存のユーザーを既存の SFTP サーバーから新しい AWS SFTP サーバーに移動することを計画している場合のみにします。

ユーザーが SFTP サーバーの信頼性を検証する通知を再度受け取らないようにするには、オンプレミスサーバーのホストキーを AWS SFTP サーバーにインポートします。また、この操作により、中間者(MITM) 攻撃の可能性に関する警告がユーザーに表示されなくなります。

ホストキーを変更するには、the section called “UpdateServer” (p. 99) API オペレーションを使用して新しいホストキーを提供します。新しい AWS SFTP サーバーを作成する場合は、the section called“CreateServer” (p. 47) API オペレーションでパラメータとしてホストキーを提供します。AWS CLI を使用してホストキーを更新することもできます。

次の例では、指定された SFTP サーバーのホストキーを更新します。

--endpoint your-server-endpoint update-server --server-id "your-server-id" --host-key file://my-host-key { "ServerId": "server-id"}

21

Page 26: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

ユーザー設定の編集トピック

• IAM ポリシーを使用した AWS SFTP へのアクセスの制御 (p. 23)

AWS SFTP マネジメントコンソールでユーザーのプロパティを編集できます。コンソールの [ServerConfiguration] ページで、ユーザーのロール、ポリシー、およびホームディレクトリを編集できます。また、Secure Shell(SSH) パブリックキーとタグを追加および削除することもできます。

ユーザーのプロパティを編集するには、以下の手順を参照してください。AWS SFTP の IAM ポリシーの作成方法については、「IAM ポリシーを使用した AWS SFTP へのアクセスの制御 (p. 23)」を参照してください。

Note

ユーザーを追加した後は、ユーザー名を編集できません。ユーザーのユーザー名を変更するには、新しいユーザー名で新しいユーザーを追加し、不要になったユーザーを削除します。

ユーザーのプロパティを編集するには

1. AWS マネジメントコンソール にサインインし、AWS SFTP コンソール (https://console.aws.amazon.com/transfer/) を開きます。

2. ナビゲーションペインで、[Servers] を選択します。3. [Server Configuration] ページの [Users] セクションでユーザー名を選択すると、以下のように [User

Configuration] ページが表示されます。

4. [Add SSH public key] を選択して、新しい SSH パブリックキーをユーザーに追加します。または、リストで既に割り当て済みの SSH パブリックキーを選択し、[Delete] を選択してユーザーの定義からキーを削除します。

SSH キーは、カスタム認証方法とも呼ばれる Amazon API Gateway 認証方法を使用する SFTP サーバーでのみ使用されます。SSH キーペアを生成する方法については、「SSH キーの生成 (p. 38)」を参照してください。

22

Page 27: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドIAM ポリシーの使用

5. [Manage tags] を選択して、このユーザーに関連付けられている既存のタグを追加、削除、または変更します。

6. 次に示すように、[Edit] を選択して、[Edit Configuration] ページを表示します。

7. (オプション) [Access Info] で IAM ロールを選択して、現在ユーザーに割り当てられている AWSIdentity and Access Management (IAM) ロールを変更します。

AWS SFTP に必要な IAM ロールを作成する方法については、「SFTP のための IAM ポリシーおよびロールの作成 (p. 4)」を参照してください。AWS SFTP の IAM ロールには、Amazon S3 バケットへのアクセスを提供する IAM ポリシーが含まれます。このロールには、AWS SFTP との信頼関係 (アクセス権限ポリシーで定義) を作成する別の IAM ポリシーも含まれます。

8. (オプション) 新しいポリシーオプションを選択して、[Policy Info (ポリシー情報)] を変更します。9. (オプション) AWS SFTP によって転送されたデータを保存するために使用する新しい Amazon S3 バ

ケットを選択して、[ホームディレクトリ] を変更します。ユーザーが SFTP クライアントを使用してログインしたときにアクセスする ディレクトリへのパスを入力します。

Note

ユーザーのユーザー名が含まれているディレクトリパスを選択することをお勧めします。

このパラメータを空のままにした場合、Amazon S3 バケットの root ディレクトリが使用されます。ロールがバケットのルートへのアクセスを提供することを確認します。

10. [保存] を選択して変更を保存します。

IAM ポリシーを使用した AWS SFTP へのアクセスの制御

トピック• Amazon S3 バケットへの読み取りと書き込みアクセス権限の許可 (p. 24)• スコープダウンポリシーの作成 (p. 25)• ユーザーによる S3 バケットでのディレクトリの作成を無効にする (p. 26)

AWS Identity and Access Management (IAM) ポリシーを使用して AWS SFTP リソースへのユーザーのアクセスを制御できます。IAM ポリシーは、リソースへの特定のレベルのアクセスを許可する通常は JSON形式のステートメントです。IAM ポリシーを使用して、SFTP ユーザーの実行を許可するファイル操作を定義します。また、IAM ポリシーを使用して、ユーザーにアクセス権を与える Amazon S3 バケットを定

23

Page 28: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドS3 バケットアクセスポリシーの作成

義します。ユーザーに対してこれらのポリシーを定義するには、IAM ポリシーとこれに関連付けられた信頼関係を含んでいる IAM ロールを AWS SFTP に対して作成します。

各 SFTP ユーザーには IAM ロールが割り当てられます。ユーザーが SFTP サーバーにログインすると、AWS SFTP では IAM ロールがユーザーにマッピングされたと見なします。Amazon S3 バケットにユーザーアクセスを提供する IAM ロールの作成方法については、以下を参照してください。ロールの作成およびアクセス許可の委任については、『IAM ユーザーガイド』の「AWS のサービスにアクセス許可を委任するロールの作成」を参照してください。

AWS SFTP で使用される IAM ロールのタイプは、サービスロールと呼ばれます。

Amazon S3 バケットへの読み取りと書き込みアクセス権限の許可以下では、特定の Amazon S3 バケットへの読み取りおよび書き込みアクセスを許可する IAM ポリシーの作成方法について説明します。この IAM ポリシーを持つ IAM ロールを SFTP ユーザーに割り当てると、指定された S3 バケットへの読み取り/書き込みアクセスがそのユーザーに付与されます。

以下のポリシーでは、Amazon S3 バケットへのプログラムによる読み取りおよび書き込みアクセスを提供します。

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": ["arn:aws:s3:::bucketname"] }, { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:DeleteObject", "s3:DeleteObjectVersion", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": ["arn:aws:s3:::bucketname/*"] } ]}

ListBucket アクションには、バケット自体に対する権限が必要です。PUT、GET、および DELETE アクションにはオブジェクトのアクセス権限が必要です。さまざまなエンティティが存在するため、さまざまな Amazon リソースネーム (ARN) を使用してこれらを指定します。

バケットが AWS Key Management Service (AWS KMS) 暗号化に対して有効化されている場合は、ポリシーで追加のアクションを有効化する必要があります。AWS KMS の詳細については、「AWS KeyManagement Service とは」を参照してください。

さらに指定した S3 バケットの home ディレクトリのみにユーザーのアクセス権を制限するには、「スコープダウンポリシーの作成 (p. 25)」を参照してください。

24

Page 29: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドスコープダウンポリシーの作成

スコープダウンポリシーの作成スコープダウンポリシーは、S3 バケットの特定の部分に AWS SFTP ユーザーを制限する AWS Identityand Access Management (IAM) ポリシーです。これを行うには、リアルタイムでアクセスを評価します。

S3 バケットの特定の部分への同じアクセス権をユーザーのグループに付与する必要がある場合は、スコープダウンポリシーを使用できます。たとえば、あるユーザーのグループが home ディレクトリのみにアクセスする必要があるとします。そのユーザーのグループは同じ IAM ロールを共有します。

スコープダウンポリシーを作成するには、以下の IAM ポリシーのポリシー変数を使用します。

• ${transfer:HomeBucket}

• ${transfer:HomeDirectory}

• ${transfer:HomeFolder}

• ${transfer:UserName}

Note

一覧表示されている変数を IAM ロールの定義のポリシー変数として先に使用することはできません。このような変数は、IAM ポリシーで作成してから、ユーザーの設定時に直接指定します。また、スコープダウンポリシーの ${aws:Username} 変数を使用することはできません。この変数は IAM ユーザー名を参照し、AWS SFTP に必要なユーザー名を参照しません。

スコープダウンポリシーの例を、以下のコードの例に示します。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowListingOfUserFolder", "Action": [ "s3:ListBucket" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::${transfer:HomeBucket}" ], "Condition": { "StringLike": { "s3:prefix": [ "${transfer:HomeFolder}/*", "${transfer:HomeFolder}" ] } } }, { "Sid": "AWSTransferRequirements", "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets", "s3:GetBucketLocation" ], "Resource": "*" }, { "Sid": "HomeDirObjectAccess", "Effect": "Allow", "Action": [ "s3:PutObject",

25

Page 30: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドユーザーによる S3 バケットでのディレクトリの作成を無効にする

"s3:GetObject", "s3:DeleteObjectVersion", "s3:DeleteObject", "s3:GetObjectVersion", "s3:GetObjectACL", "s3:PutObjectACL" ], "Resource": "arn:aws:s3:::${transfer:HomeDirectory}*" } ]}

前述のポリシーが使用されている場合、ユーザーがログインすると、ユーザーはホームディレクトリにあるオブジェクトにのみアクセスできます。接続時には、AWS SFTP によってこれらの変数とユーザーに該当する値が置き換えられます。これによって、同じポリシードキュメントを複数のユーザーに容易に適用できます。この方法により、IAM ロールのオーバヘッドと、Amazon S3 バケットへのユーザーのアクセスを管理するためのポリシー管理が軽減されます。

また、スコープダウンポリシーを使用することで、ビジネス要件に基づいて、ユーザーごとにアクセス権をカスタマイズできます。詳細については、IAM ユーザーガイドの「AssumeRole、AssumeRoleWithSAML、AssumeRoleWithWebIdentity のアクセス権限」を参照してください。

Note

AWS SFTP によって、ポリシーの ARN (Amazon リソースネーム) ではなく、ポリシー JSON が保存されます。したがって、IAM コンソールでポリシーを変更する場合は、AWS SFTP コンソールに戻り、最新のポリシーコンテンツでユーザーを更新する必要があります。[User configuration(ユーザーの設定)] セクションの [Policy Info (ポリシー情報)] タブで、ユーザーを更新できます。詳細については、「ユーザー設定の編集 (p. 22)」を参照してください。CLI を使用する場合は、次のコマンドを使用してポリシーを更新できます。

aws transfer update-user --server-id server --user-name user --policy \ "$(aws iam get-policy-version --policy-arn policy --version-id version --output json)"

ユーザーによる S3 バケットでのディレクトリの作成を無効にするユーザーによる Amazon S3 バケットでのディレクトリの作成を無効にできます。これを行うには、s3:PutObject アクションを許可するが、キーが「/」(バックスラッシュ) で終わるときはこのアクションを拒否する IAM ポリシーを作成します。

次のポリシー例では、ユーザーに S3 バケットへのファイルのアップロードが許可されますが、このバケットでのディレクトリの作成は許可されません。つまり、S3 バケットでは mkdir コマンドが拒否されます。

{ "Sid":"DenyMkdir", "Action":[ "s3:PutObject" ], "Effect":"Deny", "Resource":"arn:aws:s3:::my-sftp-bucket/*/"}

26

Page 31: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドカスタム ID プロバイダー

ID プロバイダーの使用RESTful インターフェイスに Amazon API Gateway メソッドを提供することで、既存の ID プロバイダーを AWS SFTP に統合できます。AWS SFTP は、このメソッドを呼び出して、SFTP ユーザーを認証します。

RESTful インターフェイスには、Amazon S3 へのアクセスについてユーザーを認証および承認する 1 つのメソッドが含まれている必要があります。API メソッドを設定したら、コンソールまたは AWS SFTP APIオペレーションを使用して新しいサーバーを作成する際に、このメソッドを SFTP サーバーにアタッチします。

トピック• カスタム ID プロバイダーの使用 (p. 27)

カスタム ID プロバイダーの使用API Gateway には、API を作成および提供するための安全な方法が用意されています。API Gateway が提供する HTTPS エンドポイントを使用することで、すべての受信 API 呼び出しが安全に転送されます。APIGateway では、AWS_IAM という名前の認証方法を提供し、AWS が内部的に使用する認証と同じ IAM ベースの認証を付与します。AWS_IAM が有効になっている場合、顧客の API を呼び出す明示的なアクセス権限を持つ発信者のみが API Gateway メソッドに到達できます。AWS SFTP を使用するには、発信者はAWS Identity and Access Management (IAM) を有効にして、AWS SFTP のアクセス権限を持つ IAM ロールを提供して API メソッドを呼び出す必要があります。API Gateway サービスの詳細については、『APIGateway 開発者ガイド』を参照してください。

カスタム認証に API Gateway を使用するには

1. AWS ウェブサイトから AWS CloudFormation テンプレートをダウンロードします。

この AWS SFTP AWS CloudFormation テンプレートによって、プロトタイプ AWS Lambda 関数が使用される完全に機能する実装が作成されます。このテンプレートをデプロイすることが、カスタム IDプロバイダーを統合する最も簡単な方法です。

2. SFTP サーバーの API Gateway 認証方法を設定します。

テンプレートをロードしてメソッドを作成したら、API Gateway コンソールに移動して、メソッド本体を実装します。

このメソッドのテンプレートを次の図に示します。この例のメソッドでは Lambda 関数が使用されますが、多数の統合タイプも使用できます。

27

Page 32: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドカスタム ID プロバイダー

3. メソッドをテストして、有効なユーザー認証を正常にできること(および、無効なユーザーを認証しないこと) を確認します。

次のスクリーンショットは、API Gateway でカスタム認証メソッドのテストに成功した例を示しています。

4. 以下のように、サーバーを作成し、[Identity provider] タイプで [Custom] を選択します。

28

Page 33: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドカスタム ID プロバイダー

5. 作成したばかりの API Gateway エンドポイントの URL と、サービスにアクセス権限を提供してこのAPI Gateway を呼び出すために作成された IAM ロールを入力します。

API Gateway では、/servers/serverId/users/username/config のリソースパスを使用して、単一のパスを実装する必要があります。serverId および username は RESTful リソースパスから取得されます。

AWS SFTP がユーザーの代わりにパスワード認証を試行すると、サービスでは Password: ヘッダーフィールドを提供します。Password: ヘッダーが提供されない場合、AWS SFTP がユーザーによる認証の代わりにパブリックキー認証を試行すると想定されています。

このメソッドは常に HTTP ステータス 200 を返すはずです。その他の HTTP ステータスコードは、API へのアクセスエラーを示します。

レスポンス本文は以下の形式の JSON ドキュメントになります。

{ "Role": "IAM role with configured S3 permissions", "PublicKeys": [ "ssh-rsa public-key1", "ssh-rsa public-key2" ], "Policy": "STS Assume role scope down policy", "HomeDirectory": "User's home directory"}

Role フィールドは認証に成功したことを示しています。パスワード認証を行う場合 (すなわち、Password: ヘッダーが提供された場合) は、SSH パブリックキーは省略できます。また、Policyおよび HomeDirectory フィールドはオプションです。home ディレクトリが指定されていない場合は、AWS SFTP はデフォルトで Amazon S3 バケットのルートアクセスを設定します。指定するロールには HomeDirectory パスへのアクセス権限が含まれている必要があります。ユーザーが存在しないか、このサーバーへのアクセス権限がない場合は、HTTP レスポンス本文は空である必要があります。

29

Page 34: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドAmazon Route 53 を DNS プロバイダーとして使用する

カスタムホスト名の使用サーバーホスト名は、ユーザーが AWS SFTP サーバーに接続するときに SFTP クライアントに入力するホスト名です。AWS SFTP を使用する際、サーバーホスト名として登録したカスタムのドメインを使用することができます。たとえば、mysftpserver.mysubdomain.domain.com といったカスタムのホスト名を使用します。

登録したカスタムドメインからトラフィックをサーバーエンドポイントにリダイレクトするには、Amazon Route 53 またはドメインネームシステム (DNS) プロバイダーを使用します。Route 53は、AWS SFTP がネイティブでサポートする DNS サービスです。

トピック• Amazon Route 53 を DNS プロバイダーとして使用する (p. 30)• 他の DNS プロバイダーの使用 (p. 31)

コンソールで、次のいずれかのオプションを選択し、カスタムホスト名を設定します。

• [Amazon Route 53 DNS alias (DNS エイリアス)] – 使用するホスト名が、Route 53 に登録されている場合。その後、ホスト名を入力します。

• [Other (その他)] – 使用するホスト名が別の DNS プロバイダーに登録されている場合。その後、ホスト名を入力します。

• [None (なし)] – SFTP サーバーのエンドポイントを使用し、カスタムホスト名は使用しない場合。

このオプションは、新しい SFTP サーバーの作成時、またはま既存の SFTP サーバーの設定を編集する際に設定します。新しい SFTP サーバーの作成方法の詳細については、「SFTP サーバーの作成 (p. 8)」を参照してください。既存の SFTP サーバーの設定の編集方法について詳しくは、「SFTP サーバーの設定 (p. 20)」を参照してください。

サーバーホスト名として独自のドメインを使用する方法と AWS SFTP による Route 53 の使用について詳しくは、以下のセクションを参照してください。

Amazon Route 53 を DNS プロバイダーとして使用する

AWS SFTP を作成する場合、Amazon Route 53 を DNS プロバイダーとして使用することができます。Route 53 でドメインを使用する前に、ドメイン登録を行います。登録方法の詳細については、Amazon Route 53 開発者ガイド にある「ドメイン登録の仕組み」を参照してください。

Route 53 を使用して SFTP サーバーに DNS ルーティングを提供した場合、AWS SFTP は、入力したカスタムホスト名を使ってホストゾーンを抽出します。SFTP がホストゾーンを抽出する際、3 つの状況が発生する可能性があります。

1. Route 53 を初めて使用し、ホストゾーンがない場合、AWS SFTP は、新しいホストゾーンと CNAMEレコードを追加します。この CNAME レコードの値は、SFTP サーバーのエンドポイントホスト名です。CNAME は、代替ドメイン名です。

2. Route 53 にホストゾーンがあり、CNAME レコードがない場合、AWS SFTP は、ホストゾーンに CNAMEレコードを追加します。

3. ホストゾーンに CNAME レコードがあることがサービスによって検出された場合、CNAME レコードがすでに存在していることを示すエラーが表示されます。その場合は、CNAME レコードの値を AWS SFTP

30

Page 35: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド他の DNS プロバイダーの使用

サーバーのホスト名に変更します。詳細については、Amazon CloudFront 開発者ガイド にある「代替ドメイン名 (CNAME) を追加してカスタム URL を使用する」を参照してください。

Note

このステップを、サーバーを作成するワークフローの中で実行した場合、サーバーが正常に作成され、カスタムホスト名が [None (なし)] に設定されます。

Route 53 のホストゾーンの詳細については、Amazon Route 53 開発者ガイドの「ホストゾーン」を参照してください。

他の DNS プロバイダーの使用AWS SFTP サーバーを作成する場合、Amazon Route 53 以外の DNS プロバイダーを使用することもできます。代替 DNS プロバイダーを使用する場合は、ドメインからのトラフィックが AWS SFTP サーバーエンドポイントに向けられている必要があります。

そのためには、ドメインを SFTP サーバーのエンドポイントホスト名に設定します。コンソールには、エンドポイントのホスト名が serverid.server.transfer.region.amazonaws.com のように表示されます。

31

Page 36: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドVPC エンドポイントの作成

Virtual Private Cloud での SFTP サーバーの作成

Amazon Virtual Private Cloud (Amazon VPC) を使用して AWS リソースをホストする場合、Virtual PrivateCloud (VPC) と AWS SFTP の間の接続を確立できます。この接続を使用して、Secure File TransferProtocol (SFTP) サーバーを作成できます。次にこのサーバーを使用して、Amazon S3 バケットとの間でSFTP を使用し、パブリックインターネットを経由することなく AWS SFTP を使ってデータを転送できます。

Amazon VPC を使用して、カスタム仮想ネットワークで AWS リソースを起動できます。VPC を使用して、IP アドレス範囲、サブネット、ルートテーブル、ネットワークゲートウェイなどのネットワーク設定を制御できます。VPC の詳細については、Amazon VPC ユーザーガイドの「Amazon VPC とは」を参照してください。

次のセクションには、VPC を AWS SFTP サーバーに接続する方法の手順が示されています。まず、インターフェイス VPC エンドポイントを定義します。これにより、VPC または他の AWS のサービスに接続することができます。このエンドポイントは、インターネットゲートウェイ、ネットワークアドレス変換(NAT) インスタンス、または Virtual Private Network (VPN) 接続を必要とせず、サービスへの信頼性が高くスケーラブルな接続を提供します。詳細については、Amazon VPC ユーザーガイド の「インターフェイス VPC エンドポイント (AWS PrivateLink)」を参照してください。

次のセクションでは、VPC エンドポイントを使用して AWS SFTP サーバーをセットアップする方法を確認することもできます。するさらに、安全なプライベートネットワーク経由でデータを Amazon S3 バケットに転送する方法も確認できます。次に、VPC エンドポイントを通じて VPC 内の SFTP クライアントを使用して、AWS SFTP サーバーに接続できます。これにより、ネットワークがパブリックインターネットから切断されていても、AWS SFTP を使用して、S3 バケットに保存されたデータを SFTP 経由で転送できます。

Important

Amazon VPC からメッセージを送信するように AWS SFTP を設定する場合、ドメインネームシステム (DNS) を有効にして、次の形式でのみエンドポイントのみを使用します:server.transfer.region.amazonaws.com。この形式で、region は使用している AWS リージョンを表します。

トピック• VPC エンドポイントの作成 (p. 32)• SFTP サーバーのエンドポイントタイプの変更 (p. 34)

VPC エンドポイントの作成以下のウォークスルーでは、VPC にあり、パブリックインターネット経由ではアクセスできない SFTPサーバーを作成します。これを行うには、次のステップを実行します。

• VPC エンドポイントを作成します。• SFTP サーバーを作成して設定し、VPC エンドポイントを使用します。

32

Page 37: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドVPC エンドポイントの作成

AWS SFTP の VPC エンドポイントを作成するには

1. AWS マネジメントコンソールにサインインし、Amazon VPC コンソール (https://console.aws.amazon.com/vpc/) を開きます。

2. ナビゲーションペインで [ エンドポイント] を選択し、[Create endpoint (エンドポイントの作成)] を選択します。

3. [Create endpoint (エンドポイントの作成)] ページで、[サービスカテゴリ] の [AWS Services (AWS のサービス)] を選択します。

4. [サービス名] で [com.amazonaws.region.transfer.server] を選択し、[Create endpoint (エンドポイントの作成)] を選択します。

5. [VPC] で、VPC を選択し、そのアベイラビリティーゾーンとサブネットをメモします。6. [プライベート DNS 名を有効にする] が選択されていることを確認します。7. [セキュリティグループ] で、VPC に使用するセキュリティグループを選択します。デフォルトのセ

キュリティグループを使用できます。8. [Create endpoint (エンドポイントの作成)] を選択します。エンドポイントの初期状態は [pending (保留

中)] です。エンドポイントが作成された場合は、作成した VPC エンドポイントの ID をメモしておきます。

9. ナビゲーションペインで、[エンドポイント] を選択し、エンドポイントをコピーします。

これで VPC エンドポイントを作成したので、SFTP サーバーを作成できます。次の手順では、VPC エンドポイントを使用して SFTP サーバーを作成する方法を示します。

VPC エンドポイントを使用して SFTP サーバーを作成するには

1. AWS マネジメントコンソール にサインインし、AWS SFTP コンソール (https://console.aws.amazon.com/transfer/) を開きます。

2. [Create server (サーバーの作成)] を選択します。3. [エンドポイント設定] セクションで、[Endpoint type (エンドポイントタイプ)] の [VPC] を選択し、リ

ストから VPC エンドポイントを選択します。

Note

一度に 1 つの SFTP サーバーに VPC エンドポイントを関連付けることができます。4. [Identity provider (ID プロバイダー)] セクションで、[Service managed (サービスマネージド型)] を選

択してユーザー ID とキーを AWS SFTP に保存します。

このチュートリアルでは、サービスで管理されたオプションを使用します。[Custom (カスタム)] を選択した場合、エンドポイントにアクセスするために API Gateway エンドポイントと IAM ロールを提供します。そうすることで、ディレクトリサービスを統合して SFTP ユーザーの認証と許可を実行できます。カスタム ID プロバイダーの使用に関する詳細については、「ID プロバイダーの使用 (p. 27)」を参照してください。

33

Page 38: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

5. (オプション) [Logging role (ログ記録ロール)] に、Amazon CloudWatch が SFTP ユーザーアクティビティをログ記録できるようにする IAM ロールを選択します。

CloudWatch ログ記録ロールのセットアップの詳細については、「使用状況のモニタリング (p. 36)」を参照してください。

6. (オプション) [Key (キー)] と [Value (値)] には、1 つ以上のタグをキーと値のペアとして入力します。

サーバーにさらにタグを追加するには、[Add tag (タグの追加)] を選択します。7. [Create (作成)] を選択してサーバーを作成します。新しいサーバーが一覧表示されている [Servers

(サーバー)] ページに移動します。エンドポイントタイプが VPC であることに注意してください。

サーバー ID を選択して、作成したサーバーの詳細設定を確認できます。

Note

VPC で作成された SFTP サーバーはカスタムホスト名をサポートしていません。

SFTP サーバーのエンドポイントタイプの変更インターネット経由でアクセス可能な既存の SFTP サーバー (パブリックエンドポイントタイプを持つサーバー) がある場合 、そのエンドポイントを VPC エンドポイントに変更できます。

34

Page 39: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

次の手順では、パブリックエンドポイントタイプを持つ SFTP サーバーがあり、VPC エンドポイントを作成済みであることを前提にしています。まだ VPC エンドポイントを作成していない場合は、作成します。手順については、「AWS SFTP の VPC エンドポイントを作成するには (p. 33)」を参照してください。

SFTP サーバーのエンドポイントタイプを変更するには

1. AWS マネジメントコンソール にサインインし、AWS SFTP コンソール (https://console.aws.amazon.com/transfer/) を開きます。

2. [サーバー] を選択します。3. エンドポイントタイプを変更するサーバーを選択し、[Actions (アクション)] の [Stop (停止)] を選択し

てサーバーを停止します。エンドポイントを変更するには、その前にサーバーを停止する必要があります。

4. サーバーのステータスが [オフライン] になるのを待ちます。ステータスの変更を表示するには、[更新] の選択が必要になる場合があります。

5. サーバー ID を選択し、[編集]、[Endpoint type (エンドポイントタイプ)] の [VPC] の順に選択します。次に、一覧からエンドポイントを選択し、[保存] を選択します。

6. [Actions (アクション)] の [Start (開始)] を選択して、サーバーをオンラインに戻します。サーバーの[Endpoint type (エンドポイントタイプ)] が [VPC] に変わったことに注意してください。

35

Page 40: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCloudTrail ログ記録の有効化

使用状況のモニタリングAmazon CloudWatch と AWS CloudTrail を使用して SFTP サーバーのアクティビティをモニタリングできます。詳細な分析を行うために、SFTP サーバーのアクティビティを読み取り可能な、ほぼリアルタイムのメトリクスとして記録することもできます。

AWS CloudTrail ログ記録の有効化AWS CloudTrail を使用して AWS SFTP API コールをモニタリングできます。API コールをモニタリングすることで、有益なセキュリティ情報や動作情報を取得できます。CloudTrail および AWS SFTP を使用する方法の詳細については、「AWS Transfer for SFTP を使用した AWS CloudTrail API 呼び出しのログ記録 (p. 41)」を参照してください。

CloudWatch でのアクティビティのログ記録アクセスを設定するには、リソースベースの IAM ポリシーと、アクセス情報を提供する IAM ロールを作成します。

Amazon CloudWatch ログ記録を有効にするには、CloudWatch のログ記録を有効にする IAM ポリシーの作成から開始します。次に、IAM ロールを作成して、ポリシーをアタッチします。これは、SFTP サーバーを作成する (p. 8)か、既存の SFTP サーバーを編集する (p. 20)ことで行えます。CloudWatch の詳細については、Amazon CloudWatch ユーザーガイドの「Amazon CloudWatch とは?」および「AmazonCloudWatch ログとは?」を参照してください。

IAM ポリシーを作成するには

• 以下のポリシー例を使用して、CloudWatch ログ記録を許可する独自の IAM ポリシーを作成します。AWS SFTP のポリシーの作成方法については、「SFTP のための IAM ポリシーおよびロールの作成 (p. 4)」を参照してください。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "logs:CreateLogStream", "logs:DescribeLogStreams", "logs:CreateLogGroup", "logs:PutLogEvents" ], "Resource": "*" } ]}

次に、ロールを作成し、作成した CloudWatch Logs ポリシーをアタッチします。

IAM ロールを作成し、ポリシーをアタッチするには

1. ナビゲーションペインで [ロール]、[ロールの作成] の順に選択します。

36

Page 41: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドアクティビティのログ記録

[Create role (ロールの作成)] ページで [AWS service (AWS サービス)] が選択されていることを確認します。

2. サービスリストから [Transfer (転送)] を選択し、[Next: Permissions (次へ: アクセス権限)] を選択します。これにより、AWS Transfer for SFTP と AWS の間で信頼関係が確立されます。

3. [Attach permissions policies (アクセス権限ポリシーをアタッチする)] セクションで、先ほど作成したCloudWatch Logs ポリシーを選択し、[Next: Tags (次へ: タグ)] を選択します。

4. (オプション) タグのキーと値を入力し、[Next: Review (次へ: レビュー)] を選択します。5. [Review (レビュー)] ページで新しいロールの名前と説明を入力し、[Create role (ロールの作成)] を選

択します。6. ログを表示するには、[サーバー ID] を選択してサーバー設定ページを開き、[ログの表示] を選択しま

す。ログストリームを確認できる CloudWatch コンソールにリダイレクトされます。

サーバー用の CloudWatch ページで、ユーザー認証のレコード (成功と失敗)、データアップロード (PUTオペレーション) のレコード、およびデータダウンロード (GET オペレーション) のレコードを表示できます。

37

Page 42: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSSH キーの生成

セキュリティの管理以下のトピックでは、SSH キーを使用する方法と Amazon S3 バケットにデータを安全に保管する方法を取り上げます。SSH キーを生成する方法、SSH キーのローテーションを実行する方法、保存した AmazonS3 データを暗号化する方法については、こちらを参照してください。

トピック• SSH キーの生成 (p. 38)• SSH キーのローテーション (p. 39)• データの暗号化 (p. 41)• AWS Transfer for SFTP を使用した AWS CloudTrail API 呼び出しのログ記録 (p. 41)

SSH キーの生成SFTP サーバーをセットアップする際、サービスで管理された認証方法でユーザーを認証するよう設定できます。この方法では、ユーザー名と SSH キーは、サービスに保存されます。ユーザーのパブリックSSH キーは、ユーザーのプロパティとして SFTP サーバーにアップロードされます。ユーザーがファイル転送をリクエストすると、SFTP クライアントによってユーザー名とプライベートキーが SFTP サーバーへと送信され、そこで検証されます。検証後、SFTP ファイル操作が行われます。各ユーザーに対し、個々のサーバーに複数のパブリック SSH キーを登録できます。各ユーザーに対して保存できるキーの上限数については、AWS 全般のリファレンスにある「AWS Transfer for SFTP Limits」を参照してください。

SFTP サーバーでは、ユーザーの認証に 1 つのメソッドしか使えず、サーバーの作成後にメソッドを変更することはできません。SSH キーの代わりに、カスタム ID プロバイダーを使ってユーザーを認証する方法もあります。この方法なら、API Gateway エンドポイントを使って既存の ID プロバイダーをプラグインすることができます。このトピックの詳細については、「カスタム ID プロバイダーの使用 (p. 27)」を参照してください。

SSH キーペアを作成する方法は複数あります。macOS、Linux、UNIX の各オペレーティングシステムでは、コマンドラインインターフェイスで ssh-keygen コマンドを使用して作成できます。以下のコマンドを使った ssh-keygen の出力例をご紹介します。

ssh-keygen -P "" -f key_name

38

Page 43: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドWindows での SSH キーの作成

上記の ssh-keygen コマンドを実行すると、現在のディレクトリにパブリックキーとプライベートキーが作成されます。

Windows での SSH キーの作成Windows で使用される SSH キーペア形式は、わずかに異なります。パブリックキーは PUB 形式、プライベートキーは PPK 形式である必要があります。Windows では、PuTTYgen を使用すれば正しい形式のSSH キーペアが作成できます。PuTTYgen を使用して、ssh-keygen で生成されたプライベートキーをPPK ファイルに変換することもできます。PPK 形式でないプライベートキーファイルを WinSCP に提示した場合、SFTP クライアントによって PPK 形式への変換が提案されます。

Windows で PuTTYgen を使用して SSH キーを作成する方法のチュートリアルは、SSH.com ウェブサイトにあります。

SSH キーのローテーションセキュリティのためのベストプラクティスとして、SSH キーのローテーションをお勧めします。通常、このローテーションは、セキュリティポリシーの一部として指定され、自動化した形で実装されます。セキュリティのレベルに応じて、機密性の高い通信では、SSH キーペアが 1 回しか使用されない場合もあります。これにより、キーを保存することのリスクがなくなります。ただし一般的には、SSH 認証情報を一定期間にわたって保存し、その期間を SFTP ユーザーに過度の負荷がかからないような長さに設定するのが普通です。標準的な設定は 3 か月です。

SSH キーのローテーションを実行するには、2 つの方法があります。

• ユーザーが 1 人の場合、コンソールで SSH パブリックキーを削除し、新しい SSH パブリックキーをアップロードすることができます。

• ユーザーが複数の場合は、UpdateUsers API コマンドと JSON ファイルを使って既存のユーザーを更新することができます。

ユーザーが 1 人の場合にキーローテーションを実行するには、以下の手順を実行します。

1. [Servers (サーバー)] ページで、SSH パブリックキーを置き換えるユーザーが属するサーバーを選択します。

以下のように、そのユーザーのページが開きます。

39

Page 44: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSSH キーのローテーション

2. ローテーションする SSH パブリックキー (フィンガープリント) を選択し、[Delete (削除)] を選択します。

3. [削除の確認] に delete という単語を入力して削除操作を確認し、以下のように [Delete (削除)] を選択します。

4. [SSH パブリックキーの追加] を選択すると、次のような [キーの追加] 画面が開きます。

[User Configuration (ユーザー設定)] 画面に戻ると、アップロードしたばかりの SSH パブリックキーが SSH パブリックキーセクションに表示されます。

複数のユーザーに対して SSH パブリックキーのローテーションを実行するには、適切な JSON データファイルを準備し、UpdateUser API コマンドを発行します。

40

Page 45: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドデータの暗号化

データの暗号化AWS Transfer for SFTP は、Amazon S3 に対して設定したデフォルトの暗号化オプションを使ってデータを暗号化します。バケットで暗号化を有効にすると、バケットに保存されるすべてのオブジェクトが暗号化されます。オブジェクトは、Amazon S3 で管理されたキー (SSE-S3) と AWS KMS で管理されたキー(SSE-KMS) のいずれかで、サーバー側の暗号化を使って暗号化されます。サーバー側の暗号化の詳細については、Amazon Simple Storage Service 開発者ガイド の「サーバー側の暗号化を使用したデータの保護」を参照してください。

以下の手順では、AWS Transfer for SFTP でデータを暗号化する方法を示します。

AWS SFTP での暗号化を許可するには、次の手順を実行します。

1. Amazon S3 バケットに対してデフォルト暗号化を有効にします。手順については、Amazon SimpleStorage Service 開発者ガイド の「S3 バケットのデフォルト暗号化を有効にする方法」を参照してください。

2. SFTP ユーザーにアタッチされた Key Management Service (KMS) アクセス許可を付与するためのIdentity and Access Management (IAM) ロールポリシーを更新します。

3. ユーザーにスコープダウンポリシーを使用する場合、スコープダウンポリシーで必要な KMS アクセス許可を付与する必要があります。

以下の例に示しているのは、KMS 暗号化に対して有効になっている Amazon S3 バケットで AWSTransfer for SFTP を使用するときに必要となる最低限のアクセス許可を付与する IAM ポリシーです。このポリシー例は、IAM ロールポリシーおよびスコープダウンポリシー (使用している場合) の両方に含めます。

{ "Sid": "Stmt1544140969635", "Action": [ "kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKey" ], "Effect": "Allow", "Resource": "arn:aws:kms:region:account-id:key/kms-key-id"}

Note

このポリシーで指定する KMS キー ID は、ステップ 1 でデフォルト暗号化のために指定したものと同じである必要があります。この KMS キーポリシーでは、ルートを許可する必要があります。KMS キーポリシーでルートが許可されていない場合は、SFTP ユーザーに使用される IAM ロールを直接 KMS キーポリシーに追加できます。KMS キーポリシーについては、AWS Key Management Service Developer Guideの「AWS KMS でのキーポリシーの使用」を参照してください。

AWS Transfer for SFTP を使用した AWSCloudTrail API 呼び出しのログ記録

AWS Transfer for SFTP は、AWS CloudTrail のユーザーやロール、または AWS のサービスによって実行されたアクションを記録するサービスである AWS Transfer for SFTP と統合されています。CloudTrailは、AWS Transfer for SFTP のすべての API コールをイベントとしてキャプチャします。キャプチャされた呼び出しには、AWS Transfer for SFTP コンソールの呼び出しと、AWS Transfer for SFTP API オペレー

41

Page 46: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCloudTrail 内の AWS Transfer for SFTP 情報

ションへのコード呼び出しが含まれます。証跡を作成する場合は、AWS Transfer for SFTP のイベントなど、Amazon S3 バケットへの CloudTrail イベントの継続的な配信を有効にすることができます。証跡を設定しない場合でも、CloudTrail コンソールの [Event history (イベント履歴)] で最新のイベントを表示できます。CloudTrail によって収集された情報を使用して、リクエストの作成元の IP アドレス、リクエストの実行者、リクエストの実行日時などの詳細を調べて、AWS Transfer for SFTP に対してどのようなリクエストが行われたかを判断できます。

CloudTrail の詳細については、「AWS CloudTrail User Guide」を参照してください。

CloudTrail 内の AWS Transfer for SFTP 情報CloudTrail は、アカウント作成時に AWS アカウントで有効になります。AWS Transfer for SFTP でアクティビティが発生すると、そのアクティビティは [Event history (イベント履歴)] の AWS の他のサービスのイベントとともに CloudTrail イベントに記録されます。最近のイベントは、AWS アカウントで表示、検索、ダウンロードできます。詳細については、「CloudTrail イベント履歴でのイベントの表示」を参照してください。

AWS Transfer for SFTPのイベントなど、AWS アカウントのイベントの継続的な記録については、証跡を作成します。証跡により、CloudTrail はログファイルを Amazon S3 バケットに配信できます。デフォルトでは、コンソールで作成した証跡がすべての AWS リージョンに適用されます。証跡では、AWS パーティションのすべてのリージョンからのイベントがログに記録され、指定した Amazon S3 バケットにログファイルが配信されます。さらに、より詳細な分析と AWS ログで収集されたデータに基づいた行動のためにその他の CloudTrail サービスを設定できます。詳細については、以下を参照してください。

• 証跡を作成するための概要• CloudTrail でサポートされるサービスと統合• CloudTrail の Amazon SNS 通知の設定• 「複数のリージョンから CloudTrail ログファイルを受け取る」と「複数のアカウントから CloudTrail ロ

グファイルを受け取る」

すべての AWS Transfer for SFTP アクションは CloudTrail によってログに記録され、Actions API リファレンスにドキュメント化されます。たとえば、、CreateServer、ListUsers、および StopServer の各アクションを呼び出すと、CloudTrail ログファイルにエントリが生成されます。

各イベントまたはログエントリには、リクエストの生成者に関する情報が含まれます。この ID 情報は以下のことを確認するのに役立ちます。

• リクエストが、ルートまたは AWS Identity and Access Management (IAM) ユーザー認証情報のどちらを使用して送信されたかどうか。

• リクエストが、ロールとフェデレーティッドユーザーのどちらの一時的なセキュリティ認証情報を使用して送信されたか.

• リクエストが、別の AWS サービスによって送信されたかどうか。

詳細については、「CloudTrail userIdentity 要素」を参照してください。

AWS Transfer for SFTP ログファイルエントリの概要証跡は、指定した Amazon S3 バケットにイベントをログファイルとして配信できる設定です。CloudTrailログファイルには、1 つ以上のログエントリが含まれます。イベントは任意の送信元からの単一のリクエストを表し、リクエストされたアクション、アクションの日時、リクエストのパラメータなどに関する情報が含まれます。CloudTrail ログファイルは、パブリック API コールの順序付けられたスタックトレースではないため、特定の順序では表示されません。

以下の例は、CreateServer アクションの CloudTrail ログエントリを示しています。

42

Page 47: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドAWS Transfer for SFTP ログファイルエントリの概要

{

"eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AROAIT4AUHMXGO43AJKU4:user1", "arn": "arn:aws:sts::123456789102:assumed-role/Admin/user1", "accountId": "123456789102", "accessKeyId": "AAAA52C2WWWWWW3BB4Z", "sessionContext": { "attributes": { "mfaAuthenticated": "false", "creationDate": "2018-12-18T20:03:57Z" }, "sessionIssuer": { "type": "Role", "principalId": "AROAIT4AUHMXGO43AJKU4", "arn": "arn:aws:iam::123456789102:role/Admin", "accountId": "123456789102", "userName": "Admin" } } }, "eventTime": "2018-12-18T20:30:05Z", "eventSource": "transfer.amazonaws.com", "eventName": "CreateServer", "awsRegion": "us-east-2", "sourceIPAddress": "11.22.1.2", "userAgent": "aws-internal/3 aws-sdk-java/1.11.462 Linux/4.9.124-0.1.ac.198.73.329.metal1.x86_64 OpenJDK_64-Bit_Server_VM/25.192-b12 java/1.8.0_192", "requestParameters": { "loggingRole": "arn:aws:iam::123456789102:role/sftp-role" }, "responseElements": { "serverId": "s-b6118b5f29a04a9e8" }, "requestID": "5f348905-7b83-4527-920f-ec8e6088ffd5", "eventID": "82360721-d3db-4acc-b5dc-14c58c1e9899", "eventType": "AwsApiCall", "recipientAccountId": "123456789102"

},

43

Page 48: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドようこそ

API リファレンス以下のセクションでは、AWS SFTP API サービス呼び出し、データ型、パラメータ、およびエラーについて説明します。AWS SFTP API で使用する API のエンティティおよび規則の詳細については、「AWSTransfer for SFTP API へようこそ (p. 44)」セクションを参照してください。

トピック• AWS Transfer for SFTP API へようこそ (p. 44)• Actions (p. 45)• Data Types (p. 108)• Common Parameters (p. 124)• Common Errors (p. 126)

AWS Transfer for SFTP API へようこそAWS Transfer for SFTP は、Secure File Transfer Protocol (SFTP) を使用して Amazon Simple StorageService (Amazon S3) との間でファイルを直接転送できる、フルマネージド型サービスです。AWS 転送は、外部のパートナーおよび顧客に中断が生じずに、SFTP ベースのファイル転送ワークフローを AWSに移行するのに役立ちます。

AWS SFTP サービスを使用するには、任意のリージョンで SFTP サーバーをインスタンス化します。サーバーを作成して、使用可能なサーバーを一覧表示し、サーバーを更新および削除できます。サーバーは、AWS SFTP サービスからファイル操作をリクエストするエンティティです。サーバーには、多くの重要なプロパティが含まれています。サーバーは、システムにより割り当てられた ServerId 識別子によって識別される名前付きインスタンスです。必要に応じて、ホスト名や、カスタムホスト名もサーバーに割り当てることができます。サービスでは、すべてのインスタンス化されたサーバー (ONLINE 以外も含む)および転送されたデータの量に対して請求を行います。

SFTP ユーザーは、ファイル操作をリクエストする SFTP ユーザーが認識している必要があります。ユーザー名によって識別されるユーザーがサーバーに割り当てられます。ユーザー名は、リクエストの認証に使用されます。サーバーの認証方法として、SERVICE_MANAGED または API_GATEWAY の 1 つだけを指定できます。SERVICE_MANAGED を指定した場合は、SSH パブリックキーは SFTP サーバーにユーザーのプロパティと共に保存されます。ユーザーは、SERVICE_MANAGED 認証方法に 1 つ以上の SSH パブリックキーを登録できます。SFTP クライアントが SERVICE_MANAGED メソッドのファイル操作をリクエストする場合、SFTP クライアントがユーザー名とSSH プライベートキーを提供することで、認証され、アクセスが提供されます。

ユーザー認証とアクセスの両方を提供するカスタム認証方法を使用すると、ユーザーリクエストも認証できます。このメソッドは Amazon API Gateway に依存しており、ID プロバイダーからの API 呼び出しを使用して、ユーザーリクエストを検証します。このメソッドは、API コールでは API_GATEWAY と呼ばれ、コンソールでは [Custom] と呼ばれます。このカスタムメソッドを使用して、ディレクトリサービス、データベース名とパスワードのペア、またはその他のメカニズムに対してユーザーを認証できる場合があります。

SFTP ユーザーには、ユーザー自身と Amazon S3 バケット間の信頼関係が含まれているポリシーが割り当てられます。SFTP ユーザーは、バケットのすべてまたは一部にアクセスできる可能性があります。ユーザーに変わって SFTP サーバーが機能するためには、サーバーがユーザーから信頼関係を継承する必要があります。信頼関係を含んでいる IAM ロールが作成され、そのロールが AssumeRole> アクションに割り当てられます。SFTP サーバーは、ユーザーと同様にファイル操作を実行できるようになります。homeディレクトリのプロパティセットを持つユーザーの場合、そのディレクトリ (またはフォルダ) は SFTP

44

Page 49: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドActions

ファイル操作のターゲットおよびソースとして機能します。home ディレクトリが設定されていない場合は、バケットの root ディレクトリがランディングディレクトリになります。

サーバー、ユーザー、およびロールはすべて、Amazon リソースナンバー (ARN) で識別されます。ARNが含まれているエンティティのキーと値のペアであるタグを割り当てることができ、そのタグは、これらのエンティティのグループ化または検索に使用できるメタデータです。タグが便利な例としては、経理上の処理が挙げられます。

AWS SFTP ID 形式では、以下の規則に従います。

• ServerId 値の形式は s-01234567890abcdef です。• PublicKeyId 値の形式は key-12345678 です。• UserId 値の形式は user-12345678 です

Amazon リソースナンバー (ARN) は次のような形式になります。

• サーバーの場合、Amazon リソースネーム (ARN) の形式は arn:aws:transfer:region:account-id:server/server-id/ です。

サーバー ARN の例: arn:aws:transfer:us-east-1:123456789012:server/s-01234567890abcdef

• ユーザーの場合、ARN の形式は arn:aws:transfer:region:account-id:user/server-id/username です。

例: 「arn:aws:transfer:us-east-1:123456789012:user/s-01234567890abcdef/user1」。

使用する DNS エントリ (エンドポイント):

• API エンドポイントの形式は transfer.region.amazonaws.com です。• プロトコルエンドポイントの形式は server.transfer.region.amazonaws.com です• サーバーエンドポイントの形式は server.transfer.region.amazonaws.com です。

この AWS SFTP の API インターフェイスリファレンスには、AWS SFTP を管理するために使用できるプログラミングインターフェイスのドキュメントが含まれます。リファレンス構造は次のとおりです。

• API アクションのアルファベット順リストについては、「API アクション」を参照してください。• データ型のアルファベット順リストについては、「データ型」を参照してください。• 共通クエリパラメータのリストについては、「共通パラメータ」を参照してください。• エラーコードの説明については、「共通エラー」を参照してください。

ActionsThe following actions are supported:

• CreateServer (p. 47)• CreateUser (p. 52)• DeleteServer (p. 58)• DeleteSshPublicKey (p. 60)• DeleteUser (p. 63)• DescribeServer (p. 65)• DescribeUser (p. 68)

45

Page 50: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドActions

• ImportSshPublicKey (p. 72)• ListServers (p. 76)• ListTagsForResource (p. 79)• ListUsers (p. 82)• StartServer (p. 86)• StopServer (p. 88)• TagResource (p. 90)• TestIdentityProvider (p. 93)• UntagResource (p. 97)• UpdateServer (p. 99)• UpdateUser (p. 104)

46

Page 51: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateServer

CreateServerInstantiates an autoscaling virtual server based on the selected file transfer protocol in AWS. When youmake updates to your file transfer protocol-enabled server or when you work with users, use the service-generated ServerId property that is assigned to the newly created server.

Request Syntax

{ "Certificate": "string", "EndpointDetails": { "AddressAllocationIds": [ "string" ], "SubnetIds": [ "string" ], "VpcEndpointId": "string", "VpcId": "string" }, "EndpointType": "string", "HostKey": "string", "IdentityProviderDetails": { "InvocationRole": "string", "Url": "string" }, "IdentityProviderType": "string", "LoggingRole": "string", "Protocols": [ "string" ], "Tags": [ { "Key": "string", "Value": "string" } ]}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

Certificate (p. 47)

The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required whenProtocols is set to FTPS.

Type: String

Length Constraints: Maximum length of 1600.

Required: NoEndpointDetails (p. 47)

The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabled server. When you host your endpoint within your VPC, you can make it accessible only toresources within your VPC, or you can attach Elastic IPs and make it accessible to clients over theinternet. Your VPC's default security groups are automatically assigned to your endpoint.

Type: EndpointDetails (p. 115) object

Required: No

47

Page 52: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateServer

EndpointType (p. 47)

The type of VPC endpoint that you want your file transfer protocol-enabled server to connect to. Youcan choose to connect to the public internet or a virtual private cloud (VPC) endpoint. With a VPCendpoint, you can restrict access to your server and resources only within your VPC.

Type: String

Valid Values: PUBLIC | VPC | VPC_ENDPOINT

Required: NoHostKey (p. 47)

The RSA private key as generated by the ssh-keygen -N "" -m PEM -f my-new-server-keycommand.

Important

If you aren't planning to migrate existing users from an existing SFTP-enabled server to a newserver, don't update the host key. Accidentally changing a server's host key can be disruptive.

For more information, see Changing the Host Key for Your AWS Transfer Family Server in the AWSTransfer Family User Guide.

Type: String

Length Constraints: Maximum length of 4096.

Required: NoIdentityProviderDetails (p. 47)

Required when IdentityProviderType is set to API_GATEWAY. Accepts an array containing allof the information required to call a customer-supplied authentication API, including the API GatewayURL. Not required when IdentityProviderType is set to SERVICE_MANAGED.

Type: IdentityProviderDetails (p. 118) object

Required: NoIdentityProviderType (p. 47)

Specifies the mode of authentication for a file transfer protocol-enabled server. The default valueis SERVICE_MANAGED, which allows you to store and access user credentials within the AWSTransfer Family service. Use the API_GATEWAY value to integrate with an identity provider of yourchoosing. The API_GATEWAY setting requires you to provide an API Gateway endpoint URL to call forauthentication using the IdentityProviderDetails parameter.

Type: String

Valid Values: SERVICE_MANAGED | API_GATEWAY

Required: NoLoggingRole (p. 47)

Allows the service to write your users' activity to your Amazon CloudWatch logs for monitoring andauditing purposes.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

48

Page 53: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateServer

Required: NoProtocols (p. 47)

Specifies the file transfer protocol or protocols over which your file transfer protocol client can connectto your server's endpoint. The available protocols are:• Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over SSH• File Transfer Protocol Secure (FTPS): File transfer with TLS encryption• File Transfer Protocol (FTP): Unencrypted file transfer

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: SFTP | FTP | FTPS

Required: NoTags (p. 47)

Key-value pairs that can be used to group and search for file transfer protocol-enabled servers.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: No

Response Syntax

{ "ServerId": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 49)

The service-assigned ID of the file transfer protocol-enabled server that is created.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

AccessDeniedException

You do not have sufficient access to perform this action.

49

Page 54: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateServer

HTTP Status Code: 400InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceExistsException

The requested resource does not exist.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExampleThe following example creates a new file transfer protocol-enabled server using a VPC_ENDPOINT.

Sample Request

{ "EndpointDetails": { "AddressAllocationIds": [ "eipalloc-01a2eabe3c04d5678", "eipalloc-102345be" ], "SubnetIds": [ "subnet-045eaa6f0789a7cde", "subnet-0a1d0f222daffde11" ], "EndpointType": "VPC_ENDPOINT", "HostKey": "Your RSA private key", "IdentityProviderDetails": "IdentityProvider", "IdentityProviderType": "SERVICE_MANAGED", "LoggingRole": "CloudWatchLoggingRole", "Tags": [ { "Key": "Name", "Value": "MySFTPServer" } ]}

50

Page 56: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateUser

CreateUserCreates a user and associates them with an existing file transfer protocol-enabled server. Youcan only create and associate users with servers that have the IdentityProviderType set toSERVICE_MANAGED. Using parameters for CreateUser, you can specify the user name, set the homedirectory, store the user's public key, and assign the user's AWS Identity and Access Management (IAM)role. You can also optionally add a scope-down policy, and assign metadata with tags that can be used togroup and search for users.

Request Syntax

{ "HomeDirectory": "string", "HomeDirectoryMappings": [ { "Entry": "string", "Target": "string" } ], "HomeDirectoryType": "string", "Policy": "string", "Role": "string", "ServerId": "string", "SshPublicKeyBody": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

HomeDirectory (p. 52)

The landing directory (folder) for a user when they log in to the file transfer protocol-enabled serverusing the client.

An example is your-Amazon-S3-bucket-name>/home/username.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^$|/.*

Required: NoHomeDirectoryMappings (p. 52)

Logical directory mappings that specify what Amazon S3 paths and keys should be visible to youruser and how you want to make them visible. You will need to specify the "Entry" and "Target" pair,where Entry shows how the path is made visible and Target is the actual Amazon S3 path. If you

52

Page 57: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateUser

only specify a target, it will be displayed as is. You will need to also make sure that your AWS IAM Roleprovides access to paths in Target. The following is an example.

'[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf","Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]'

In most cases, you can use this value instead of the scope-down policy to lock your user down tothe designated home directory ("chroot"). To do this, you can set Entry to '/' and set Target to theHomeDirectory parameter value.

Note

If the target of a logical directory entry does not exist in Amazon S3, the entry will be ignored.As a workaround, you can use the Amazon S3 api to create 0 byte objects as place holdersfor your directory. If using the CLI, use the s3api call instead of s3 so you can use the put-object operation. For example, you use the following: aws s3api put-object --bucketbucketname --key path/to/folder/. Make sure that the end of the key name ends in a'/' for it to be considered a folder.

Type: Array of HomeDirectoryMapEntry (p. 117) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoHomeDirectoryType (p. 52)

The type of landing directory (folder) you want your users' home directory to be when they log into thefile transfer protocol-enabled server. If you set it to PATH, the user will see the absolute Amazon S3bucket paths as is in their file transfer protocol clients. If you set it LOGICAL, you will need to providemappings in the HomeDirectoryMappings for how you want to make Amazon S3 paths visible toyour users.

Type: String

Valid Values: PATH | LOGICAL

Required: NoPolicy (p. 52)

A scope-down policy for your user so you can use the same IAM role across multiple users. Thispolicy scopes down user access to portions of their Amazon S3 bucket. Variables that you canuse inside this policy include ${Transfer:UserName}, ${Transfer:HomeDirectory}, and${Transfer:HomeBucket}.

Note

For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead ofthe Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob andpass it in the Policy argument.For an example of a scope-down policy, see Creating a Scope-Down Policy.For more information, see AssumeRole in the AWS Security Token Service API Reference.

Type: String

Length Constraints: Maximum length of 2048.

Required: NoRole (p. 52)

The IAM role that controls your users' access to your Amazon S3 bucket. The policies attached to thisrole will determine the level of access you want to provide your users when transferring files into and

53

Page 58: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateUser

out of your Amazon S3 bucket or buckets. The IAM role should also contain a trust relationship thatallows the file transfer protocol-enabled server to access your resources when servicing your users'transfer requests.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: YesServerId (p. 52)

A system-assigned unique identifier for a file transfer protocol-enabled server instance. This is thespecific server that you added your user to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesSshPublicKeyBody (p. 52)

The public portion of the Secure Shell (SSH) key used to authenticate the user to the file transferprotocol-enabled server.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: ^ssh-rsa\s+[A-Za-z0-9+/]+[=]{0,3}(\s+.+)?\s*$

Required: NoTags (p. 52)

Key-value pairs that can be used to group and search for users. Tags are metadata attached to usersfor any purpose.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoUserName (p. 52)

A unique string that identifies a user and is associated with a file transfer protocol-enabled server asspecified by the ServerId. This user name must be a minimum of 3 and a maximum of 32 characterslong. The following are valid characters: a-z, A-Z, 0-9, underscore, and hyphen. The user name can'tstart with a hyphen.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

54

Page 59: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateUser

Response Syntax

{ "ServerId": "string", "UserName": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 55)

The ID of the file transfer protocol-enabled server that the user is attached to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$UserName (p. 55)

A unique string that identifies a user account associated with a file transfer protocol-enabled server.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceExistsException

The requested resource does not exist.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400

55

Page 60: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCreateUser

ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExampleThe following example associates a user with a file transfer protocol-enabled server.

Sample Request

{ "HomeDirectory": "/bucket_name/home/mydirectory", "HomeDirectoryMappings": [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ], "HomeDirectoryType:"PATH", "Policy": { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowFullAccessToBucket", "Action": [ "s3:*" ], "Effect": "Allow", "Resource": [ "arn:aws:s3:::bucket_name", "arn:aws:s3:::bucket_name/*" ] } ] }, "SshPublicKeyBody": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCOtfCAis3aHfM6yc8KWAlMQxVDBHyccCde9MdLf4DQNXn8HjAHf+Bc1vGGCAREFUL1NO2PEEKING3ALLOWEDfIf+JBecywfO35Cm6IKIV0JF2YOPXvOuQRs80hQaBUvQL9xw6VEb4xzbit2QB6", "Role": "arn:aws:iam::176354371281:role/SFTP_role", "ServerId": "s-01234567890abcdef", "Tags": [ { "Key": "Group", "Value": "UserGroup1" } ], "UserName": "sftp_user"}

Example

Sample Response

{ "ServerId": "s-01234567890abcdef"

56

Page 62: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteServer

DeleteServerDeletes the file transfer protocol-enabled server that you specify.

No response returns from this operation.

Request Syntax{ "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 58)

A unique system-assigned identifier for a file transfer protocol-enabled server instance.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 400InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

58

Page 63: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteServer

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following example deletes a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef"}

Example

Sample Response

{}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

59

Page 64: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteSshPublicKey

DeleteSshPublicKeyDeletes a user's Secure Shell (SSH) public key.

No response is returned from this operation.

Request Syntax{ "ServerId": "string", "SshPublicKeyId": "string", "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 60)

A system-assigned unique identifier for a file transfer protocol-enabled server instance that has theuser assigned to it.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesSshPublicKeyId (p. 60)

A unique identifier used to reference your user's specific SSH key.

Type: String

Length Constraints: Fixed length of 21.

Pattern: ^key-[0-9a-f]{17}$

Required: YesUserName (p. 60)

A unique string that identifies a user whose public key is being deleted.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

60

Page 65: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteSshPublicKey

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

Example

The following example deletes a user's SSH public key.

Sample Request

{ "ServerId": "s-01234567890abcdef" "SshPublicKeyId": "MyPublicKey" "UserName": "sftp_user"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript

61

Page 67: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteUser

DeleteUserDeletes the user belonging to a file transfer protocol-enabled server you specify.

No response returns from this operation.Note

When you delete a user from a server, the user's information is lost.

Request Syntax{ "ServerId": "string", "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 63)

A system-assigned unique identifier for a file transfer protocol-enabled server instance that has theuser assigned to it.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesUserName (p. 63)

A unique string that identifies a user that is being deleted from a file transfer protocol-enabled server.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

63

Page 68: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDeleteUser

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

Example

The following example deletes a user account assigned to a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef" "UserNames": "sftp_user"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

64

Page 69: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeServer

DescribeServerDescribes a file transfer protocol-enabled server that you specify by passing the ServerId parameter.

The response contains a description of a server's properties. When you set EndpointType to VPC, theresponse will contain the EndpointDetails.

Request Syntax

{ "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 65)

A system-assigned unique identifier for a file transfer protocol-enabled server.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response Syntax

{ "Server": { "Arn": "string", "Certificate": "string", "EndpointDetails": { "AddressAllocationIds": [ "string" ], "SubnetIds": [ "string" ], "VpcEndpointId": "string", "VpcId": "string" }, "EndpointType": "string", "HostKeyFingerprint": "string", "IdentityProviderDetails": { "InvocationRole": "string", "Url": "string" }, "IdentityProviderType": "string", "LoggingRole": "string", "Protocols": [ "string" ], "ServerId": "string", "State": "string", "Tags": [ { "Key": "string", "Value": "string"

65

Page 70: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeServer

} ], "UserCount": number }}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Server (p. 65)

An array containing the properties of a file transfer protocol-enabled server with the ServerID youspecified.

Type: DescribedServer (p. 109) object

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following example returns the properties assigned to a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef"}

66

Page 71: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeServer

Example

Sample Response

{ "Server": { "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef", "EndpointDetails": { "AddressAllocationIds": [ "eipalloc-01a2eabe3c04d5678", "eipalloc-102345be" ], "SubnetIds": [ "subnet-047eaa7f0187a7cde", "subnet-0a2d0f474daffde18" ], "VpcEndpointId": "vpce-03fe0080e7cb008b8", "VpcId": "vpc-09047a51f1c8e1634" }, "EndpointType": "VPC", "HostKeyFingerprint": "your host key, "IdentityProviderType": "SERVICE_MANAGED", "ServerId": "s-01234567890abcdef", "State": "ONLINE", "Tags": [], "UserCount": 0 }}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

67

Page 72: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeUser

DescribeUserDescribes the user assigned to the specific file transfer protocol-enabled server, as identified by itsServerId property.

The response from this call returns the properties of the user associated with the ServerId value that wasspecified.

Request Syntax{ "ServerId": "string", "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 68)

A system-assigned unique identifier for a file transfer protocol-enabled server that has this userassigned.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesUserName (p. 68)

The name of the user assigned to one or more file transfer protocol-enabled servers. User names arepart of the sign-in credentials to use the AWS Transfer Family service and perform file transfer tasks.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

Response Syntax{ "ServerId": "string", "User": { "Arn": "string", "HomeDirectory": "string", "HomeDirectoryMappings": [ { "Entry": "string", "Target": "string" }

68

Page 73: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeUser

], "HomeDirectoryType": "string", "Policy": "string", "Role": "string", "SshPublicKeys": [ { "DateImported": number, "SshPublicKeyBody": "string", "SshPublicKeyId": "string" } ], "Tags": [ { "Key": "string", "Value": "string" } ], "UserName": "string" }}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 68)

A system-assigned unique identifier for a file transfer protocol-enabled server that has this userassigned.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$User (p. 68)

An array containing the properties of the user account for the ServerID value that you specified.

Type: DescribedUser (p. 112) object

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

69

Page 74: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribeUser

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following example returns the properties assigned to a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef" "UserName": "sftp_user"}

Example

Sample Response

{ "User": { "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef" "HomeDirectory": "/home/mydirectory", "HomeDirectoryType:" "PATH", "Role": "arn:aws:iam::176354371281:role/SFTP_role", "SshPublicKeys": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCOtfCAis3aHfM6yc8KWAlMQxVDBHyccCde9MdLf4DQNXn8HjAHf+Bc1vGGCAREFUL1NO2PEEKING3ALLOWEDfIf+JBecywfO35Cm6IKIV0JF2YOPXvOuQRs80hQaBUvQL9xw6VEb4xzbit2QB6", "Tags": [ { "Key": "Name", "Value": "MySFTPServer" } "UserName": "sftp_user", ] }}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript

70

Page 76: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドImportSshPublicKey

ImportSshPublicKeyAdds a Secure Shell (SSH) public key to a user account identified by a UserName value assigned to thespecific file transfer protocol-enabled server, identified by ServerId.

The response returns the UserName value, the ServerId value, and the name of the SshPublicKeyId.

Request Syntax{ "ServerId": "string", "SshPublicKeyBody": "string", "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 72)

A system-assigned unique identifier for a file transfer protocol-enabled server.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesSshPublicKeyBody (p. 72)

The public key portion of an SSH key pair.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: ^ssh-rsa\s+[A-Za-z0-9+/]+[=]{0,3}(\s+.+)?\s*$

Required: YesUserName (p. 72)

The name of the user account that is assigned to one or more file transfer protocol-enabled servers.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

Response Syntax{

72

Page 77: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドImportSshPublicKey

"ServerId": "string", "SshPublicKeyId": "string", "UserName": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 72)

A system-assigned unique identifier for a file transfer protocol-enabled server.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$SshPublicKeyId (p. 72)

The name given to a public key by the system that was imported.

Type: String

Length Constraints: Fixed length of 21.

Pattern: ^key-[0-9a-f]{17}$UserName (p. 72)

A user name assigned to the ServerID value that you specified.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceExistsException

The requested resource does not exist.

HTTP Status Code: 400

73

Page 78: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドImportSshPublicKey

ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExample

The following example returns the properties assigned to a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef" "SshPublicKeyBody": "AAAAB3NzaC1yc2EAAAADAQABAAABAQCOtfCAis3aHfM6yc8KWAlMQxVDBHyccCde9MdLf4DQNXn8HjAHf+Bc1vGGCAREFUL1NO2PEEKING3ALLOWEDfIf+JBecywfO35Cm6IKIV0JF2YOPXvOuQRs80hQaBUvQL9xw6VEb4xzbit2QB6", "UserName": "sftp_user"}

Example

Sample Response

{ "User": { "ServerId": "s-01234567890abcdef", "SshPublicKeyId": "MySSHPublicKey" "UserName": "sftp_user", }}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++

74

Page 80: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListServers

ListServersLists the file transfer protocol-enabled servers that are associated with your AWS account.

Request Syntax

{ "MaxResults": number, "NextToken": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

MaxResults (p. 76)

Specifies the number of file transfer protocol-enabled servers to return as a response to theListServers query.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: NoNextToken (p. 76)

When additional results are obtained from theListServers command, a NextToken parameter isreturned in the output. You can then pass the NextToken parameter in a subsequent command tocontinue listing additional file transfer protocol-enabled servers.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.

Required: No

Response Syntax

{ "NextToken": "string", "Servers": [ { "Arn": "string", "EndpointType": "string", "IdentityProviderType": "string", "LoggingRole": "string", "ServerId": "string", "State": "string", "UserCount": number } ]}

76

Page 81: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListServers

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken (p. 76)

When you can get additional results from the ListServers operation, a NextToken parameter isreturned in the output. In a following command, you can pass in the NextToken parameter to continuelisting additional file transfer protocol-enabled servers.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.Servers (p. 76)

An array of file transfer protocol-enabled servers that were listed.

Type: Array of ListedServer (p. 119) objects

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidNextTokenException

The NextToken parameter that was passed is invalid.

HTTP Status Code: 400InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following example lists the file transfer protocol-enabled servers that exist in your AWS account.

Sample Request

{

77

Page 82: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListServers

"MaxResults": 100, "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b1X0cnVuU2F0ZV9hbW91bnQiOiAyfQ=="}

Example

Sample Response

{ "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b1X0cnVuU2F0ZV9hbW91bnQiOiAyfQ==", "Servers": [ { "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef", "LoggingRole": "CloudWatchLoggingRole", "ServerId": "s-01234567890abcdef", "State": "ONLINE", "Tags": [ { "Key": "Name", "Value": "MySFTPServer" } ] } ]}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

78

Page 83: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListTagsForResource

ListTagsForResourceLists all of the tags associated with the Amazon Resource Number (ARN) you specify. The resource can bea user, server, or role.

Request Syntax{ "Arn": "string", "MaxResults": number, "NextToken": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

Arn (p. 79)

Requests the tags associated with a particular Amazon Resource Name (ARN). An ARN is an identifierfor a specific AWS resource, such as a server, user, or role.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesMaxResults (p. 79)

Specifies the number of tags to return as a response to the ListTagsForResource request.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: NoNextToken (p. 79)

When you request additional results from the ListTagsForResource operation, a NextTokenparameter is returned in the input. You can then pass in a subsequent command to the NextTokenparameter to continue listing additional tags.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.

Required: No

Response Syntax{ "Arn": "string",

79

Page 84: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListTagsForResource

"NextToken": "string", "Tags": [ { "Key": "string", "Value": "string" } ]}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Arn (p. 79)

The ARN you specified to list the tags of.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*NextToken (p. 79)

When you can get additional results from the ListTagsForResource call, a NextToken parameteris returned in the output. You can then pass in a subsequent command to the NextToken parameterto continue listing additional tags.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.Tags (p. 79)

Key-value pairs that are assigned to a resource, usually for the purpose of grouping and searching foritems. Tags are metadata that you define.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidNextTokenException

The NextToken parameter that was passed is invalid.

HTTP Status Code: 400InvalidRequestException

This exception is thrown when the client submits a malformed request.

80

Page 85: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListTagsForResource

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following example lists the tags for the resource with the ARN you specified.

Sample Request

{ "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef"}

Example

Sample Response

{ "Tags": [ { "Key": "Name", "Value": "MySFTPServer" } ]}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

81

Page 86: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListUsers

ListUsersLists the users for a file transfer protocol-enabled server that you specify by passing the ServerIdparameter.

Request Syntax{ "MaxResults": number, "NextToken": "string", "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

MaxResults (p. 82)

Specifies the number of users to return as a response to the ListUsers request.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: NoNextToken (p. 82)

When you can get additional results from the ListUsers call, a NextToken parameter is returnedin the output. You can then pass in a subsequent command to the NextToken parameter to continuelisting additional users.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.

Required: NoServerId (p. 82)

A system-assigned unique identifier for a file transfer protocol-enabled server that has users assignedto it.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response Syntax{ "NextToken": "string", "ServerId": "string",

82

Page 87: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListUsers

"Users": [ { "Arn": "string", "HomeDirectory": "string", "HomeDirectoryType": "string", "Role": "string", "SshPublicKeyCount": number, "UserName": "string" } ]}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken (p. 82)

When you can get additional results from the ListUsers call, a NextToken parameter is returnedin the output. You can then pass in a subsequent command to the NextToken parameter to continuelisting additional users.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 6144.ServerId (p. 82)

A system-assigned unique identifier for a file transfer protocol-enabled server that the users areassigned to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$Users (p. 82)

Returns the user accounts and their properties for the ServerId value that you specify.

Type: Array of ListedUser (p. 121) objects

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidNextTokenException

The NextToken parameter that was passed is invalid.

HTTP Status Code: 400InvalidRequestException

This exception is thrown when the client submits a malformed request.

83

Page 88: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListUsers

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The ListUsers API call returns a list of users associated with a file transfer protocol-enabled server youspecify.

Sample Request

{ "MaxResults": 100, "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b1X0cnVuU2F0ZV9hbW91bnQiOiAyfQ==", "ServerId": "s-01234567890abcdef" }

Example

Sample Response

{ "NextToken": "eyJNYXJrZXIiOiBudWxsLCAiYm90b1X0cnVuU2F0ZV9hbW91bnQiOiAyfQ=="", "ServerId": "s-01234567890abcdef", "Users": [ { "Arn": "arn:aws:transfer:us-east-1:176354371281:user/s-01234567890abcdef/charlie", "HomeDirectory": "/sftp-tests/home/charlie", "SshPublicKeyCount": 1, "Role": "arn:aws:iam::176354371281:role/transfer-role1", "Tags": [ { "Key": "Name", "Value": "user1" } ], "UserName": "sftp_user" } ]}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

84

Page 90: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドStartServer

StartServerChanges the state of a file transfer protocol-enabled server from OFFLINE to ONLINE. It has no impact on aserver that is already ONLINE. An ONLINE server can accept and process file transfer jobs.

The state of STARTING indicates that the server is in an intermediate state, either not fully able to respond,or not fully online. The values of START_FAILED can indicate an error condition.

No response is returned from this call.

Request Syntax

{ "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 86)

A system-assigned unique identifier for a file transfer protocol-enabled server that you start.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

86

Page 91: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドStartServer

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExample

The following example starts a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef"}

Example

Sample Response

{ "ServerId": "s-01234567890abcdef"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

87

Page 92: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドStopServer

StopServerChanges the state of a file transfer protocol-enabled server from ONLINE to OFFLINE. An OFFLINE servercannot accept and process file transfer jobs. Information tied to your server, such as server and userproperties, are not affected by stopping your server. Stopping the server will not reduce or impact your filetransfer protocol endpoint billing.

The state of STOPPING indicates that the server is in an intermediate state, either not fully able to respond,or not fully offline. The values of STOP_FAILED can indicate an error condition.

No response is returned from this call.

Request Syntax{ "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 88)

A system-assigned unique identifier for a file transfer protocol-enabled server that you stopped.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

88

Page 93: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドStopServer

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExample

The following example stops a file transfer protocol-enabled server.

Sample Request

{ "ServerId": "s-01234567890abcdef"}

Example

Sample Response

{ "ServerId": "s-01234567890abcdef"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

89

Page 94: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTagResource

TagResourceAttaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources areusers, servers, roles, and other entities.

There is no response returned from this call.

Request Syntax{ "Arn": "string", "Tags": [ { "Key": "string", "Value": "string" } ]}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

Arn (p. 90)

An Amazon Resource Name (ARN) for a specific AWS resource, such as a server, user, or role.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesTags (p. 90)

Key-value pairs assigned to ARNs that you can use to group and search for resources by type. Youcan attach this metadata to user accounts for any purpose.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

90

Page 95: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTagResource

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExampleThe following example adds a tag to a file transfer protocol-enabled server.

Sample Request

{ "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef", "Tags": [ { "Key": "Group", "Value": "Europe" } ]}

Example

Sample Response

HTTP 200 response with an empty HTTP body.

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3

91

Page 96: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTagResource

• AWS SDK for Python• AWS SDK for Ruby V3

92

Page 97: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTestIdentityProvider

TestIdentityProviderIf the IdentityProviderType of a file transfer protocol-enabled server is API_Gateway, tests whetheryour API Gateway is set up successfully. We highly recommend that you call this operation to test yourauthentication method as soon as you create your server. By doing so, you can troubleshoot issues with theAPI Gateway integration to ensure that your users can successfully use the service.

Request Syntax{ "ServerId": "string", "ServerProtocol": "string", "UserName": "string", "UserPassword": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

ServerId (p. 93)

A system-assigned identifier for a specific file transfer protocol-enabled server. That server's userauthentication method is tested with a user name and password.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesServerProtocol (p. 93)

The type of file transfer protocol to be tested.

The available protocols are:• Secure Shell (SSH) File Transfer Protocol (SFTP)• File Transfer Protocol Secure (FTPS)• File Transfer Protocol (FTP)

Type: String

Valid Values: SFTP | FTP | FTPS

Required: NoUserName (p. 93)

The name of the user account to be tested.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

93

Page 98: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTestIdentityProvider

Required: YesUserPassword (p. 93)

The password of the user account to be tested.

Type: String

Length Constraints: Maximum length of 2048.

Required: No

Response Syntax{ "Message": "string", "Response": "string", "StatusCode": number, "Url": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Message (p. 94)

A message that indicates whether the test was successful or not.

Type: StringResponse (p. 94)

The response that is returned from your API Gateway.

Type: StringStatusCode (p. 94)

The HTTP status code that is the response from your API Gateway.

Type: IntegerUrl (p. 94)

The endpoint of the service used to authenticate a user.

Type: String

Length Constraints: Maximum length of 255.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

94

Page 99: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTestIdentityProvider

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExample

The following request returns a message from an identity provider that a user name and password is a valididentity to use with the AWS Transfer Family service.

Sample Request

{ "ServerID": "s-01234567890abcdef", "UserName": "sftp_user" "UserPassword": "MyPassword-1"}

Example

Sample Response

"Message": "", "StatusCode": "200" "Response": ""{\"Role\": \"arn:aws:iam::123456789012:role/SFTP_role\",\"HomeDirectory\": \"/bucket_name/home/mydirectory\",\"PublicKeys\": \"[ssh-rsa-key]\"}"" "Url": "myauthenticationserver.com",

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript

95

Page 101: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUntagResource

UntagResourceDetaches a key-value pair from a resource, as identified by its Amazon Resource Name (ARN). Resourcesare users, servers, roles, and other entities.

No response is returned from this call.

Request Syntax{ "Arn": "string", "TagKeys": [ "string" ]}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

Arn (p. 97)

The value of the resource that will have the tag removed. An Amazon Resource Name (ARN) is anidentifier for a specific AWS resource, such as a server, user, or role.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesTagKeys (p. 97)

TagKeys are key-value pairs assigned to ARNs that can be used to group and search for resources bytype. This metadata can be attached to resources for any purpose.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Length Constraints: Maximum length of 128.

Required: Yes

Response ElementsIf the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

97

Page 102: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUntagResource

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500

ExamplesExampleThe following example removes a tag of a file transfer protocol-enabled server.

Sample Request

{ "Arn": "arn:aws:transfer:us-east-1:176354371281:server/s-01234567890abcdef", "TagKeys": "Europe" ]}

Example

Sample Response

HTTP 200 response with an empty HTTP body.

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

98

Page 103: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateServer

UpdateServerUpdates the file transfer protocol-enabled server's properties after that server has been created.

The UpdateServer call returns the ServerId of the server you updated.

Request Syntax

{ "Certificate": "string", "EndpointDetails": { "AddressAllocationIds": [ "string" ], "SubnetIds": [ "string" ], "VpcEndpointId": "string", "VpcId": "string" }, "EndpointType": "string", "HostKey": "string", "IdentityProviderDetails": { "InvocationRole": "string", "Url": "string" }, "LoggingRole": "string", "Protocols": [ "string" ], "ServerId": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

Certificate (p. 99)

The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required whenProtocols is set to FTPS.

Type: String

Length Constraints: Maximum length of 1600.

Required: NoEndpointDetails (p. 99)

The virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabled server. With a VPC endpoint, you can restrict access to your server to resources only withinyour VPC. To control incoming internet traffic, you will need to associate one or more Elastic IPaddresses with your server's endpoint.

Type: EndpointDetails (p. 115) object

Required: NoEndpointType (p. 99)

The type of endpoint that you want your file transfer protocol-enabled server to connect to. You canchoose to connect to the public internet or a VPC endpoint. With a VPC endpoint, your server isn'taccessible over the public internet.

99

Page 104: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateServer

Type: String

Valid Values: PUBLIC | VPC | VPC_ENDPOINT

Required: NoHostKey (p. 99)

The RSA private key as generated by ssh-keygen -N "" -m PEM -f my-new-server-key.Important

If you aren't planning to migrate existing users from an existing file transfer protocol-enabledserver to a new server, don't update the host key. Accidentally changing a server's host keycan be disruptive.

For more information, see Changing the Host Key for Your AWS Transfer Family Server in the AWSTransfer Family User Guide.

Type: String

Length Constraints: Maximum length of 4096.

Required: NoIdentityProviderDetails (p. 99)

An array containing all of the information required to call a customer's authentication API method.

Type: IdentityProviderDetails (p. 118) object

Required: NoLoggingRole (p. 99)

Changes the AWS Identity and Access Management (IAM) role that allows Amazon S3 events to belogged in Amazon CloudWatch, turning logging on or off.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: ^$|arn:.*role/.*

Required: NoProtocols (p. 99)

Specifies the file transfer protocol or protocols over which your file transfer protocol client can connectto your server's endpoint. The available protocols are:• Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over SSH• File Transfer Protocol Secure (FTPS): File transfer with TLS encryption• File Transfer Protocol (FTP): Unencrypted file transfer

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: SFTP | FTP | FTPS

Required: NoServerId (p. 99)

A system-assigned unique identifier for a file transfer protocol-enabled server instance that the useraccount is assigned to.

100

Page 105: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateServer

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: Yes

Response Syntax{ "ServerId": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 101)

A system-assigned unique identifier for a file transfer protocol-enabled server that the user account isassigned to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 400ConflictException

This exception is thrown when the UpdatServer is called for a file transfer protocol-enabled serverthat has VPC as the endpoint type and the server's VpcEndpointID is not in the available state.

HTTP Status Code: 400InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400

101

Page 106: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateServer

ResourceExistsException

The requested resource does not exist.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExampleThe following example updates the role of a file transfer protocol-enabled server.

Sample Request

{ "EndpointDetails": { "VpcEndpointId": ""vpce-01234f056f3g13"" "LoggingRole": "CloudWatchS3Events", "ServerId": "s-01234567890abcdef"}

Example

Sample Response

{ "ServerId": "s-01234567890abcdef"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go

102

Page 108: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateUser

UpdateUserAssigns new properties to a user. Parameters you pass modify any or all of the following: the homedirectory, role, and policy for the UserName and ServerId you specify.

The response returns the ServerId and the UserName for the updated user.

Request Syntax

{ "HomeDirectory": "string", "HomeDirectoryMappings": [ { "Entry": "string", "Target": "string" } ], "HomeDirectoryType": "string", "Policy": "string", "Role": "string", "ServerId": "string", "UserName": "string"}

Request ParametersFor information about the parameters that are common to all actions, see Common Parameters (p. 124).

The request accepts the following data in JSON format.

HomeDirectory (p. 104)

Specifies the landing directory (folder) for a user when they log in to the file transfer protocol-enabledserver using their file transfer protocol client.

An example is your-Amazon-S3-bucket-name>/home/username.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^$|/.*

Required: NoHomeDirectoryMappings (p. 104)

Logical directory mappings that specify what Amazon S3 paths and keys should be visible to youruser and how you want to make them visible. You will need to specify the "Entry" and "Target" pair,where Entry shows how the path is made visible and Target is the actual Amazon S3 path. If youonly specify a target, it will be displayed as is. You will need to also make sure that your AWS IAM Roleprovides access to paths in Target. The following is an example.

'[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf","Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]'

In most cases, you can use this value instead of the scope-down policy to lock your user down tothe designated home directory ("chroot"). To do this, you can set Entry to '/' and set Target to theHomeDirectory parameter value.

104

Page 109: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateUser

Note

If the target of a logical directory entry does not exist in Amazon S3, the entry will be ignored.As a workaround, you can use the Amazon S3 api to create 0 byte objects as place holdersfor your directory. If using the CLI, use the s3api call instead of s3 so you can use the put-object operation. For example, you use the following: aws s3api put-object --bucketbucketname --key path/to/folder/. Make sure that the end of the key name ends ina / for it to be considered a folder.

Type: Array of HomeDirectoryMapEntry (p. 117) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoHomeDirectoryType (p. 104)

The type of landing directory (folder) you want your users' home directory to be when they log into thefile transfer protocol-enabled server. If you set it to PATH, the user will see the absolute Amazon S3bucket paths as is in their file transfer protocol clients. If you set it LOGICAL, you will need to providemappings in the HomeDirectoryMappings for how you want to make Amazon S3 paths visible toyour users.

Type: String

Valid Values: PATH | LOGICAL

Required: NoPolicy (p. 104)

Allows you to supply a scope-down policy for your user so you can use the same AWS Identity andAccess Management (IAM) role across multiple users. The policy scopes down user access to portionsof your Amazon S3 bucket. Variables you can use inside this policy include ${Transfer:UserName},${Transfer:HomeDirectory}, and ${Transfer:HomeBucket}.

Note

For scope-down policies, AWS Transfer Family stores the policy as a JSON blob, instead ofthe Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob andpass it in the Policy argument.For an example of a scope-down policy, see Creating a Scope-Down Policy.For more information, see AssumeRole in the AWS Security Token Service API Reference.

Type: String

Length Constraints: Maximum length of 2048.

Required: NoRole (p. 104)

The IAM role that controls your users' access to your Amazon S3 bucket. The policies attached to thisrole will determine the level of access you want to provide your users when transferring files into andout of your Amazon S3 bucket or buckets. The IAM role should also contain a trust relationship thatallows the file transfer protocol-enabled server to access your resources when servicing your users'transfer requests.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

105

Page 110: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateUser

Required: NoServerId (p. 104)

A system-assigned unique identifier for a file transfer protocol-enabled server instance that the useraccount is assigned to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: YesUserName (p. 104)

A unique string that identifies a user and is associated with a file transfer protocol-enabled server asspecified by the ServerId. This is the string that will be used by your user when they log in to yourserver. This user name is a minimum of 3 and a maximum of 32 characters long. The following arevalid characters: a-z, A-Z, 0-9, underscore, and hyphen. The user name can't start with a hyphen.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: Yes

Response Syntax

{ "ServerId": "string", "UserName": "string"}

Response ElementsIf the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ServerId (p. 106)

A system-assigned unique identifier for a file transfer protocol-enabled server instance that the useraccount is assigned to.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$UserName (p. 106)

The unique identifier for a user that is assigned to a file transfer protocol-enabled server instance thatwas specified in the request.

Type: String

106

Page 111: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドUpdateUser

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

ErrorsFor information about the errors that are common to all actions, see Common Errors (p. 126).

InternalServiceError

This exception is thrown when an error occurs in the AWS Transfer Family service.

HTTP Status Code: 500InvalidRequestException

This exception is thrown when the client submits a malformed request.

HTTP Status Code: 400ResourceNotFoundException

This exception is thrown when a resource is not found by the AWS Transfer Family service.

HTTP Status Code: 400ServiceUnavailableException

The request has failed because the AWS Transfer Family service is not available.

HTTP Status Code: 500ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400

HTTP Status Code: 400

ExamplesExample

The following example updates a user account.

Sample Request

{ "HomeDirectory": "/bucket2/documentation", "HomeDirectoryMappings": [ { "Entry": "your-personal-report.pdf", "Target": "/bucket3/customized-reports/${transfer:UserName}.pdf" } ], "HomeDirectoryType:" "PATH", "Role": "AssumeRole", "ServerId": "s-01234567890abcdef", "UserName": "sftp_user"

107

Page 112: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドData Types

}

Example

Sample Response

{ "ServerId": "s-01234567890abcdef" "UserName": "sftp_user"}

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface• AWS SDK for .NET• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for JavaScript• AWS SDK for PHP V3• AWS SDK for Python• AWS SDK for Ruby V3

Data TypesThe following data types are supported:

• DescribedServer (p. 109)• DescribedUser (p. 112)• EndpointDetails (p. 115)• HomeDirectoryMapEntry (p. 117)• IdentityProviderDetails (p. 118)• ListedServer (p. 119)• ListedUser (p. 121)• SshPublicKey (p. 123)• Tag (p. 124)

108

Page 113: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribedServer

DescribedServerDescribes the properties of a file transfer protocol-enabled server that was specified. Information returnedincludes the following: the server Amazon Resource Name (ARN), the authentication configuration andtype, the logging role, the server ID and state, and assigned tags or metadata.

ContentsArn

Specifies the unique Amazon Resource Name (ARN) for a file transfer protocol-enabled server to bedescribed.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesCertificate

The Amazon Resource Name (ARN) of the AWS Certificate Manager (ACM) certificate. Required whenProtocols is set to FTPS.

Type: String

Length Constraints: Maximum length of 1600.

Required: NoEndpointDetails

The virtual private cloud (VPC) endpoint settings that you configured for your file transfer protocol-enabled server.

Type: EndpointDetails (p. 115) object

Required: NoEndpointType

The type of endpoint that your file transfer protocol-enabled server is connected to. If your server isconnected to a VPC endpoint, your server isn't accessible over the public internet.

Type: String

Valid Values: PUBLIC | VPC | VPC_ENDPOINT

Required: NoHostKeyFingerprint

Contains the message-digest algorithm (MD5) hash of a file transfer protocol-enabled server's hostkey. This value is equivalent to the output of the ssh-keygen -l -E md5 -f my-new-server-key command.

Type: String

Required: No

109

Page 114: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribedServer

IdentityProviderDetails

Specifies information to call a customer-supplied authentication API. This field is not populated whenthe IdentityProviderType of a file transfer protocol-enabled server is SERVICE_MANAGED.

Type: IdentityProviderDetails (p. 118) object

Required: NoIdentityProviderType

Defines the mode of authentication method enabled for this service. A value of SERVICE_MANAGEDmeans that you are using this file transfer protocol-enabled server to store and access user credentialswithin the service. A value of API_GATEWAY indicates that you have integrated an API Gatewayendpoint that will be invoked for authenticating your user into the service.

Type: String

Valid Values: SERVICE_MANAGED | API_GATEWAY

Required: NoLoggingRole

An AWS Identity and Access Management (IAM) entity that allows a file transfer protocol-enabledserver to turn on Amazon CloudWatch logging for Amazon S3 events. When set, user activity can beviewed in your CloudWatch logs.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: NoProtocols

Specifies the file transfer protocol or protocols over which your file transfer protocol client can connectto your server's endpoint. The available protocols are:• Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over SSH• File Transfer Protocol Secure (FTPS): File transfer with TLS encryption• File Transfer Protocol (FTP): Unencrypted file transfer

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Valid Values: SFTP | FTP | FTPS

Required: NoServerId

Unique system-assigned identifier for a file transfer protocol-enabled server that you instantiate.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

Required: No

110

Page 115: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribedServer

State

The condition of a file transfer protocol-enabled server for the server that was described. A value ofONLINE indicates that the server can accept jobs and transfer files. A State value of OFFLINE meansthat the server cannot perform file transfer operations.

The states of STARTING and STOPPING indicate that the server is in an intermediate state, either notfully able to respond, or not fully offline. The values of START_FAILED or STOP_FAILED can indicatean error condition.

Type: String

Valid Values: OFFLINE | ONLINE | STARTING | STOPPING | START_FAILED |STOP_FAILED

Required: NoTags

Contains the key-value pairs that you can use to search for and group file transfer protocol-enabledservers that were assigned to the server that was described.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoUserCount

The number of users that are assigned to a file transfer protocol-enabled server you specified with theServerId.

Type: Integer

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

111

Page 116: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribedUser

DescribedUserReturns properties of the user that you want to describe.

ContentsArn

Contains the unique Amazon Resource Name (ARN) for the user that was requested to be described.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesHomeDirectory

Specifies the landing directory (or folder), which is the location that files are written to or readfrom in an Amazon S3 bucket for the described user. An example is /your s3 bucket name/home/username .

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^$|/.*

Required: NoHomeDirectoryMappings

Logical directory mappings that you specified for what Amazon S3 paths and keys should be visible toyour user and how you want to make them visible. You will need to specify the "Entry" and "Target"pair, where Entry shows how the path is made visible and Target is the actual Amazon S3 path. Ifyou only specify a target, it will be displayed as is. You will need to also make sure that your AWS IAMRole provides access to paths in Target.

In most cases, you can use this value instead of the scope-down policy to lock your user down tothe designated home directory ("chroot"). To do this, you can set Entry to '/' and set Target to theHomeDirectory parameter value.

Type: Array of HomeDirectoryMapEntry (p. 117) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoHomeDirectoryType

The type of landing directory (folder) you mapped for your users to see when they log into the filetransfer protocol-enabled server. If you set it to PATH, the user will see the absolute Amazon S3bucket paths as is in their file transfer protocol clients. If you set it LOGICAL, you will need to providemappings in the HomeDirectoryMappings for how you want to make Amazon S3 paths visible toyour users.

Type: String

Valid Values: PATH | LOGICAL

Required: No

112

Page 117: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドDescribedUser

Policy

Specifies the name of the policy in use for the described user.

Type: String

Length Constraints: Maximum length of 2048.

Required: NoRole

Specifies the IAM role that controls your users' access to your Amazon S3 bucket. The policiesattached to this role will determine the level of access you want to provide your users when transferringfiles into and out of your Amazon S3 bucket or buckets. The IAM role should also contain a trustrelationship that allows a file transfer protocol-enabled server to access your resources when servicingyour users' transfer requests.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: NoSshPublicKeys

Contains the public key portion of the Secure Shell (SSH) keys stored for the described user.

Type: Array of SshPublicKey (p. 123) objects

Array Members: Maximum number of 5 items.

Required: NoTags

Contains the key-value pairs for the user requested. Tag can be used to search for and group users fora variety of purposes.

Type: Array of Tag (p. 124) objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: NoUserName

The name of the user that was requested to be described. User names are used for authenticationpurposes. This is the string that will be used by your user when they log in to your file transfer protocol-enabled server.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

113

Page 119: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドEndpointDetails

EndpointDetailsThe virtual private cloud (VPC) endpoint settings that are configured for your file transfer protocol-enabledserver. With a VPC endpoint, you can restrict access to your server and resources only within your VPC.To control incoming internet traffic, invoke the UpdateServer API and attach an Elastic IP to your server'sendpoint.

ContentsAddressAllocationIds

A list of address allocation IDs that are required to attach an Elastic IP address to your file transferprotocol-enabled server's endpoint. This is only valid in the UpdateServer API.

Note

This property can only be use when EndpointType is set to VPC.

Type: Array of strings

Required: NoSubnetIds

A list of subnet IDs that are required to host your file transfer protocol-enabled server endpoint in yourVPC.

Type: Array of strings

Required: NoVpcEndpointId

The ID of the VPC endpoint.

Type: String

Length Constraints: Fixed length of 22.

Pattern: ^vpce-[0-9a-f]{17}$

Required: NoVpcId

The VPC ID of the VPC in which a file transfer protocol-enabled server's endpoint will be hosted.

Type: String

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

115

Page 120: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドEndpointDetails

116

Page 121: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドHomeDirectoryMapEntry

HomeDirectoryMapEntryRepresents an object that contains entries and a targets for HomeDirectoryMappings.

ContentsEntry

Represents an entry and a target for HomeDirectoryMappings.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^/.*

Required: YesTarget

Represents the map target that is used in a HomeDirectorymapEntry.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^/.*

Required: Yes

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

117

Page 122: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドIdentityProviderDetails

IdentityProviderDetailsReturns information related to the type of user authentication that is in use for a file transfer protocol-enabled server's users. A server can have only one method of authentication.

ContentsInvocationRole

Provides the type of InvocationRole used to authenticate the user account.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: NoUrl

Contains the location of the service endpoint used to authenticate users.

Type: String

Length Constraints: Maximum length of 255.

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

118

Page 123: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListedServer

ListedServerReturns properties of a file transfer protocol-enabled server that was specified.

ContentsArn

The unique Amazon Resource Name (ARN) for a file transfer protocol-enabled server to be listed.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesEndpointType

The type of VPC endpoint that your file transfer protocol-enabled server is connected to. If your serveris connected to a VPC endpoint, your server isn't accessible over the public internet.

Type: String

Valid Values: PUBLIC | VPC | VPC_ENDPOINT

Required: NoIdentityProviderType

The authentication method used to validate a user for a file transfer protocol-enabled server that wasspecified. This can include Secure Shell (SSH), user name and password combinations, or your owncustom authentication method. Valid values include SERVICE_MANAGED or API_GATEWAY.

Type: String

Valid Values: SERVICE_MANAGED | API_GATEWAY

Required: NoLoggingRole

The AWS Identity and Access Management (IAM) entity that allows a file transfer protocol-enabledserver to turn on Amazon CloudWatch logging.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: NoServerId

The unique system assigned identifier for a file transfer protocol-enabled servers that were listed.

Type: String

Length Constraints: Fixed length of 19.

Pattern: ^s-([0-9a-f]{17})$

119

Page 124: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListedServer

Required: NoState

Describes the condition of a file transfer protocol-enabled server for the server that was described.A value of ONLINE indicates that the server can accept jobs and transfer files. A State value ofOFFLINE means that the server cannot perform file transfer operations.

The states of STARTING and STOPPING indicate that the server is in an intermediate state, either notfully able to respond, or not fully offline. The values of START_FAILED or STOP_FAILED can indicatean error condition.

Type: String

Valid Values: OFFLINE | ONLINE | STARTING | STOPPING | START_FAILED |STOP_FAILED

Required: NoUserCount

A numeric value that indicates the number of users that are assigned to a file transfer protocol-enabledserver you specified with the ServerId.

Type: Integer

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

120

Page 125: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListedUser

ListedUserReturns properties of the user that you specify.

ContentsArn

The unique Amazon Resource Name (ARN) for the user that you want to learn about.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 1600.

Pattern: arn:.*

Required: YesHomeDirectory

Specifies the location that files are written to or read from an Amazon S3 bucket for the user youspecify by their ARN.

Type: String

Length Constraints: Maximum length of 1024.

Pattern: ^$|/.*

Required: NoHomeDirectoryType

The type of landing directory (folder) you mapped for your users' home directory. If you set it to PATH,the user will see the absolute Amazon S3 bucket paths as is in their file transfer protocol clients. If youset it LOGICAL, you will need to provide mappings in the HomeDirectoryMappings for how you wantto make Amazon S3 paths visible to your users.

Type: String

Valid Values: PATH | LOGICAL

Required: NoRole

The role in use by this user. A role is an AWS Identity and Access Management (IAM) entity that, inthis case, allows a file transfer protocol-enabled server to act on a user's behalf. It allows the server toinherit the trust relationship that enables that user to perform file operations to their Amazon S3 bucket.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:.*role/.*

Required: NoSshPublicKeyCount

The number of SSH public keys stored for the user you specified.

Type: Integer

121

Page 126: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドListedUser

Required: NoUserName

The name of the user whose ARN was specified. User names are used for authentication purposes.

Type: String

Length Constraints: Minimum length of 3. Maximum length of 32.

Pattern: ^[a-zA-Z0-9_][a-zA-Z0-9_-]{2,31}$

Required: No

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

122

Page 127: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドSshPublicKey

SshPublicKeyProvides information about the public Secure Shell (SSH) key that is associated with a user account for thespecific file transfer protocol-enabled server (as identified by ServerId). The information returned includesthe date the key was imported, the public key contents, and the public key ID. A user can store more thanone SSH public key associated with their user name on a specific server.

ContentsDateImported

The date that the public key was added to the user account.

Type: Timestamp

Required: YesSshPublicKeyBody

The content of the SSH public key as specified by the PublicKeyId.

Type: String

Length Constraints: Maximum length of 2048.

Pattern: ^ssh-rsa\s+[A-Za-z0-9+/]+[=]{0,3}(\s+.+)?\s*$

Required: YesSshPublicKeyId

The SshPublicKeyId parameter contains the identifier of the public key.

Type: String

Length Constraints: Fixed length of 21.

Pattern: ^key-[0-9a-f]{17}$

Required: Yes

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

123

Page 128: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドTag

TagCreates a key-value pair for a specific resource. Tags are metadata that you can use to search for andgroup a resource for various purposes. You can apply tags to servers, users, and roles. A tag key can takemore than one value. For example, to group servers for accounting purposes, you might create a tag calledGroup and assign the values Research and Accounting to that group.

ContentsKey

The name assigned to the tag that you create.

Type: String

Length Constraints: Maximum length of 128.

Required: YesValue

Contains one or more values that you assigned to the key name you create.

Type: String

Length Constraints: Maximum length of 256.

Required: Yes

See AlsoFor more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS SDK for C++• AWS SDK for Go• AWS SDK for Java• AWS SDK for Ruby V3

Common ParametersThe following list contains the parameters that all actions use for signing Signature Version 4 requests witha query string. Any action-specific parameters are listed in the topic for that action. For more informationabout Signature Version 4, see Signature Version 4 Signing Process in the Amazon Web Services GeneralReference.

Action

The action to be performed.

Type: string

Required: YesVersion

The API version that the request is written for, expressed in the format YYYY-MM-DD.

124

Page 129: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCommon Parameters

Type: string

Required: YesX-Amz-Algorithm

The hash algorithm that you used to create the request signature.

Condition: Specify this parameter when you include authentication information in a query string insteadof in the HTTP authorization header.

Type: string

Valid Values: AWS4-HMAC-SHA256

Required: ConditionalX-Amz-Credential

The credential scope value, which is a string that includes your access key, the date, the region youare targeting, the service you are requesting, and a termination string ("aws4_request"). The value isexpressed in the following format: access_key/YYYYMMDD/region/service/aws4_request.

For more information, see Task 2: Create a String to Sign for Signature Version 4 in the Amazon WebServices General Reference.

Condition: Specify this parameter when you include authentication information in a query string insteadof in the HTTP authorization header.

Type: string

Required: ConditionalX-Amz-Date

The date that is used to create the signature. The format must be ISO 8601 basic format(YYYYMMDD'T'HHMMSS'Z'). For example, the following date time is a valid X-Amz-Date value:20120325T120000Z.

Condition: X-Amz-Date is optional for all requests; it can be used to override the date used for signingrequests. If the Date header is specified in the ISO 8601 basic format, X-Amz-Date is not required.When X-Amz-Date is used, it always overrides the value of the Date header. For more information, seeHandling Dates in Signature Version 4 in the Amazon Web Services General Reference.

Type: string

Required: ConditionalX-Amz-Security-Token

The temporary security token that was obtained through a call to AWS Security Token Service (AWSSTS). For a list of services that support temporary security credentials from AWS Security TokenService, go to AWS Services That Work with IAM in the IAM User Guide.

Condition: If you're using temporary security credentials from the AWS Security Token Service, youmust include the security token.

Type: string

Required: ConditionalX-Amz-Signature

Specifies the hex-encoded signature that was calculated from the string to sign and the derived signingkey.

125

Page 130: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCommon Errors

Condition: Specify this parameter when you include authentication information in a query string insteadof in the HTTP authorization header.

Type: string

Required: ConditionalX-Amz-SignedHeaders

Specifies all the HTTP headers that were included as part of the canonical request. For moreinformation about specifying signed headers, see Task 1: Create a Canonical Request For SignatureVersion 4 in the Amazon Web Services General Reference.

Condition: Specify this parameter when you include authentication information in a query string insteadof in the HTTP authorization header.

Type: string

Required: Conditional

Common ErrorsThis section lists the errors common to the API actions of all AWS services. For errors specific to an APIaction for this service, see the topic for that API action.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 400IncompleteSignature

The request signature does not conform to AWS standards.

HTTP Status Code: 400InternalFailure

The request processing has failed because of an unknown error, exception or failure.

HTTP Status Code: 500InvalidAction

The action or operation requested is invalid. Verify that the action is typed correctly.

HTTP Status Code: 400InvalidClientTokenId

The X.509 certificate or AWS access key ID provided does not exist in our records.

HTTP Status Code: 403InvalidParameterCombination

Parameters that must not be used together were used together.

HTTP Status Code: 400InvalidParameterValue

An invalid or out-of-range value was supplied for the input parameter.

126

Page 131: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイドCommon Errors

HTTP Status Code: 400InvalidQueryParameter

The AWS query string is malformed or does not adhere to AWS standards.

HTTP Status Code: 400MalformedQueryString

The query string contains a syntax error.

HTTP Status Code: 404MissingAction

The request is missing an action or a required parameter.

HTTP Status Code: 400MissingAuthenticationToken

The request must contain either a valid (registered) AWS access key ID or X.509 certificate.

HTTP Status Code: 403MissingParameter

A required parameter for the specified action is not supplied.

HTTP Status Code: 400OptInRequired

The AWS access key ID needs a subscription for the service.

HTTP Status Code: 403RequestExpired

The request reached the service more than 15 minutes after the date stamp on the request or morethan 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp onthe request is more than 15 minutes in the future.

HTTP Status Code: 400ServiceUnavailable

The request has failed due to a temporary failure of the server.

HTTP Status Code: 503ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 400ValidationError

The input fails to satisfy the constraints specified by an AWS service.

HTTP Status Code: 400

127

Page 132: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

AWS Transfer for SFTP のドキュメント履歴

以下の表は、今回のリリースの AWS Transfer for SFTP に関するドキュメントの説明です。

• API バージョン: transfer-2018-11-05• ドキュメント最新更新日: 2019 年 3 月 27 日

変更 説明 日付

Virtual Private Cloud (VPC) での作業のサポート

VPC で AWS SFTP サーバーを作成できるようになりました。AWS SFTP サーバーを使用すると、パブリックインターネットを経由することなく、SFTP を使用して AmazonS3 バケットとの間でデータを転送できます。詳細については、「Virtual Private Cloud でのSFTP サーバーの作成 (p. 32)」を参照してください。

2019 年 3 月 27 日

AWS SFTP の初版リリース。 この初回リリースでは、セットアップ手順を指示し、使用を開始する方法について説明するとともに、クライアント設定、ユーザー設定、およびモニタリング活動に関する情報を提供しています。

2018 年 11 月 25 日

128

Page 133: AWS Transfer for SFTP - ユーザーガイド...AWS Transfer for SFTP ユーザーガイド AWS サインアップ セットアップ 以下のセクションでは、AWS SFTP サービスを使用するための前提条件について説明します。最低で

AWS Transfer for SFTP ユーザーガイド

AWS の用語集最新の AWS の用語については、『AWS General Reference』の「AWS の用語集」を参照してください。

129