반업주부의 일상 배움사
[Golang] AWS CloudFront > 무효화 (CreateInvalidation) 본문
1. S3 업로드
2022.05.18 - [IT 인터넷/Golang] - [Golang] 파일 업로드 > S3
[Golang] 파일 업로드 > S3
1. 패키지 다운로드 $ go get github.com/aws/aws-sdk-go-v2/aws $ go get github.com/aws/aws-sdk-go-v2/config 2. 주요 코드 // 업로드된 파일 정보 imageFile, imageFileHeader, _ := c.Request.FormFile("imag..
banjubu.tistory.com
2. 무효화 주요 코드
s3FileList := []*string{}
s3FileList = append(s3FileList, aws.String("/"+imageFileHeader.Filename))
res2, _ := cloudfront.New(session).CreateInvalidation(&cloudfront.CreateInvalidationInput{
DistributionId: aws.String("CLOUDFRONT_DIST_ID"),
InvalidationBatch: &cloudfront.InvalidationBatch{
CallerReference: aws.String(fmt.Sprintf("%d", time.Now().Unix())),
Paths: &cloudfront.Paths{
Quantity: aws.Int64(int64(len(s3FileList))),
Items: s3FileList,
},
},
})
영어, 중국어 공부중이신가요?
홈스쿨 교재. 한 권으로 가족 모두 할 수 있어요!
한GLO 미네르바에듀 : 네이버쇼핑 스마트스토어
한글로 영어가 된다?! 한글로[한GLO]는 영어 중국어 일어 러시아어 스페인어가 됩니다!!
smartstore.naver.com
반응형
LIST
'IT 인터넷 > Golang' 카테고리의 다른 글
[Golang] 단숨에 GraphQL 적용하기 [gqlgen] (0) | 2022.05.19 |
---|---|
[Golang] Supervisor로 데몬 실행하기 (0) | 2022.05.18 |
[Golang] 파일 업로드 > S3 (0) | 2022.05.18 |
[Golang] Gin + MySQL (0) | 2022.05.16 |
[Golang] Hello Gin (0) | 2022.05.16 |
Comments