

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Infrastructure Composer で外部ファイルを参照する
<a name="using-composer-external-files"></a>

( AWS Serverless Application Model AWS SAM) テンプレートで外部ファイルを使用して、繰り返しコードを再利用し、プロジェクトを整理できます。たとえば、 OpenAPI仕様で説明されている複数の Amazon API Gateway REST API リソースがあるとします。テンプレートでOpenAPI仕様コードをレプリケートする代わりに、1 つの外部ファイルを作成し、リソースごとに参照できます。

AWS Infrastructure Composer では、次の外部ファイルのユースケースがサポートされています。
+ 外部OpenAPI仕様ファイルで定義される API Gateway REST APIリソース。
+ AWS Step Functions 外部ステートマシン定義ファイルで定義されるステートマシンリソース。

サポートされているリソースの外部ファイルの設定の詳細については、以下を参照してください。
+ `AWS::Serverless::Api` 用の `[ DefinitionBody](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html#sam-api-definitionbody)`。
+ `AWS::Serverless::StateMachine` 用の `[ DefinitionUri](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-statemachine.html#sam-statemachine-definitionuri)`。

**注記**  
Infrastructure Composer コンソールから Infrastructure Composer で外部ファイルを参照するには、**ローカル同期**モードで Infrastructure Composer を使用する必要があります。詳細については、「[Infrastructure Composer コンソールでプロジェクトをローカルに同期して保存する](using-composer-project-local-sync.md)」を参照してください。

**Topics**
+ [Infrastructure Composer 外部リファレンスファイルのベストプラクティス](using-composer-external-files-best-practices.md)
+ [Infrastructure Composer で外部ファイルリファレンスを作成する](using-composer-external-files-new.md)
+ [Infrastructure Composer で外部ファイルリファレンスを使用してプロジェクトをロードする](using-composer-external-files-load.md)
+ [Infrastructure Composer で外部ファイルを参照するアプリケーションを作成する](using-composer-external-files-examples-example3.md)
+ [Infrastructure Composer でOpenAPI仕様の外部ファイルを参照する](using-composer-external-files-examples-example1.md)