S3 Lifecycle 이벤트 알림 구성
S3 Lifecycle 이벤트 알림 구성
S3 Lifecycle 규칙에 따라 Amazon S3가 객체를 삭제하거나 다른 Amazon S3 스토리지 클래스로 전환할 때 알림을 받으려면 Amazon S3 이벤트 알림을 설정할 수 있어요.
다음 S3 Lifecycle 이벤트에 대한 알림을 받을 수 있어요.
- 전환 이벤트 –
s3:LifecycleTransition이벤트 유형을 사용해 S3 Lifecycle 구성에 의해 객체가 한 Amazon S3 스토리지 클래스에서 다른 클래스로 전환될 때 알림을 받을 수 있어요. - 만료(삭제) 이벤트 –
LifecycleExpiration이벤트 유형을 사용해 Amazon S3가 S3 Lifecycle 구성에 따라 객체를 삭제할 때마다 알림을 받을 수 있어요. 만료 이벤트 유형은 두 가지가 있어요.s3:LifecycleExpiration:Delete이벤트 유형은 버전 관리 없는 버킷의 객체가 삭제될 때 알려줘요.s3:LifecycleExpiration:Delete는 S3 Lifecycle 구성에 의해 객체 버전이 영구 삭제될 때도 알려줘요.s3:LifecycleExpiration:DeleteMarkerCreated이벤트 유형은 버전 관리 버킷의 객체 현재 버전이 삭제된 후 S3 Lifecycle이 삭제 마커를 만들 때 알려줘요. S3 Lifecycle은 삭제 마커의 생성 시간을 당일 00:00 UTC(자정)로 설정해요. 이 생성 시간은 S3가 보내는s3:LifecycleExpiration:DeleteMarkerCreated알림의 이벤트 시간과 다를 수 있어요. 자세한 내용은 "버전 관리 활성화 버킷에서 객체 버전 삭제"를 참고하세요.
Amazon S3는 Amazon Simple Notification Service(Amazon SNS) 주제, Amazon Simple Queue Service(Amazon SQS) 대기열 또는 AWS Lambda 함수에 이벤트 알림을 게시할 수 있어요. 자세한 내용은 "Amazon S3 이벤트 알림"을 참고하세요.
Amazon S3 Event Notifications 구성 지침은 "Amazon SQS, Amazon SNS, AWS Lambda를 사용한 이벤트 알림 활성화"를 참고하세요.
출처: 문서
본문
다음은 Amazon S3가 s3:LifecycleExpiration:Delete 이벤트를 게시하기 위해 보내는 메시지의 예시예요. 자세한 내용은 "이벤트 메시지 구조"를 참고하세요.
{
"Records":[
{
"eventVersion":"2.3",
"eventSource":"aws:s3",
"awsRegion":"us-west-2",
"eventTime":"1970-01-01T00:00:00.000Z",
"eventName":"LifecycleExpiration:Delete",
"userIdentity":{
"principalId":"s3.amazonaws.com"
},
"requestParameters":{
"sourceIPAddress":"s3.amazonaws.com"
},
"responseElements":{
"x-amz-request-id":"C3D13FE58DE4C810",
"x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD"
},
"s3":{
"s3SchemaVersion":"1.0",
"configurationId":"testConfigRule",
"bucket":{
"name":"amzn-s3-demo-bucket",
"ownerIdentity":{
"principalId":"A3NL1KOZZKExample"
},
"arn":"arn:aws:s3:::amzn-s3-demo-bucket"
},
"object":{
"key":"expiration/delete",
"sequencer":"0055AED6DCD90281E5",
}
}
}
]
}
Amazon S3가 s3:LifecycleTransition 이벤트를 게시하기 위해 보내는 메시지에는 다음 정보도 포함돼요.
"lifecycleEventData":{
"transitionEventData": {
"destinationStorageClass": the destination storage class for the object
}
}