

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

# CloudWatchEvent
<a name="sam-property-function-cloudwatchevent"></a>

`CloudWatchEvent` 이벤트 소스 유형을 설명하는 객체.

AWS Serverless Application Model (AWS SAM)는이 이벤트 유형이 설정되면 [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html) 리소스를 생성합니다.

**중요 참고** 사항: [EventBridgeRule](sam-property-function-eventbridgerule.md)는 대신 사용할 기본 이벤트 소스 유형입니다`CloudWatchEvent`. `EventBridgeRule` 및는 동일한 기본 서비스, API 및 CloudFormation 리소스를 `CloudWatchEvent` 사용합니다. 그러나 AWS SAM 는 에만 새 기능에 대한 지원을 추가합니다`EventBridgeRule`.

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

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

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

```
  [Enabled](#sam-function-cloudwatchevent-enabled): Boolean
  [EventBusName](#sam-function-cloudwatchevent-eventbusname): String
  [Input](#sam-function-cloudwatchevent-input): String
  [InputPath](#sam-function-cloudwatchevent-inputpath): String
  [Pattern](#sam-function-cloudwatchevent-pattern): [EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)
  [State](#sam-function-cloudwatchevent-state): String
```

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

 `Enabled`   <a name="sam-function-cloudwatchevent-enabled"></a>
규칙을 활성화할지를 나타냅니다.  
규칙을 비활성화하려면 이 속성을 `false`로 설정합니다.  
`Enabled` 또는 `State` 속성을 지정할 수 있지만, 두 속성을 함께 지정할 수는 없습니다.
*유형*: 부울  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule` 리소스의 `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)` 속성과 유사합니다. 이 속성이 로 설정된 경우를 `true` AWS SAM 전달하고`ENABLED`, 그렇지 않으면를 전달합니다`DISABLED`.

 `EventBusName`   <a name="sam-function-cloudwatchevent-eventbusname"></a>
이 규칙과 연결할 이벤트 버스입니다. 이 속성을 생략하면가 기본 이벤트 버스를 AWS SAM 사용합니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*기본값*: 기본 이벤트 버스  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule` 리소스의 `[EventBusName](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventbusname)` 속성으로 직접 전달됩니다.

 `Input`   <a name="sam-function-cloudwatchevent-input"></a>
대상으로 전달되는 유효한 JSON 텍스트입니다. 이 속성을 사용하면 이벤트 텍스트 자체의 어떤 것도 대상으로 전달되지 않습니다.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule Target` 리소스의 `[Input](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-input)` 속성으로 직접 전달됩니다.

 `InputPath`   <a name="sam-function-cloudwatchevent-inputpath"></a>
일치된 이벤트 전체를 전달하지 않으려는 경우 `InputPath` 속성을 사용하여 이벤트의 어떤 부분이 전달되어야 하는지 설명하세요.  
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule Target` 리소스의 `[InputPath](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-target.html#cfn-events-rule-target-inputpath)` 속성으로 직접 전달됩니다.

 `Pattern`   <a name="sam-function-cloudwatchevent-pattern"></a>
어떤 이벤트가 지정된 대상으로 라우팅되는지를 설명합니다. 자세한 내용은 *Amazon EventBridge 사용자 가이드*의 [EventBridge의 이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)을 참조하세요.  
*유형*: [이벤트패턴](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)  
*필수 항목 여부*: 예  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule` 리소스의 `[EventPattern](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern)` 속성으로 직접 전달됩니다.

 `State`   <a name="sam-function-cloudwatchevent-state"></a>
규칙의 상태입니다.  
*허용되는 값:* `DISABLED | ENABLED`  
`Enabled` 또는 `State` 속성을 지정할 수 있지만, 두 속성을 함께 지정할 수는 없습니다.
*유형*: 문자열  
*필수 항목 여부*: 아니요  
*CloudFormation 호환성*:이 속성은 `AWS::Events::Rule` 리소스의 `[State](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-state)` 속성으로 직접 전달됩니다.

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

### CloudWatchEvent
<a name="sam-property-function-cloudwatchevent--examples--cloudwatchevent"></a>

다음은 `CloudWatchEvent` 이벤트 소스 유형의 한 예제입니다.

#### YAML
<a name="sam-property-function-cloudwatchevent--examples--cloudwatchevent--yaml"></a>

```
CWEvent:
  Type: CloudWatchEvent
  Properties:
    Enabled: false
    Input: '{"Key": "Value"}'
    Pattern:
      detail:
        state:
          - running
```