

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

# 를 사용하여 리전 간 피어링 설정 자동화 AWS Transit Gateway
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway"></a>

*Ram Kandaswamy, Amazon Web Services*

## 요약
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-summary"></a>

[AWS Transit Gateway](https://docs.aws.amazon.com/vpc/latest/tgw/what-is-transit-gateway.html)는 중앙 허브를 통해 Virtual Private Cloud(VPCs)와 온프레미스 네트워크를 연결합니다. Transit Gateway 트래픽은 퍼블릭 인터넷을 통과하지 않으므로 일반적인 악용 및 분산 서비스 거부(DDoS) 공격과 같은 위협 벡터가 줄어듭니다.

둘 이상의 간에 통신해야 하는 경우 리전 간 Transit Gateway 피어링을 사용하여 서로 다른 리전의 전송 게이트웨이 간에 피어링 연결을 설정할 AWS 리전수 있습니다. 그러나 Transit Gateway를 사용하여 리전 간 피어링을 수동으로 구성하는 것은 복잡하고 시간이 많이 걸릴 수 있습니다. 이 패턴은 코드형 인프라(IaC)를 사용하여 피어링을 설정하는 지침을 제공합니다. 여러 리전을 반복적으로 구성해야 하고 다중 리전 조직 설정을 AWS 계정 위해이 접근 방식을 사용할 수 있습니다.

이 패턴은 Amazon CloudWatch Logs에 an AWS Step Functions [workflow](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-statemachines.html), AWS Lambda [functions](https://docs.aws.amazon.com/lambda/latest/dg/concepts-basics.html#gettingstarted-concepts-function), AWS Identity and Access Management (IAM) [역할](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) 및 [로그 그룹을](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) 포함하는 [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)스택을 설정합니다. 그런 다음 Step Functions 워크플로를 실행하여 전송 게이트웨이에 대한 리전 간 피어링 연결을 생성합니다.

## 사전 조건 및 제한 사항
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-prereqs"></a>

**사전 조건 **
+ 활성. AWS 계정
+ [Kiro](https://kiro.dev/#what-is-kiro)와 같은 코드 생성 기능이 있는 IDE입니다.
+ Amazon Simple Storage Service(Amazon S3) 버킷 및 객체를 업로드할 수 있는 권한.
+ 요청 및 수락 리전에서 생성된 전송 게이트웨이입니다.
+ 요청 및 수락 리전에서 생성된 VPCs. 값이 인 `addToTransitGateway` 키로 VPCs에 태그를 지정합니다`true`.
+ 요구 사항에 따라 VPCs에 대해 구성된 [보안 그룹](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html)입니다.
+ 요구 사항에 따라 VPCs에 대해 구성된 [네트워크 액세스 제어 목록(ACLs)](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html)입니다.

**제한 사항 **
+ 일부 만 리전 간 피어링을 AWS 리전 지원합니다. 리전 간 피어링을 지원하는 리전의 전체 목록은 [AWS Transit Gateway FAQs](https://aws.amazon.com/transit-gateway/faqs/).

## 아키텍처
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-architecture"></a>

 이 패턴에 설명된 에이전트 AI 개발 접근 방식에는 다음 단계가 포함됩니다.

1. **자동화 프롬프트 정의** - Kiro는 피어링 요구 사항을 자세히 설명하는 자연어 프롬프트를 수신합니다.

1. **자동화 스크립트 생성 **- Kiro는 제공된 프롬프트를 기반으로 CloudFormation 및 Lambda 스크립트를 생성합니다.

1. **스택 배포** - Kiro는 CloudFormation을 사용하여 필요한 리소스를 배포합니다.

1. **피어링 설정** - Kiro는 Lambda 함수를 호출하여 피어링 연결을 생성하고 라우팅 테이블을 수정하는 Step Functions 워크플로를 실행합니다.

다음 다이어그램은 Step Functions 워크플로를 보여줍니다.

![\[Step Functions 워크플로는 Transit Gateway 피어링을 위한 라우팅 테이블을 수정하기 위해 Lambda 함수를 직접 호출합니다.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/b678bb87-c7b9-4f7b-b26e-eaac650e5d1b/images/2f235f47-5d68-492c-b954-7dc170939cae.png)


 

워크플로우는 다음 단계로 구성됩니다.

1. Step Functions 워크플로는 Transit Gateway 피어링을 위해 Lambda 함수를 호출합니다. 

1. 워크플로는 1분 동안 기다립니다.

1. 워크플로는 피어링 상태를 검색하여 조건 블록으로 전송합니다. 블록은 루핑을 담당합니다. 

1. 성공 조건이 충족되지 않으면 워크플로가 타이머 단계에 들어가도록 코딩됩니다. 

1. 성공 조건이 충족되면 Lambda 함수가 라우팅 테이블을 수정합니다.

1. Step Functions 워크플로가 종료됩니다.

## 도구
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-tools"></a>
+ [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)를 사용하면 AWS 리소스를 설정하고, 빠르고 일관되게 프로비저닝하고, AWS 계정 및의 수명 주기 동안 리소스를 관리할 수 있습니다 AWS 리전. 
+ [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html)를 사용하면 모든 시스템, 애플리케이션 및의 로그를 중앙 집중화 AWS 서비스 하여 모니터링하고 안전하게 보관할 수 있습니다.
+ [AWS Identity and Access Management](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)[ (](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)[IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)[)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)는 AWS 리소스에 대한 액세스를 인증하고 사용할 수 있는 권한을 부여받은 사용자를 제어하여 리소스에 대한 액세스를 안전하게 관리하는 데 도움이 됩니다.
+ [Kiro](https://kiro.dev/#what-is-kiro)는 사양 기반 개발을 통해 프로덕션 지원 애플리케이션을 구축하는 데 도움이 되는 에이전트 AI 개발 도구입니다. 
+ [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html)는 서버를 프로비저닝하거나 관리할 필요 없이 코드를 실행하는 데 도움이 되는 컴퓨팅 서비스입니다. 필요할 때만 코드를 실행하며 자동으로 확장이 가능하므로 사용한 컴퓨팅 시간만큼만 비용을 지불합니다.
+ [AWS Step Functions](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html)는 AWS Lambda 함수 및 기타를 결합하여 비즈니스 크리티컬 애플리케이션을 구축하는 AWS 서비스 데 도움이 되는 서버리스 오케스트레이션 서비스입니다.  

## 에픽
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-epics"></a>

### Lambda 및 Step Functions 코드 생성
<a name="generate-lam-and-sfn-code"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 프롬프트 자리 표시자를 특정 세부 정보로 채우기 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html)또는 컨텍스트용 파일을 연결하지 않고 위의 변수를 참조하는 인라인 프롬프트로 추가할 수 있습니다. | 일반 AWS, 네트워크 관리자 | 
| 피어링 연결을 생성하는 Lambda 함수를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html) | 일반 AWS, 네트워크 관리자, 프롬프트 엔지니어링 | 
| 피어링 연결 상태를 폴링하는 Lambda 함수를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html) | 일반 AWS, 네트워크 관리자, 프롬프트 엔지니어링 | 
| 두 리전 모두에 정적 경로를 추가하는 Lambda 함수를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html) | 일반 AWS, 네트워크 관리자 | 
| CloudFormation 템플릿을 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html) | AWS DevOps, 일반 AWS, 프롬프트 엔지니어링 | 

### AWS 리소스 배포
<a name="deploy-the-aws-resources"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 프롬프트를 사용하여 CloudFormation 스택을 배포합니다. | 다음 프롬프트를 입력합니다.<pre>Using the outputs from Prompts 1-4, package and deploy the full stack. Steps:<br /><br />1. For each of the three Python files from Prompts 1-3, create a zip named after the file (e.g. peer-transit-gateway.zip that contains peer-transit-gateway.py).<br />2. Upload all three zips to S3_BUCKET.<br />3. Deploy the CloudFormation template from Prompt 4 to ACTIVE_REGION with S3BucketName=S3_BUCKET and CAPABILITY_NAMED_IAM.<br />4. Initiate the Step Function from the deployed stack.<br /><br />Zip file names must match the S3Key values in the template exactly.</pre> | AWS DevOps, 클라우드 관리자, 일반 AWS, 프롬프트 엔지니어링 | 
| 배포를 검증합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/automate-the-setup-of-inter-region-peering-with-aws-transit-gateway.html) | 일반 AWS | 

## 관련 리소스
<a name="automate-the-setup-of-inter-region-peering-with-aws-transit-gateway-resources"></a>
+ [Step Functions에서 상태 시스템 실행 시작](https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-executions.html)
+ [Transit Gateway 피어링 연결](https://docs.aws.amazon.com/vpc/latest/tgw/tgw-peering.html)
+ [VPCs 상호 연결 AWS 리전AWS Transit Gateway](https://www.youtube.com/watch?v=cj1rQqLxXU8)(비디오)