

AWS Migration Hub Rigration Hub Rigration Hub Ligration Hub L

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

# CloudFormation으로 리팩토링 스페이스 리소스 생성
<a name="creating-resources-with-cloudformation"></a>

AWS Migration Hub 리팩터 스페이스는 다음과 통합됩니다.AWS CloudFormation을 모델링하고 설정하는 데 도움이 되는 서비스입니다.AWS리소스 및 인프라를 생성하고 관리하는 데 소요되는 시간을 줄일 수 있도록 리소스를 생성할 수 있도록 해줍니다. 모든 것을 설명하는 템플릿을 만듭니다.AWS원하는 리소스 (예: 환경, 애플리케이션, 서비스 및 경로)CloudFormation은 해당 리소스를 프로비저닝하고 구성합니다.

을 사용할 때CloudFormation을 사용할 수 있도록 템플릿을 재사용하여 리팩터링 스페이스 리소스를 일관되고 반복적으로 설정할 수 있습니다. 리소스를 한 번 설명한 후 여러 AWS 계정 및 리전에서 동일한 리소스를 반복적으로 프로비저닝할 수 있습니다.

## 리팩터링 스페이스 및 CloudFormation 템플릿
<a name="working-with-templates"></a>

리팩토링 스페이스 및 관련 서비스에 대한 리소스를 프로비저닝하고 구성하려면 이해해야 합니다.[CloudFormation템플릿](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-guide.html). 템플릿은 JSON 또는 YAML로 서식 지정된 텍스트 파일입니다. 이 템플릿은 CloudFormation 스택에서 프로비저닝할 리소스에 대해 설명합니다. JSON 또는 YAML에 익숙하지 않은 경우 CloudFormation Designer를 사용하면 CloudFormation 템플릿을 시작하는 데 도움이 됩니다. 자세한 내용은 *AWS CloudFormation 사용 설명서*에서 [CloudFormation Designer이란 무엇입니까?](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/working-with-templates-cfn-designer.html)를 참조하세요.

리팩터스페이스는 환경, 응용 프로그램, 서비스 및 경로 생성을 지원합니다.CloudFormation. 환경, 애플리케이션, 서비스 및 경로에 대한 JSON 및 YAML 템플릿의 예를 비롯한 자세한 내용은 단원을 참조하세요.[AWS Migration Hub](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html)의*AWS CloudFormation사용 설명서*.

### 템플릿 예제
<a name="working-with-templates-example"></a>

다음 예제 템플릿은 VPC (VPC) 및 리팩토링 스페이스 리소스를 생성합니다. 배포를 선택한 경우CloudFormation템플릿에서 데모 리팩터링 환경을 만들 수 있습니다.시작하기대화 상자에서 리팩터링 스페이스 콘솔에서 다음 템플릿을 배포합니다.

**Example YAML 리팩터링 스페이스 템플릿**  

```
AWSTemplateFormatVersion: '2010-09-09'
Description: This creates resources in one account.
Resources:
  VPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: 10.2.0.0/16
      Tags:
        - Key: Name
          Value: VpcForRefactorSpaces
  PrivateSubnet1:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId: !Ref VPC
      AvailabilityZone: !Select [ 0, !GetAZs  '' ]
      CidrBlock: 10.2.1.0/24
      MapPublicIpOnLaunch: false
      Tags:
        - Key: Name
          Value: RefactorSpaces Private Subnet (AZ1)
  PrivateSubnet2:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId: !Ref VPC
      AvailabilityZone: !Select [ 1, !GetAZs  '' ]
      CidrBlock: 10.2.2.0/24
      MapPublicIpOnLaunch: false
      Tags:
        - Key: Name
          Value: RefactorSpaces Private Subnet (AZ2)
  RefactorSpacesTestEnvironment:
    Type: AWS::RefactorSpaces::Environment
    DeletionPolicy: Delete
    Properties:
      Name: EnvWithMultiAccountServices
      NetworkFabricType: TRANSIT_GATEWAY
      Description: "This is a test environment"
  TestApplication:
    Type: AWS::RefactorSpaces::Application
    DeletionPolicy: Delete
    DependsOn:
      - PrivateSubnet1
      - PrivateSubnet2
    Properties:
      Name: proxytest
      EnvironmentIdentifier: !Ref RefactorSpacesTestEnvironment
      VpcId: !Ref VPC
      ProxyType: API_GATEWAY
      ApiGatewayProxy:
        EndpointType: "REGIONAL"
        StageName: "admintest"
  AdminAccountService:
    Type: AWS::RefactorSpaces::Service
    DeletionPolicy: Delete
    Properties:
      Name: AdminAccountService
      EnvironmentIdentifier: !Ref RefactorSpacesTestEnvironment
      ApplicationIdentifier: !GetAtt TestApplication.ApplicationIdentifier
      EndpointType: URL
      VpcId: !Ref VPC
      UrlEndpoint:
        Url: "http://aws.amazon.com"
  RefactorSpacesDefaultRoute:
    Type: AWS::RefactorSpaces::Route
    Properties:
      RouteType: "DEFAULT"
      EnvironmentIdentifier: !Ref RefactorSpacesTestEnvironment
      ApplicationIdentifier: !GetAtt TestApplication.ApplicationIdentifier
      ServiceIdentifier: !GetAtt AdminAccountService.ServiceIdentifier
  RefactorSpacesURIRoute:
    Type: AWS::RefactorSpaces::Route
    DependsOn: 'RefactorSpacesDefaultRoute'
    Properties:
      RouteType: "URI_PATH"
      EnvironmentIdentifier: !Ref RefactorSpacesTestEnvironment
      ApplicationIdentifier: !GetAtt TestApplication.ApplicationIdentifier
      ServiceIdentifier: !GetAtt AdminAccountService.ServiceIdentifier
      UriPathRoute:
        SourcePath: "/cfn-created-route"
        ActivationState: ACTIVE
        Methods: [ "GET" ]
```

## 클라우드포메이션에 대해 자세히 알아보기
<a name="learn-more-cloudformation"></a>

CloudFormation에 대한 자세한 내용은 다음 리소스를 참조하세요.
+ [AWS CloudFormation](https://aws.amazon.com/cloudformation/)
+ [AWS CloudFormation 사용 설명서](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html)
+ [CloudFormation API 참조](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/Welcome.html)
+ [AWS CloudFormation 명령줄 인터페이스 사용 설명서](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html)