

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

# DeploymentPreference
<a name="sam-property-function-deploymentpreference"></a>

점진적 Lambda 배포를 지원하는 구성을 지정합니다. 점진적 Lambda 배포 구성에 대한 자세한 내용은 [를 사용하여 서버리스 애플리케이션 점진적으로 배포 AWS SAM](automating-updates-to-serverless-apps.md)을 참조하세요.

**참고**  
`AutoPublishAlias` 객체를 사용하려면 [AWS::Serverless::Function](sam-resource-function.md)에서 `DeploymentPreference`을 지정해야 합니다. 그렇지 않으면 오류가 발생합니다.

## 구문
<a name="sam-property-function-deploymentpreference-syntax"></a>

 AWS Serverless Application Model (AWS SAM) 템플릿에서이 개체를 선언하려면 다음 구문을 사용합니다.

### YAML
<a name="sam-property-function-deploymentpreference-syntax.yaml"></a>

```
  [Alarms](#sam-function-deploymentpreference-alarms): {{List}}
  [Enabled](#sam-function-deploymentpreference-enabled): {{Boolean}}
  [Hooks](#sam-function-deploymentpreference-hooks): {{Hooks}}
  [PassthroughCondition](#sam-function-deploymentpreference-passthroughcondition): {{Boolean}}
  [Role](#sam-function-deploymentpreference-role): {{String}}
  [TriggerConfigurations](#sam-function-deploymentpreference-triggerconfigurations): {{List}}
  [Type](#sam-function-deploymentpreference-type): {{String}}
```

## 속성
<a name="sam-property-function-deploymentpreference-properties"></a>

 `Alarms`   <a name="sam-function-deploymentpreference-alarms"></a>
배포로 인해 발생한 오류로 인해 트리거하고자 하는 CloudWatch 경보의 목록입니다.  
이 속성은 `Fn::If` 내장 함수를 받아들입니다. `Fn::If`를 사용하는 예제 템플릿은 이 항목 하단의 예제 섹션을 참조하세요.  
*유형*: 목록  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `Enabled`   <a name="sam-function-deploymentpreference-enabled"></a>
이 배포 환경 설정이 활성화되어 있는지 여부입니다.  
*유형*: 부울  
*필수 항목 여부*: 아니요  
*기본값*: True  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `Hooks`   <a name="sam-function-deploymentpreference-hooks"></a>
트래픽 이동 전후에 실행되는 Lambda 함수를 검증합니다.  
*유형*: [Hooks](sam-property-function-hooks.md)  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `PassthroughCondition`   <a name="sam-function-deploymentpreference-passthroughcondition"></a>
True인 경우 이 배포 선호가 활성화되어 있으면, 생성된 CodeDeploy 리소스로 함수의 조건이 전달됩니다. 일반적으로 이 값을 True로 설정해야 합니다. 그렇지 않으면 함수의 조건이 False로 확인되더라도 CodeDeploy 리소스가 생성됩니다.  
*유형*: 부울  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `Role`   <a name="sam-function-deploymentpreference-role"></a>
CodeDeploy가 트래픽 이동에 사용할 IAM 역할 ARN입니다. 이것이 제공되면 IAM 역할이 생성되지 않습니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

 `TriggerConfigurations`   <a name="sam-function-deploymentpreference-triggerconfigurations"></a>
배포 그룹에 연결하고자 하는 트리거 구성의 목록입니다. 라이프사이클 이벤트에 관한 SNS 주제를 알리는 데 사용됩니다.  
*유형*: 목록  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::CodeDeploy::DeploymentGroup` 리소스의 `[TriggerConfigurations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codedeploy-deploymentgroup.html#cfn-codedeploy-deploymentgroup-triggerconfigurations)` 속성으로 직접 전달됩니다.

 `Type`   <a name="sam-function-deploymentpreference-type"></a>
현재 배포 유형에는 Linear와 Canary라는 두 가지 카테고리가 있습니다. 사용할 수 있는 배포 유형에 대한 자세한 내용은 [를 사용하여 서버리스 애플리케이션 점진적으로 배포 AWS SAM](automating-updates-to-serverless-apps.md)섹션을 참조하세요.  
*유형*: 문자열  
*필수 항목 여부:* 예  
*CloudFormation 호환성*:이 속성은에 고유 AWS SAM 하며 CloudFormation 동등한 속성이 없습니다.

## 예제
<a name="sam-property-function-deploymentpreference--examples"></a>

### 사전 및 사후 트래픽 후크가 포함된 DeploymentPreference.
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-pre--and-post-traffic-hooks."></a>

트래픽 전후 훅이 포함된 배포 환경 설정 예입니다.

#### YAML
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-pre--and-post-traffic-hooks.--yaml"></a>

```
DeploymentPreference:
  Enabled: true
  Type: Canary10Percent10Minutes 
  Alarms:
    - !Ref: AliasErrorMetricGreaterThanZeroAlarm
    - !Ref: LatestVersionErrorMetricGreaterThanZeroAlarm
  Hooks:
    PreTraffic:
      !Ref: PreTrafficLambdaFunction
    PostTraffic:
      !Ref: PostTrafficLambdaFunction
```

### Fn: :If 내장 함수를 사용한 DeploymentPreference
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-fn::if-intrinsic-function"></a>

알람 구성에 `Fn::If`를 사용하는 배포 환경 설정의 예입니다. 이 예제에서는 `Alarm1`가 `MyCondition`인 경우 `true`이 구성되고, `Alarm2`이 `Alarm5`이면 `MyCondition` 및 `false`가 구성될 것입니다.

#### YAML
<a name="sam-property-function-deploymentpreference--examples--deploymentpreference-with-fn::if-intrinsic-function--yaml"></a>

```
DeploymentPreference:
  Enabled: true
  Type: Canary10Percent10Minutes 
  Alarms:
    Fn::If:
      - MyCondition
      - - Alarm1
      - - Alarm2
        - Alarm5
```