

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

# AWS CloudFormation을 사용하여 Bitbucket 리포지토리를 AWS Amplify와 통합
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation"></a>

*Alwin Abraham, Amazon Web Services*

## 요약
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-summary"></a>

AWS Amplify를 사용하면 일반적으로 필요한 인프라를 설정하지 않고도 정적 웹 사이트를 빠르게 배포하고 테스트할 수 있습니다. 조직에서 기존 애플리케이션 코드를 마이그레이션하든 새 애플리케이션을 구축하든 관계없이 소스 제어에 Bitbucket을 사용하려는 경우 이 패턴의 접근 방식을 배포할 수 있습니다. AWS CloudFormation을 사용하여 Amplify를 자동으로 설정하면 사용 중인 구성에 대한 가시성을 제공할 수 있습니다.

이 패턴은 AWS CloudFormation을 사용하여 Bitbucket 리포지토리를 AWS Amplify와 통합함으로써 프런트 엔드 지속적 통합 및 지속적 배포(CI/CD) 파이프라인 및 배포 환경을 만드는 방법을 설명합니다. 이 패턴의 접근 방식은 반복 가능한 배포를 위한 Amplify 프런트 엔드 파이프라인을 구축할 수 있음을 의미합니다.

## 사전 조건 및 제한 사항
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-prereqs"></a>

**사전 조건**** **
+ 활성 Amazon Web Services(AWS) 계정
+ 관리자 액세스 권한이 있는 활성 Bitbucket 계정
+ [cURL](https://curl.se/) 또는 [Postman](https://www.postman.com/) 애플리케이션을 사용하는 터미널에 액세스
+ Amplify에 대한 지식
+ AWS CloudFormation에 대한 지식
+ YAML 형식의 파일에 대한 지식

## 아키텍처
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-architecture"></a>

![\[Diagram showing user interaction with Bitbucket repository connected to AWS Amplify in AWS 클라우드 region.\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/images/pattern-img/24ae87ed-aa5d-4114-9c5d-bdcb4d40a78b/images/25d73a9d-d2ae-40bc-9ebc-57f9bd13884a.png)


**기술 스택  **
+ Amplify
+ AWS CloudFormation
+ Bitbucket

## 도구
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-tools"></a>
+ [AWS Amplify](https://docs.aws.amazon.com/amplify/) - Amplify는 개발자가 클라우드 기반 모바일 및 웹 앱을 개발하고 배포할 수 있도록 지원합니다.
+ [AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html) – AWS CloudFormation은 AWS 리소스를 모델링하고 설정하여 리소스 관리 시간을 줄이고 AWS에서 실행되는 애플리케이션에 더 많은 시간을 사용하도록 해 주는 서비스입니다.
+ [Bitbucket](https://bitbucket.org/) - Bitbucket은 전문가 팀을 위해 설계된 Git 리포지토리 관리 솔루션입니다. Git 리포지토리를 관리하고, 소스 코드에 대해 협업하고, 개발 흐름을 안내할 수 있는 중앙 장소를 제공합니다.

 

**코드**

`bitbucket-amplify.yml` 파일(첨부)에는 이 패턴에 대한 AWS CloudFormation 템플릿이 포함되어 있습니다.

## 에픽
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-epics"></a>

### Bitbucket 리포지토리 구성
<a name="configure-the-bitbucket-repository"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| (선택 사항) Bitbucket 리포지토리를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html)기존 Bitbucket 리포지토리를 사용할 수도 있습니다. | DevOps 엔지니어 | 
| 워크스페이스 설정을 엽니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html) | DevOps 엔지니어 | 
| OAuth 소비를 생성합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html) | DevOps 엔지니어 | 
| OAuth 액세스 토큰을 확보합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html)`curl -X POST -u "KEY:SECRET" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials ``KEY` 및 `SECRET`을 이전에 기록한 키와 비밀번호로 바꿉니다. 2. 따옴표를 사용하지 않고 액세스 토큰을 기록합니다. 토큰은 제한된 시간에만 유효하며 기본 시간은 2시간입니다. 이 기간 내에 AWS CloudFormation 템플릿을 실행해야 합니다. | DevOps 엔지니어 | 

### AWS CloudFormation 스택 생성 및 배포
<a name="create-and-deploy-the-aws-cloudformation-stack"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
|  AWS CloudFormation 템플릿을 다운로드합니다. | `bitbucket-amplify.yml` AWS CloudFormation 템플릿(첨부)을 다운로드합니다. 이 템플릿은 Amplify 프로젝트 및 브랜치 외에도 Amplify에서 CI/CD 파이프라인을 생성합니다. |  | 
| AWS CloudFormation 스택을 생성하고 배포합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html)5. **다음**을 선택한 다음 **스택 생성**을 선택합니다. | DevOps 엔지니어 | 

### CI/CD 파이프라인 테스트
<a name="test-the-ci-cd-pipeline"></a>


| 작업 | 설명 | 필요한 기술 | 
| --- | --- | --- | 
| 리포지토리의 브랜치에 코드를 배포합니다. | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/prescriptive-guidance/latest/patterns/integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation.html)자세한 내용은 Bitbucket 설명서의 [기본 Git 명령](https://confluence.atlassian.com/bitbucketserver/basic-git-commands-776639767.html)을 참조하세요.  | 앱 개발자 | 

## 관련 리소스
<a name="integrate-a-bitbucket-repository-with-aws-amplify-using-aws-cloudformation-resources"></a>

[인증 방법](https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication)(Atlassian 설명서)

## 첨부
<a name="attachments-24ae87ed-aa5d-4114-9c5d-bdcb4d40a78b"></a>

이 문서와 관련된 추가 콘텐츠에 액세스하려면 [attachment.zip](samples/p-attach/24ae87ed-aa5d-4114-9c5d-bdcb4d40a78b/attachments/attachment.zip) 파일의 압축을 풉니다.