AWS CloudFormation StackSets の設定パッケージを設定する - AWS Control Tower

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

AWS CloudFormation StackSets の設定パッケージを設定する

このセクションでは、 AWS CloudFormation StackSets の設定パッケージを設定する方法について説明します。このプロセスの 2 つの主要部分は、(1) マニフェストファイルの準備、(2) フォルダ構造の更新です。

ステップ 1: 既存のマニフェストファイルを編集する

以前に編集したマニフェストファイルに新しい AWS CloudFormation StackSets 情報を追加します。

確認のためだけに、次のスニペットには、SCPs または RCPs の設定パッケージをセットアップするために前に示したものと同じカスタマイズされたマニフェストファイルが含まれています。このファイルをさらに編集して、リソースの詳細を含めることができるようになりました。

--- region: us-east-1 version: 2021-03-15 resources: - name: block-s3-public-access description: To S3 buckets to have public access resource_file: policies/block-s3-public.json deploy_method: scp | rcp #Apply to the following OU(s) deployment_targets: organizational_units: #array of strings - OUName1 - OUName2

次のスニペットは、resources の詳細を含む編集済みのサンプルマニフェストファイルを示します。resources の順序は、resources の依存関係を作成するための実行順序を決定します。次のサンプルマニフェストファイルをビジネス要件に応じて編集できます。

--- region: your-home-region version: 2021-03-15 …truncated… resources: - name: stackset-1 resource_file: templates/create-ssm-parameter-keys-1.template parameters: - parameter_key: parameter-1 parameter_value: value-1 deploy_method: stack_set deployment_targets: accounts: # array of strings, [0-9]{12} - account number or account name - 123456789123 organizational_units: #array of strings, ou ids, ou-xxxx - OuName1 - OUName2 export_outputs: - name: /org/member/test-ssm/app-id value: $[output_ApplicationId] regions: - region-name - name: stackset-2 resource_file: s3://bucket-name/key-name parameters: - parameter_key: parameter-1 parameter_value: value-1 deploy_method: stack_set deployment_targets: accounts: # array of strings, [0-9]{12} - account number or account name - 123456789123 organizational_units: #array of strings - OuName1 - OUName2 regions: - region-name

次の例は、マニフェストファイルに複数の AWS CloudFormation リソースを追加できることを示しています。

--- region: us-east-1 version: 2021-03-15 resources: - name: block-s3-public-access description: To S3 buckets to have public access resource_file: policies/block-s3-public.json deploy_method: scp | rcp #Apply to the following OU(s) deployment_targets: organizational_units: #array of strings - Custom - Sandbox - name: transit-network resource_file: templates/transit-gateway.template parameter_file: parameters/transit-gateway.json deploy_method: stack_set deployment_targets: accounts: # array of strings, [0-9]{12} - Prod - 123456789123 #Network organizational_units: #array of strings - Custom export_outputs: - name: /org/network/transit-gateway-id value: $[output_TransitGatewayID] regions: - us-east-1

ステップ 2: フォルダ構造を更新する

フォルダ構造を更新するときに、マニフェストファイルにあるすべてのサポート AWS CloudFormation テンプレートファイルと SCP または RCP ポリシーファイルを含めることができます。ファイルパスがマニフェストファイルで指定したものと一致していることを確認します。

  • テンプレートファイルには、OUs とアカウントにデプロイされる AWS リソースが含まれています。

  • policy ファイルには、テンプレートファイルで使用される入力パラメータが含まれます。

次の例は、ステップ 1 で作成したサンプルマニフェストファイルのフォルダ構造を示しています。

- manifest.yaml - policies/ - block-s3-public.json - templates/ - transit-gateway.template