

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 부트스트랩 파이프라인을 사용하여 Account Factory for Terraform(AFT) 구현
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline"></a>

*Vinicius Elias 및 Edgar Costa Filho, Amazon Web Services*

## 요약
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-summary"></a>

이 패턴은 관리 계정에서 AWS Control Tower Account Factory for Terraform(AFT)을 배포하기 위한 간단하고 안전한 방법을 제공합니다 AWS Organizations. 솔루션의 핵심은 초기 배포 또는 후속 업데이트에 쉽게 적응할 수 있도록 구성된 Terraform 파이프라인을 생성하여 AFT 구성을 자동화하는 CloudFormation 템플릿입니다.

보안 및 데이터 무결성이 최우선 순위 AWS이므로 관리형 인프라 및 구성의 상태를 추적하는 중요한 구성 요소인 Terraform 상태 파일은 Amazon Simple Storage Service(Amazon S3) 버킷에 안전하게 저장됩니다. 이 버킷은 무단 액세스 및 데이터 침해로부터 Terraform 상태를 보호할 수 있도록 서버 측 암호화 및 퍼블릭 액세스를 차단하는 정책을 비롯한 여러 보안 조치로 구성됩니다.

관리 계정은 전체 환경을 오케스트레이션하고 감독하므로 중요한 리소스입니다 AWS Control Tower. 이 패턴은 AWS 모범 사례를 따르며 배포 프로세스가 효율적일 뿐만 아니라 보안 및 거버넌스 표준에 부합하여 AWS 환경에 AFT를 배포하는 포괄적이고 안전하며 효율적인 방법을 제공합니다.

AFT에 대한 자세한 내용은 [AWS Control Tower 설명서](https://docs.aws.amazon.com/controltower/latest/userguide/aft-overview.html)를 참조하세요.

## 사전 조건 및 제한 사항
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-prereqs"></a>

**사전 조건 **
+ 최소한 관리 계정, 로그 아카이브 계정, 감사 계정 및 AFT 관리를 위한 추가 계정 하나가 있는 기본 AWS 다중 계정 환경입니다.
+ 설정된 AWS Control Tower 환경입니다. CloudFormation 템플릿이 배포되므로 관리 계정을 올바르게 구성해야 합니다.
+  AWS 관리 계정에 필요한 권한입니다. S3 버킷, AWS Lambda 함수, AWS Identity and Access Management (IAM) 역할 및 AWS CodePipeline 프로젝트와 같은 리소스를 생성하고 관리하려면 충분한 권한이 필요합니다.
+ Terraform에 대한 지식. 배포에는 Terraform 구성 생성 및 관리가 포함되므로 Terraform의 핵심 개념과 워크플로를 이해하는 것이 중요합니다.

**제한 사항 **
+ 계정의 [AWS 리소스 할당량](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)에 유의하세요. 배포로 인해 리소스가 여러 개 생성될 수 있으며, Service Quotas가 발생하면 배포 프로세스가 지연될 수 있습니다.
+ 템플릿은 특정 버전의 Terraform 및 용으로 설계되었습니다 AWS 서비스. 버전을 업그레이드하거나 변경하려면 템플릿을 수정해야 할 수 있습니다.
+ 템플릿은 GitHub Enterprise와 같은 자체 관리형 버전 관리 시스템(VCS) 서비스를 지원하지 않습니다.

**제품 버전**
+ Terraform 버전 1.6.6 이상
+ AFT 버전 1.11 이상

## 아키텍처
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-architecture"></a>

**대상 기술 스택**
+ CloudFormation
+ AWS CodeBuild
+ AWS CodeCommit
+ AWS CodePipeline
+ Amazon EventBridge
+ IAM
+ AWS Lambda
+ Amazon S3

**대상 아키텍처**

다음 다이어그램은 이 패턴에서 설명하는 구현 방식을 보여 줍니다.

![\[부트스트랩 파이프라인을 사용하여 AFT를 구현하기 위한 워크플로입니다.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/944f9912-87c7-4cc5-8478-7070cf67f7ee/images/4ee74757-940d-4d92-a7f0-fb0db1476247.png)


워크플로는 리소스 생성, 콘텐츠 생성, 파이프라인 실행이라는 세 가지 주요 작업으로 구성됩니다.

*리소스 생성*

[이 패턴과 함께 제공되는 CloudFormation 템플릿](https://github.com/aws-samples/aft-bootstrap-pipeline/blob/main/code/aft-deployment-pipeline.yaml)은 템플릿을 배포할 때 선택한 파라미터에 따라 필요한 모든 리소스를 생성하고 설정합니다. 템플릿은 최소한 다음 리소스를 생성합니다.
+ AFT를 구현하기 위한 CodePipeline 파이프라인
+ AFT 구현과 연결된 Terraform 상태 파일을 저장하는 S3 버킷
+ Terraform 계획을 구현하고 파이프라인의 여러 단계에서 명령을 적용하는 두 개의 CodeBuild 프로젝트
+ CodeBuild 및 CodePipeline 서비스에 대한 IAM 역할
+ 파이프라인 런타임 아티팩트를 저장하기 위한 두 번째 S3 버킷

선택한 VCS 공급자(CodeCommit 또는 외부 VCS)에 따라 템플릿은 다음 리소스를 생성합니다.
+ **CodeCommit**의 경우:
  + AFT Terraform 부트스트랩 코드를 저장하는 CodeCommit 리포지토리
  + 브`main`랜치에서 CodeCommit 리포지토리 변경 사항을 캡처하는 EventBridge 규칙
  + EventBridge 규칙의 다른 IAM 역할
+ GitHub와 같은 다른 **외부 VCS 공급자**의 경우:
  +  AWS CodeConnections 연결

또한 CodeCommit을 VCS 공급자로 선택하면 `Generate AFT Files` 파라미터를 로 설정하면 템플릿`true`은 콘텐츠를 생성하기 위해 다음과 같은 추가 리소스를 생성합니다.
+ 생성된 콘텐츠를 저장하고 CodeCommit 리포지토리의 소스로 사용할 S3 버킷
+ 지정된 파라미터를 처리하고 적절한 콘텐츠를 생성하는 Lambda 함수
+ Lambda 함수를 실행하는 IAM 함수
+ 템플릿이 배포될 때 Lambda 함수를 실행하는 CloudFormation 사용자 지정 리소스

*콘텐츠 생성*

AFT 부트스트랩 파일과 해당 콘텐츠를 생성하기 위해 솔루션은 Lambda 함수와 S3 버킷을 사용합니다. 함수는 버킷에 폴더를 생성한 다음 폴더 내에 `main.tf` 및 라는 두 개의 파일을 생성합니다`backend.tf`. 또한 함수는 제공된 CloudFormation 파라미터를 처리하고 이러한 파일을 사전 정의된 코드로 채워 각 파라미터 값을 대체합니다.

파일을 생성하기 위한 템플릿으로 사용되는 코드를 보려면 솔루션의 [GitHub 리포지토리](https://github.com/aws-samples/aft-bootstrap-pipeline)를 참조하세요. 기본적으로 파일은 다음과 같이 생성됩니다.

**main.tf**

```
module "aft" {
  source = "github.com/aws-ia/terraform-aws-control_tower_account_factory?ref=<aft_version>"

  # Required variables
  ct_management_account_id  = "<ct_management_account_id>"
  log_archive_account_id    = "<log_archive_account_id>"
  audit_account_id          = "<audit_account_id>"
  aft_management_account_id = "<aft_management_account_id>"
  ct_home_region            = "<ct_home_region>"

  # Optional variables
  tf_backend_secondary_region = "<tf_backend_secondary_region>"
  aft_metrics_reporting       = "<false|true>"

  # AFT Feature flags
  aft_feature_cloudtrail_data_events      = "<false|true>"
  aft_feature_enterprise_support          = "<false|true>"
  aft_feature_delete_default_vpcs_enabled = "<false|true>"

  # Terraform variables
  terraform_version      = "<terraform_version>"
  terraform_distribution = "<terraform_distribution>"

  # VCS variables (if you have chosen an external VCS)
  vcs_provider                                  = "<github|githubenterprise|gitlab|gitlabselfmanaged|bitbucket>"
  account_request_repo_name                     = "<org-name>/aft-account-request"
  account_customizations_repo_name              = "<org-name>/aft-account-customizations"
  account_provisioning_customizations_repo_name = "<org-name>/aft-account-provisioning-customizations"
  global_customizations_repo_name               = "<org-name>/aft-global-customizations"

}
```

**backend.tf**

```
terraform {
  backend "s3" {
    region = "<aft-main-region>"
    bucket = "<s3-bucket-name>"
    key    = "aft-setup.tfstate"
  }
}
```

CodeCommit 리포지토리를 생성하는 동안 `Generate AFT Files` 파라미터를 로 설정하면 `true`템플릿은 생성된 콘텐츠가 있는 S3 버킷을 `main`브랜치의 소스로 사용하여 리포지토리를 자동으로 채웁니다.

*파이프라인 실행*

리소스가 생성되고 부트스트랩 파일이 구성되면 파이프라인이 실행됩니다. 첫 번째 단계(*소*스)는 리포지토리의 기본 브랜치에서 소스 코드를 가져오고, 두 번째 단계(*빌드*)는 Terraform 계획 명령을 실행하고 검토할 결과를 생성합니다. 세 번째 단계(*승인*)에서 파이프라인은 수동 작업이 마지막 단계(*배포*)를 승인하거나 거부할 때까지 기다립니다. 마지막 단계에서 파이프라인은 이전 Terraform `apply` 명령의 결과를 입력으로 사용하여 Terraform `plan` 명령을 실행합니다. 마지막으로 교차 계정 역할과 관리 계정의 권한을 사용하여 AFT 관리 계정에서 AFT 리소스를 생성합니다.

**참고**  
외부 VCS 공급자를 선택하는 경우 VCS 공급자 자격 증명과의 연결을 승인해야 합니다. 설정을 완료하려면 AWS 개발자 도구 콘솔 설명서의 [보류 중인 연결 업데이트](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-update.html)의 단계를 따르세요.

## 도구
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-tools"></a>

**서비스**
+ [CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)를 사용하면 AWS 리소스를 설정하고, 리소스를 빠르고 일관되게 프로비저닝하고, AWS 계정 및 리전의 수명 주기 동안 리소스를 관리할 수 있습니다.
+ [AWS CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html)는 소스 코드를 컴파일하고 유닛 테스트를 실행하며 배포할 준비가 완료된 아티팩트를 생성하는 완전 관리형 빌드 서비스입니다. 
+ [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html)은 나만의 소스 제어 시스템을 관리할 필요 없이 Git 리포지토리를 비공개로 저장하고 관리할 수 있는 버전 제어 서비스입니다.
+ [AWS CodePipeline](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html)은 소프트웨어 릴리스의 여러 단계를 신속하게 모델링하고 구성하고 소프트웨어 변경 내용을 지속적으로 릴리스하는 데 필요한 단계를 자동화합니다.
+ [AWS CodeConnections](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html)를 사용하면 CodePipeline과 같은 AWS 리소스와 서비스가 GitHub와 같은 외부 코드 리포지토리에 연결할 수 있습니다.
+ [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html)는 이벤트에 대한 응답으로 코드를 실행하고 컴퓨팅 리소스를 자동으로 관리하는 컴퓨팅 서비스로, 프로덕션용 최신 서버리스 애플리케이션을 빠르게 생성할 수 있는 방법을 제공합니다.
+ [AWS SDK for Python (Boto3)](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html)는 Python 애플리케이션, 라이브러리 또는 스크립트를와 통합하는 데 도움이 되는 소프트웨어 개발 키트입니다 AWS 서비스.

**기타 도구**
+ [Terraform](https://developer.hashicorp.com/terraform?product_intent=terraform)은 인프라를 안전하고 효율적으로 구축, 변경 및 버전할 수 있는 코드형 인프라(IaC) 도구입니다. 여기에는 컴퓨팅 인스턴스, 스토리지 및 네트워킹과 같은 하위 수준 구성 요소와 DNS 항목 및 SaaS 기능과 같은 상위 수준 구성 요소가 포함됩니다.
+ [Python](https://docs.python.org/3.9/tutorial/index.html)은 배우기 쉽고 강력한 프로그래밍 언어입니다. 효율적인 상위 수준 데이터 구조를 가지며 객체 지향 프로그래밍에 대한 간단하지만 효과적인 접근 방식을 제공합니다.

**코드 리포지토리**

이 패턴의 코드는 GitHub [AFT 부트스트랩 파이프라인 리포지토리](https://github.com/aws-samples/aft-bootstrap-pipeline)에서 확인할 수 있습니다.

공식 AFT 리포지토리는 GitHub의 [AWS Control Tower Account Factory for Terraform](https://github.com/aws-ia/terraform-aws-control_tower_account_factory/tree/main)을 참조하세요.

## 모범 사례
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-best-practices"></a>

제공된 CloudFormation 템플릿을 사용하여 AFT를 배포할 때는 모범 사례를 따라 안전하고 효율적이며 성공적인 구현을 보장하는 것이 좋습니다. AFT 구현 및 운영에 대한 주요 지침 및 권장 사항은 다음과 같습니다.
+ **파라미터에 대한 철저한 검토**: CloudFormation 템플릿의 각 파라미터를 주의 깊게 검토하고 이해합니다. AFT를 올바르게 설정하고 작동하려면 정확한 파라미터 구성이 중요합니다.
+ **정기적인 템플릿 업데이트**: 템플릿을 최신 AWS 기능 및 Terraform 버전으로 업데이트합니다. 정기 업데이트는 새로운 기능을 활용하고 보안을 유지하는 데 도움이 됩니다.
+ **버전 관리**: AFT 모듈 버전을 고정하고 가능하면 테스트를 위해 별도의 AFT 배포를 사용합니다.
+ **범위**: 인프라 가드레일 및 사용자 지정을 배포하는 데만 AFT를 사용합니다. 애플리케이션을 배포하는 데 사용하지 마세요.
+ **린팅 및 검증**: AFT 파이프라인에는 린트되고 검증된 Terraform 구성이 필요합니다. 구성을 AFT 리포지토리로 푸시하기 전에 lint, validate 및 test를 실행합니다.
+ **Terraform 모듈**: 재사용 가능한 Terraform 코드를 모듈로 빌드하고 항상 조직의 요구 사항에 맞게 Terraform 및 AWS 공급자 버전을 지정합니다.

## 에픽
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-epics"></a>

### AWS 환경 설정 및 구성
<a name="set-up-and-configure-the-aws-environment"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
|  AWS Control Tower 환경을 준비합니다. |  AWS 환경에를 설정하고 구성하여 AWS Control Tower 에 대한 중앙 집중식 관리 및 거버넌스를 보장합니다 AWS 계정. 자세한 내용은 AWS Control Tower 설명서의 [시작하기 AWS Control Tower](https://docs.aws.amazon.com/controltower/latest/userguide/getting-started-with-control-tower.html)를 참조하세요. | 클라우드 관리자 | 
| AFT 관리 계정을 시작합니다. |  AWS Control Tower Account Factory를 사용하여 AFT 관리 계정으로 사용할 새 AWS 계정 를 시작합니다. 자세한 내용은 AWS Control Tower 설명서의 [AWS Service Catalog Account Factory로 계정 프로비저닝](https://docs.aws.amazon.com/controltower/latest/userguide/provision-as-end-user.html)을 참조하세요. | 클라우드 관리자 | 

### 관리 계정의 CloudFormation 템플릿 배포
<a name="deploy-the-cfnshort-template-in-the-management-account"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| CloudFormation 템플릿을 실행합니다. | 이 에픽에서는이 솔루션과 함께 제공된 CloudFormation 템플릿을 배포하여 AWS 관리 계정에서 AFT 부트스트랩 파이프라인을 설정합니다. 파이프라인은 이전 에픽에서 설정한 AFT 관리 계정에 AFT 솔루션을 배포합니다.**1단계: CloudFormation 콘솔 열기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**2단계: 새 스택 만들기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**3단계: 스택 파라미터 구성**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**4단계: 파일 생성 결정**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**5단계: AWS Control Tower 및 AFT 계정 세부 정보 입력**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**6단계: AFT 옵션 구성**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**7단계: 버전 지정**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**8단계: 스택 검토 및 생성**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**9단계: 스택 생성 모니터링**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**10단계: 배포 확인**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html) | 클라우드 관리자 | 

### AFT 부트스트랩 리포지토리 및 파이프라인 채우기 및 검증
<a name="populate-and-validate-the-aft-bootstrap-repository-and-pipeline"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 옵션 1: 외부 VCS에 대한 AFT 부트스트랩 리포지토리를 채웁니다. | VCS 공급자를 외부 VCS(CodeCommit 아님)로 설정한 경우 다음 단계를 따릅니다.(선택 사항) CloudFormation 템플릿을 배포한 후 새로 생성된 AFT 부트스트랩 리포지토리의 콘텐츠를 채우거나 검증하고 파이프라인이 성공적으로 실행되었는지 테스트할 수 있습니다.**1단계: 연결 업데이트**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**2단계: 리포지토리 채우기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**2단계: 변경 사항 커밋 및 푸시**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html) | 클라우드 관리자 | 
| 옵션 2: CodeCommit용 AFT 부트스트랩 리포지토리를 채웁니다. | VCS 공급자를 CodeCommit으로 설정한 경우 다음 단계를 따릅니다.(선택 사항) CloudFormation 템플릿을 배포한 후 새로 생성된 AFT 부트스트랩 리포지토리의 콘텐츠를 채우거나 검증하고 파이프라인이 성공적으로 실행되었는지 테스트할 수 있습니다.`Generate AFT Files` 파라미터를 로 설정한 경우 다음 스토리(파이프라인 검증)로 `true`건너뜁니다.**1단계: 리포지토리 채우기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**2단계: 변경 사항 커밋 및 푸시**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html) | 클라우드 관리자 | 
| AFT 부트스트랩 파이프라인을 검증합니다. | **1단계: 파이프라인 보기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**2단계: Terraform 계획 결과 승인**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**3단계: 배포 대기**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html)**4단계: 생성된 리소스 확인**[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline.html) | 클라우드 관리자 | 

## 문제 해결
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-troubleshooting"></a>


| 문제 | Solution | 
| --- | --- | 
| CloudFormation 템플릿에 포함된 사용자 지정 Lambda 함수는 배포 중에 실패합니다. | Lambda 함수에 대한 Amazon CloudWatch logs를 확인하여 오류를 식별합니다. 로그는 자세한 정보를 제공하며 특정 문제를 정확히 찾아내는 데 도움이 될 수 있습니다. Lambda 함수에 필요한 권한이 있고 환경 변수가 올바르게 설정되었는지 확인합니다. | 
| 부적절한 권한으로 인해 리소스 생성 또는 관리에 오류가 발생합니다. | Lambda 함수, CodeBuild 및 배포와 관련된 기타 서비스에 연결된 IAM 역할 및 정책을 검토합니다. 필요한 권한이 있는지 확인합니다. 권한 문제가 있는 경우 IAM 정책을 조정하여 필요한 액세스 권한을 부여합니다. | 
| 이전 버전의 CloudFormation 템플릿을 최신 AWS 서비스 또는 Terraform 버전과 함께 사용하고 있습니다. | 최신 AWS 및 Terraform 릴리스와 호환되도록 CloudFormation 템플릿을 정기적으로 업데이트합니다. 릴리스 정보 또는 설명서에서 버전별 변경 사항 또는 요구 사항을 확인하세요. | 
| 배포 중에 할당 AWS 서비스 량에 도달합니다. | 파이프라인을 배포하기 전에 S3 버킷, IAM 역할 및 Lambda 함수와 같은 리소스의 할당 AWS 서비스 량을 확인합니다. 필요한 경우 증가를 요청합니다. 자세한 내용은 AWS 웹 사이트의 [AWS 서비스 할당량을 참조하세요](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html). | 
| CloudFormation 템플릿에서 잘못된 입력 파라미터로 인해 오류가 발생합니다. | 모든 입력 파라미터에 오타 또는 잘못된 값이 있는지 다시 확인합니다. 계정 ID 및 리전 이름과 같은 리소스 식별자가 정확한지 확인합니다. | 

## 관련 리소스
<a name="implement-account-factory-for-terraform-aft-by-using-a-bootstrap-pipeline-resources"></a>

이 패턴을 성공적으로 구현하려면 다음 리소스를 검토합니다. 이러한 리소스는를 사용하여 AFT를 설정하고 관리하는 데 유용할 수 있는 추가 정보와 지침을 제공합니다 CloudFormation.

**AWS** **설명서:**
+ [AWS Control Tower 사용 설명서](https://docs.aws.amazon.com/controltower/latest/userguide/what-is-control-tower.html)에서는 설정 및 관리에 대한 자세한 정보를 제공합니다 AWS Control Tower.
+ [CloudFormation 설명서](https://docs.aws.amazon.com/cloudformation/index.html)는 CloudFormation 템플릿, 스택 및 리소스 관리에 대한 인사이트를 제공합니다.

**IAM 정책 및 모범 사례:**
+ [IAM의 보안 모범 사례](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)IAM 역할 및 정책을 사용하여 AWS 리소스를 보호하는 방법을 설명합니다.

**Terraform 기반 AWS:**
+ [Terraform AWS Provider 설명서](https://registry.terraform.io/providers/hashicorp/aws/latest/docs)는 Terraform을와 함께 사용하는 방법에 대한 포괄적인 정보를 제공합니다 AWS.

**AWS 서비스 할당량:**
+ [AWS 서비스 할당량은](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) 할당 AWS 서비스 량을 보는 방법과 증가를 요청하는 방법에 대한 정보를 제공합니다.