본문 바로가기

퍼블릭 클라우드

[aws] cloudfront 파일 무효화

728x90

aws cloudfront 파일 무효화

create-invalidation : 무효화 만들기

aws cloudfront create-invalidation --distribution-id EDFDVBD6EXAMPLE --paths "/example-path/example-file2.png"
$ aws cloudfront create-invalidation --distribution-id EDFDVBD6EXAMPLE --paths "/asiaartistawards/css/aaa_style.css"
{
    "Invalidation": {
        "Status": "InProgress", 
        "InvalidationBatch": {
            "Paths": {
                "Items": [
                    "/example-path/example-file2.png"
                ], 
                "Quantity": 1
            }, 
            "CallerReference": "cli-1670293604-332057"
        }, 
        "Id": "IGWWPL25D6W1D", 
        "CreateTime": "2022-12-06T02:26:45.074Z"
    }, 
    "Location": "https://cloudfront.amazonaws.com/2020-05-31/distribution/EDFDVBD6EXAMPLE/invalidation/IGWWPL25D6W1D"
}

get-invalidation : 무효화에 대한 정보를 가져오기

aws cloudfront get-invalidation --id IGWWPL25D6W1D --distribution-id EDFDVBD6EXAMPLE
$ aws cloudfront get-invalidation --id IGWWPL25D6W1D --distribution-id EDFDVBD6EXAMPLE
{
    "Invalidation": {
        "Status": "Completed", 
        "InvalidationBatch": {
            "Paths": {
                "Items": [
                    "/example-path/example-file2.png"
                ], 
                "Quantity": 1
            }, 
            "CallerReference": "cli-1670293604-332057"
        }, 
        "Id": "IGWWPL25D6W1D", 
        "CreateTime": "2022-12-06T02:26:45.074Z"
    }
}

AWS Management Console 확인

 

CloudFront API 권한: 작업, 리소스 및 조건 참조

https://docs.aws.amazon.com/ko_kr/AmazonCloudFront/latest/DeveloperGuide/cf-api-permissions-ref.html

 

파일 무효화

https://docs.aws.amazon.com/ko_kr/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html

 

CloudFront에서 캐시된 파일을 제거하려면 어떻게 해야 하나요?

https://aws.amazon.com/ko/premiumsupport/knowledge-center/cloudfront-clear-cache/

CloudFront API 참조(aws cloudfront)

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudfront/index.html

 

참고URL

- Amazon CloudFront 파일 무효화 : https://scbyun.com/1057

- create-invalidation : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudfront/create-invalidation.html

- get-invalidation : https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudfront/get-invalidation.html

 

728x90