

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

# 나에게 적합한 파이프라인 유형은 무엇인가요?
<a name="pipeline-types-planning"></a>

파이프라인 유형은 각 파이프라인 버전에서 지원하는 특성 및 기능 집합에 따라 결정됩니다.

다음은 각 파이프라인 유형에 사용할 수 있는 사용 사례 및 특성에 대한 요약입니다.


****  

|  | V1 유형 | V2 유형 | 특성 |  |  | 
| --- | --- | --- | --- | --- | --- | 
| 사용 사례 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/codepipeline/latest/userguide/pipeline-types-planning.html)  |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/ko_kr/codepipeline/latest/userguide/pipeline-types-planning.html)  | 
| [작업 수준 변수](https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-variables.html) | 지원됨 | 지원됨 | 
| [병렬 실행 모드](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html#concepts-how-it-works-executions-parallel) | 지원되지 않음 | 지원됨 | 
| [파이프라인 수준 변수](https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-pipeline-variables.html) | 지원되지 않음 | 지원됨 | 
| [대기열 실행 모드](https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html#concepts-how-it-works-executions-queued) | 지원되지 않음 | 지원됨 | 
| [파이프라인 단계에 대한 롤백](https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-rollback.html) | 지원되지 않음 | 지원됨 | 
| [소스 개정 재정의](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-trigger-source-overrides.html) | 지원되지 않음 | 지원됨 | 
| [스테이지 조건](https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-conditions.html) | 지원되지 않음 | 지원됨 | 
| [Git 태그, 풀 요청, 브랜치 또는 파일 경로 트리거 및 필터링](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-filter.html) | 지원되지 않음 | 지원됨 | 
| [명령 작업](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-Commands.html) | 지원되지 않음 | 지원됨 | 
| [ 건너뛰기 결과를 사용하여 입력 조건 생성](https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-conditions.html#stage-conditions-entry-skip) | 지원되지 않음 | 지원됨 | 
| [실패 시 자동 재시도를 위한 스테이지 구성](https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-retry.html#stage-retry-auto) | 지원되지 않음 | 지원됨 | 

CodePipeline에 대한 요금 정보는 [요금](https://aws.amazon.com/codepipeline/pricing/)을 참조하세요.

Python 스크립트를 생성하고 실행하여 V1 유형 파이프라인을 V2 유형 파이프라인으로 이동하는 데 드는 잠재적 비용을 분석할 수 있습니다.

**참고**  
아래 샘플 스크립트는 데모 및 평가 목적으로만 사용됩니다. 이는 견적 도구가 아니며 V2 유형 파이프라인의 실제 사용에 대한 비용을 보장하지 않으며 적용될 수 있는 세금은 포함되지 않습니다. CodePipeline에 대한 요금 정보는 [요금](https://aws.amazon.com/codepipeline/pricing/)을 참조하세요.

**V1 유형 파이프라인을 V2 유형 파이프라인으로 이동하는 비용을 평가할 수 있는 스크립트를 생성하고 실행하려면**

1. Python을 다운로드하여 설치하세요.

1. 터미널 창을 엽니다. 다음 명령을 실행하여 **PipelineCostAnalyzer.py**라는 새 python 스크립트를 생성합니다.

   ```
   vi PipelineCostAnalyzer.py
   ```

1. 다음 코드를 복사하여 **PipelineCostAnalyzer.py** 스크립트에 붙여 넣습니다.

   ```
   import boto3
   import sys
   import math
   from datetime import datetime, timedelta, timezone
   
   if len(sys.argv) < 3:
       raise Exception("Please provide region name and pipeline name as arguments. Example usage: python PipelineCostAnalyzer.py us-east-1 MyPipeline")
   session = boto3.Session(profile_name='default', region_name=sys.argv[1])
   pipeline = sys.argv[2]
   codepipeline = session.client('codepipeline')
   
   def analyze_cost_in_v2(pipeline_name):
       if codepipeline.get_pipeline(name=pipeline)['pipeline']['pipelineType'] == 'V2':
           raise Exception("Provided pipeline is already of type V2.")
       total_action_executions = 0
       total_blling_action_executions = 0
       total_action_execution_minutes = 0
       cost = 0.0
       hasNextToken = True
       nextToken = ""
   
       while hasNextToken:
           if nextToken=="":
               response = codepipeline.list_action_executions(pipelineName=pipeline_name)
           else:
               response = codepipeline.list_action_executions(pipelineName=pipeline_name, nextToken=nextToken)
           if 'nextToken' in response:
               nextToken = response['nextToken']
           else:
               hasNextToken= False
           for action_execution in response['actionExecutionDetails']:
               start_time = action_execution['startTime']
               end_time = action_execution['lastUpdateTime']
               if (start_time < (datetime.now(timezone.utc) - timedelta(days=30))):
                   hasNextToken= False
                   continue
               total_action_executions += 1
               if (action_execution['status'] in ['Succeeded', 'Failed', 'Stopped']):
                   action_owner = action_execution['input']['actionTypeId']['owner']
                   action_category = action_execution['input']['actionTypeId']['category']
                   if (action_owner == 'Custom' or (action_owner == 'AWS' and action_category == 'Approval')):
                       continue
                   
                   total_blling_action_executions += 1
                   action_execution_minutes = (end_time - start_time).total_seconds()/60
                   action_execution_cost = math.ceil(action_execution_minutes) * 0.002
                   total_action_execution_minutes += action_execution_minutes
                   cost = round(cost + action_execution_cost, 2)
   
       print ("{:<40}".format('Activity in last 30 days:'))
       print ("| {:<40} | {:<10}".format('___________________________________', '__________________'))
       print ("| {:<40} | {:<10}".format('Total action executions:', total_action_executions))
       print ("| {:<40} | {:<10}".format('Total billing action executions:', total_blling_action_executions))
       print ("| {:<40} | {:<10}".format('Total billing action execution minutes:', round(total_action_execution_minutes, 2)))
       print ("| {:<40} | {:<10}".format('Cost of moving to V2 in $:', cost - 1))
   
   analyze_cost_in_v2(pipeline)
   ```

1. 터미널 또는 명령 프롬프트에서 분석기 스크립트를 생성한 디렉터리를 변경합니다.

   해당 디렉터리에서 다음 명령을 실행합니다. 여기서 *region*은 분석하려는 V1 파이프라인을 생성한 AWS 리전 입니다. 이름을 제공하여 특정 파이프라인을 선택적으로 평가할 수도 있습니다.

   ```
   python3 PipelineCostAnalyzer.py region --pipelineName
   ```

   예를 들어 다음 명령을 실행하여 **PipelineCostAnalyzer.py**라는 Python 스크립트를 실행합니다. 이 예제에서 리전은 `us-west-2`입니다.

   ```
   python3 PipelineCostAnalyzer.py us-west-2
   ```
**참고**  
이 스크립트는 특정 파이프라인 이름을 지정하지 않는 한 지정된 AWS 리전 의 모든 V1 파이프라인을 분석합니다.

1. 스크립트의 다음 샘플 출력에서 작업 실행 목록, 청구에 적합한 작업 실행 목록, 이러한 작업 실행의 총 런타임, V2 파이프라인에서 수행된 이러한 작업의 예상 비용을 볼 수 있습니다.

   ```
   Activity in last 30 days: 
    | ___________________________________      | __________________
    | Total action executions:                 | 9         
    | Total billing action executions:         | 9         
    | Total billing action execution minutes:  | 5.59      
    | Cost of moving to V2 in $:               | -0.76
   ```

   이 예제에서 마지막 행의 음수 값은 V2 유형 파이프라인으로 이동하여 저장할 수 있는 예상 금액을 나타냅니다.
**참고**  
비용 및 기타 정보를 보여주는 스크립트 출력 및 관련 예제는 추정치일 뿐입니다. 데모 및 평가 목적으로만 사용되며 실제 절감액을 보장하지 않습니다. CodePipeline에 대한 요금 정보는 [요금](https://aws.amazon.com/codepipeline/pricing/)을 참조하세요.