## Amazon RDS 이벤트 알림 규칙(Feat. AWS CloudWatch, Amazon EventBridge)(Amazon RDS event notification rules)
AWS Lambda 와 함께 AWS CloudWatch, Amazon EventBridge의 RDS 상태 변경과 관련된 규칙을 사용하고 싶을 때 아래와 같이 설정하면 됩니다.
[해당 페이지](https://docs.aws.amazon.com/ko_kr/AmazonRDS/latest/UserGuide/USER_Events.html)에서 더 자세히 확인하실 수 있습니다.
#### RDS Cluster가 중지됐을 때
```
{
  "source": [
    "aws.rds"
  ],
  "detail-type": [
    "RDS DB Cluster Event"
  ],
  "detail": {
    "EventID": [
      "RDS-EVENT-0150"
    ],
    "EventCategories": [
      "notification"
    ],
    "SourceType": [
      "CLUSTER"
    ],
    "SourceArn": [
      "arn:aws:rds:ap-northeast-2:xxxxxxxxxxx" # 해당 RDS cluster 의 arn
    ],
    "SourceIdentifier": [
      "xxxxxxxx" # 해당 RDS cluster 의 DB 식별자
    ]
  }
}
```
#### RDS Cluster가 시작됐을 때
```
{
  "source": [
    "aws.rds"
  ],
  "detail-type": [
    "RDS DB Cluster Event"
  ],
  "detail": {
    "EventID": [
      "RDS-EVENT-0151"
    ],
    "EventCategories": [
      "notification"
    ],
    "SourceType": [
      "CLUSTER"
    ],
    "SourceArn": [
      "arn:aws:rds:ap-northeast-2:xxxxxxxxxxx" # 해당 RDS cluster 의 arn
    ],
    "SourceIdentifier": [
      "xxxxxxxx" # 해당 RDS cluster 의 DB 식별자
    ]
  }
}
```
#### RDS Instance가 중지됐을 때
```
{
  "source": [
    "aws.rds"
  ],
  "detail-type": [
    "RDS DB Instance Event"
  ],
  "detail": {
    "EventID": [
      "RDS-EVENT-0087"
    ],
    "EventCategories": [
      "notification"
    ],
    "SourceType": [
      "DB_INSTANCE"
    ],
    "SourceArn": [
      "arn:aws:rds:ap-northeast-2:xxxxxxxxxxx" # 해당 RDS instance 의 arn
    ],
    "SourceIdentifier": [
      "xxxxxxxx" # 해당 RDS instance 의 DB 식별자
    ]
  }
}
```
#### RDS Instance가 시작됐을 때
```
{
  "source": [
    "aws.rds"
  ],
  "detail-type": [
    "RDS DB Instance Event"
  ],
  "detail": {
    "EventID": [
      "RDS-EVENT-0088"
    ],
    "EventCategories": [
      "notification"
    ],
    "SourceType": [
      "DB_INSTANCE"
    ],
    "SourceArn": [
      "arn:aws:rds:ap-northeast-2:xxxxxxxxxxx" # 해당 RDS instance 의 arn
    ],
    "SourceIdentifier": [
      "xxxxxxxx" # 해당 RDS instance 의 DB 식별자
    ]
  }
}
```
##### 참고
https://docs.aws.amazon.com/ko_kr/AmazonRDS/latest/UserGuide/USER_Events.html
 
댓글
댓글 쓰기