Amazon S3์—์„œ Cloud Storage๋กœ ์ด์ „

์ด ํŽ˜์ด์ง€์—์„œ๋Š” Amazon S3์—์„œ Cloud Storage๋กœ์˜ ์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ค๊ณ  ์‹œ์ž‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

๊ถŒํ•œ ๊ตฌ์„ฑ

์ „์†ก์„ ๋งŒ๋“ค๊ธฐ ์ „์— Amazon S3 ๋ฒ„ํ‚ท์— ๋Œ€ํ•œ ๊ถŒํ•œ์„ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์†Œ์Šค์— ๋Œ€ํ•œ ์•ก์„ธ์Šค ๊ถŒํ•œ ๊ตฌ์„ฑ: Amazon S3๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

๋‹ค์ŒGoogle Cloud ํ•ญ๋ชฉ์— ๋Œ€ํ•œ ๊ถŒํ•œ๋„ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ „์†ก์„ ๋งŒ๋“œ๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์‚ฌ์šฉ์ž ๊ณ„์ •. ์ด ๊ณ„์ •์€ Google Cloud ์ฝ˜์†”์— ๋กœ๊ทธ์ธ๋œ ๊ณ„์ •์ด๊ฑฐ๋‚˜ `gcloud` CLI์— ์ธ์ฆํ•  ๋•Œ ์ง€์ •๋œ ๊ณ„์ •์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž ๊ณ„์ •์€ ์ผ๋ฐ˜ ์‚ฌ์šฉ์ž ๊ณ„์ •์ด๋‚˜ ์‚ฌ์šฉ์ž ๊ด€๋ฆฌํ˜• ์„œ๋น„์Šค ๊ณ„์ •์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Google ๊ด€๋ฆฌ ์„œ๋น„์Šค ๊ณ„์ •์€ ์„œ๋น„์Šค ์—์ด์ „ํŠธ๋ผ๊ณ ๋„ ํ•˜๋ฉฐ Storage Transfer Service์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ณ„์ •์€ ์ผ๋ฐ˜์ ์œผ๋กœ project-PROJECT_NUMBER@storage-transfer-service.iam.gserviceaccount.com ํ˜•์‹์„ ์‚ฌ์šฉํ•˜๋Š” ์ด๋ฉ”์ผ ์ฃผ์†Œ๋กœ ์‹๋ณ„๋ฉ๋‹ˆ๋‹ค.

์ž์„ธํ•œ ๋‚ด์šฉ์€ ์—์ด์ „ํŠธ๋ฆฌ์Šค ์ „์†ก ๊ถŒํ•œ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

์ด๊ทธ๋ ˆ์Šค ์˜ต์…˜

Storage Transfer Service๋Š” S3 ๋ฐ์ดํ„ฐ๋ฅผ Cloud Storage๋กœ ์ „์†กํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์˜ต์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

์ด๊ทธ๋ ˆ์Šค ์˜ต์…˜ ์„ค๋ช…
๊ธฐ๋ณธ ์—์ด์ „ํŠธ๋ฆฌ์Šค ์ด ์˜ต์…˜์—์„œ๋Š” S3์˜ ๊ด€๋ฆฌํ˜• ์—์ด์ „ํŠธ๋ฆฌ์Šค ์ „์†ก์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Amazon์—์„œ ์ด๊ทธ๋ ˆ์Šค ์š”๊ธˆ์„ ์ฒญ๊ตฌํ•ฉ๋‹ˆ๋‹ค.

์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด ํŽ˜์ด์ง€์˜ ์•ˆ๋‚ด๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.
CloudFront ๋ฐฐํฌ Amazon CloudFront ๋ฐฐํฌ๋ฅผ ์ด๊ทธ๋ ˆ์Šค ๊ฒฝ๋กœ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. CloudFront๋ฅผ ํ†ตํ•œ ๋ฐ์ดํ„ฐ ์ „์†ก์˜ AWS ์ด๊ทธ๋ ˆ์Šค ๋น„์šฉ์ด S3์—์„œ ์ง์ ‘ ์ „์†ก์— ๋น„ํ•ด ์ €๋ ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ CloudFront ๊ฐ€๊ฒฉ ์ฑ…์ • ๋ฐ S3 ์ด๊ทธ๋ ˆ์Šค ์š”๊ธˆ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

CloudFront๋ฅผ ํ†ตํ•ด S3์—์„œ ์ „์†ก์˜ ์•ˆ๋‚ด๋ฅผ ์ˆ˜ํ–‰ํ•˜์—ฌ ๋ฐฐํฌ๋ฅผ ์„ค์ •ํ•˜๊ณ  ์ „์†ก์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ Google ๊ด€๋ฆฌ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค. S3 ์ด๊ทธ๋ ˆ์Šค ์š”๊ธˆ์€ ์ฒญ๊ตฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋Œ€์‹ Google Cloud์— GiB๋‹น ์š”๊ธˆ์ด ์ฒญ๊ตฌ๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๊ฐ€๊ฒฉ ์ฑ…์ • ํŽ˜์ด์ง€๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”. AWS์—์„œ ์ž‘์—… ๋น„์šฉ์ด ๊ณ„์† ์ฒญ๊ตฌ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(์˜ˆ: LIST ๋˜๋Š” GET ํ˜ธ์ถœ). ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๊ฐ€๊ฒฉ ์ฑ…์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•œ ๋ชจ๋“  ํ”„๋กœ์ ํŠธ์˜ ์ „์†ก์—์„œ ๊ฐ™์€ ๋Œ€์—ญํญ์„ ๊ณต์œ ํ•ฉ๋‹ˆ๋‹ค. ์‚ฌ์šฉ๋Ÿ‰์ด ๋†’์œผ๋ฉด ์ „์†ก ์†๋„๊ฐ€ ๋А๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŒŒ์ผ์ด ๋งŽ์ด ํฌํ•จ๋œ ์ „์†ก์ด ํŒŒ์ผ์ด ์ ๊ฒŒ ํฌํ•จ๋œ ์ „์†ก๋ณด๋‹ค ๋” ๋งŽ์€ ์˜ํ–ฅ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค.

์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด ํŽ˜์ด์ง€์˜ ์•ˆ๋‚ด๋ฅผ ๋”ฐ๋ฅด์„ธ์š”. Google Cloud ์ฝ˜์†”์—์„œ ๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ ์˜ต์…˜ ๋˜๋Š” REST API์˜ managedPrivateNetwork ํ•„๋“œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. gcloud CLI ๋ฐ ํด๋ผ์ด์–ธํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ๋Š” ๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ ์ „์†ก์„ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ง€์›๋˜๋Š” ๋ฆฌ์ „์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.
์—์ด์ „ํŠธ ๊ธฐ๋ฐ˜ Amazon S3๋ฅผ ํฌํ•จํ•œ ๋ชจ๋“  S3 ํ˜ธํ™˜ ์Šคํ† ๋ฆฌ์ง€์— ์œ ํšจํ•ฉ๋‹ˆ๋‹ค. S3 ๋ฒ„ํ‚ท์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ๋จธ์‹ ์— ์—์ด์ „ํŠธ ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ์„ค์น˜ํ•˜๋ฉด ๋„คํŠธ์›Œํฌ ๊ฒฝ๋กœ์™€ ๋Œ€์—ญํญ์„ ์ œ์–ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์—์ด์ „ํŠธ์™€ ์—์ด์ „ํŠธ ํ’€์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด S3 ํ˜ธํ™˜ ์†Œ์Šค์—์„œ ์ „์†ก์˜ ์•ˆ๋‚ด๋ฅผ ๋”ฐ๋ฅด์„ธ์š”.

์ง€์›๋˜๋Š” ๋ฆฌ์ „

Storage Transfer Service๋Š” ๋‹ค์Œ Amazon S3 ๋ฆฌ์ „์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
af-south-1
ap-east-1
ap-northeast-1
ap-northeast-2
ap-northeast-3
ap-south-1
ap-south-2
ap-southeast-1
ap-southeast-2
ap-southeast-3
ap-southeast-4
ca-central-1
ca-west-1
eu-central-1
eu-central-2
eu-north-1
eu-south-1
eu-south-2
eu-west-1
eu-west-2
eu-west-3
il-central-1
me-central-1
me-south-1
sa-east-1
us-east-1
us-east-2
us-west-1
us-west-2
๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ „์†ก์—์„œ ๋‹ค์Œ AWS ๋ฆฌ์ „์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
ap-east-1
ap-northeast-1
ap-northeast-2
ap-northeast-3
ap-south-1
ap-south-2
ap-southeast-1
ca-central-1
ca-west-1
eu-central-1
eu-central-2
eu-north-1
eu-south-1
eu-south-2
eu-west-1
eu-west-2
eu-west-3
us-east-1
us-east-2
us-west-1
us-west-2
 

์ „์†ก ์˜ต์…˜

S3์—์„œ Cloud Storage๋กœ ์ „์†กํ•  ๋•Œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ Storage Transfer Service ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋งค๋‹ˆํŽ˜์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํŠน์ • ํŒŒ์ผ ์ „์†ก
์ž‘์—…ํ•  Storage Transfer Service ํŒŒ์ผ์˜ ๋ชฉ๋ก์„ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋งค๋‹ˆํŽ˜์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํŠน์ • ํŒŒ์ผ ๋˜๋Š” ๊ฐ์ฒด ์ „์†ก์„ ์ฐธ์กฐํ•˜์„ธ์š”.
ํ”„๋ฆฌํ”ฝ์Šค ๋˜๋Š” ์ตœ์ข… ์ˆ˜์ • ์‹œ๊ฐ„์„ ๊ธฐ์ค€์œผ๋กœ ์†Œ์Šค ๊ฐ์ฒด ํ•„ํ„ฐ๋ง

ํŒŒ์ผ ์ด๋ฆ„๊ณผ ๊ฒฝ๋กœ ๋˜๋Š” ์ตœ์ข… ์ˆ˜์ • ์‹œ๊ฐ„์„ ๊ธฐ์ค€์œผ๋กœ ์ „์†ก์—์„œ ๊ฐ์ฒด๋ฅผ ํฌํ•จํ•˜๊ฑฐ๋‚˜ ์ œ์™ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ ‘๋‘์‚ฌ ํ•„ํ„ฐ๋Š” ์ ‘๋‘์‚ฌ ํ•„ํ„ฐ์— ์„ค๋ช…๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์‹œ๊ฐ„ ๊ธฐ๋ฐ˜ ํ•„ํ„ฐ์—๋Š” ๋‹ค์Œ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

  • ๋งˆ์ง€๋ง‰ ์ˆ˜์ • ์ดํ›„ ๊ฒฝ๊ณผ๋œ ์ตœ์†Œ ์‹œ๊ฐ„ ๋ฐ ์ตœ๋Œ€ ์‹œ๊ฐ„์ž…๋‹ˆ๋‹ค. ๋‘ ์˜ต์…˜ ๋ชจ๋‘ ํŠน์ • ๊ธฐ๊ฐ„ ๋‚ด์— ์ˆ˜์ •๋˜์—ˆ๊ฑฐ๋‚˜ ์ˆ˜์ •๋˜์ง€ ์•Š์€ ๊ฐ์ฒด๋ฅผ ํ•„ํ„ฐ๋งํ•˜๊ธฐ ์œ„ํ•ด ์ดˆ ๋‹จ์œ„ ๊ฐ’์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • '๋‹ค์Œ ๋‚ ์งœ ์ดํ›„์— ์ตœ์ข… ์ˆ˜์ •' ๋ฐ '๋‹ค์Œ ๋‚ ์งœ ์ด์ „์— ์ตœ์ข… ์ˆ˜์ •'์€ ๋ชจ๋‘ dateTime ๊ฐ’์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.

S3 ์ „์†ก์˜ ์‹œ๊ฐ„ ๊ธฐ๋ฐ˜ ํ•„ํ„ฐ๋Š” ๊ฐ์ฒด๊ฐ€ ์—…๋กœ๋“œ๋ฅผ ์‹œ์ž‘ํ•œ ์‹œ๊ฐ„์ธ AWS์˜ '๋งˆ์ง€๋ง‰ ์ˆ˜์ • ์‹œ๊ฐ„' ์ •์˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์—…๋กœ๋“œ๊ฐ€ ์™„๋ฃŒ๋  ๋•Œ๊นŒ์ง€๋Š” ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†์œผ๋ฏ€๋กœ ์ตœ์ข… ์ˆ˜์ • ์‹œ๊ฐ„์ด ํ•„ํ„ฐ ๊ธฐ์ค€์„ ์ถฉ์กฑํ•˜์ง€๋งŒ ์•„์ง ์—…๋กœ๋“œ ์ค‘์ธ ๊ฐ์ฒด๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ฐ์ฒด๋Š” ์ „์†ก ์ž‘์—…์— ํฌํ•จ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋ฌธ์ œ๋ฅผ ๋ฐฉ์ง€ํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

  • ์‹œ๊ฐ„ ๊ธฐ๋ฐ˜ ํ•„ํ„ฐ ๋Œ€์‹  [์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก](/storage-transfer/docs/event-driven-aws)์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ์ฒด๊ฐ€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•ด์ง€๋ฉด ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
  • ๋ฐ˜๋ณต ์ „์†ก์—์„œ ๊ฐ์ฒด๊ฐ€ ๋ˆ„๋ฝ๋˜์ง€ ์•Š๋„๋ก ํ•˜๋ ค๋ฉด '๋งˆ์ง€๋ง‰ ์ˆ˜์ • ์‹œ๊ฐ„' ๋˜๋Œ์•„๋ณด๊ธฐ ๊ธฐ๊ฐ„์ด ๋ฐ˜๋ณต ์ผ์ •๋ณด๋‹ค ์ปค์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋งค์‹œ๊ฐ„ ์‹คํ–‰๋˜๋Š” ์ž‘์—…์˜ ๊ฒฝ์šฐ 2์‹œ๊ฐ„์˜ ๋ฃฉ๋ฐฑ ๊ธฐ๊ฐ„์ด ๋ฒ„ํผ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
์Šคํ† ๋ฆฌ์ง€ ํด๋ž˜์Šค ์ง€์ •
๋Œ€์ƒ ๋ฒ„ํ‚ท์˜ ๋ฐ์ดํ„ฐ์— ์‚ฌ์šฉํ•  Cloud Storage ์Šคํ† ๋ฆฌ์ง€ ํด๋ž˜์Šค๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. REST ์„ธ๋ถ€์ •๋ณด๋Š” StorageClass ์˜ต์…˜์„ ์ฐธ์กฐํ•˜๊ฑฐ๋‚˜ Google Cloud CLI์—์„œ --custom-storage-class ํ”Œ๋ž˜๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.

๋Œ€์ƒ ๋ฒ„ํ‚ท์— ์ž๋™ ํด๋ž˜์Šค๊ฐ€ ์‚ฌ์šฉ ์„ค์ •๋˜๋ฉด ์Šคํ† ๋ฆฌ์ง€ ํด๋ž˜์Šค ์„ค์ •์ด ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค. ์ž๋™ ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉ ์„ค์ •ํ•˜๋ฉด ์ฒ˜์Œ์—๋Š” ๋ฒ„ํ‚ท์œผ๋กœ ์ „์†ก๋œ ๊ฐ์ฒด๊ฐ€ Standard Storage๋กœ ์„ค์ •๋ฉ๋‹ˆ๋‹ค.

๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ณด์กด

S3์—์„œ ํŒŒ์ผ์„ ์ „์†กํ•  ๋•Œ Storage Transfer Service๋Š” ์„ ํƒ์ ์œผ๋กœ ํŠน์ • ์†์„ฑ์„ ์ปค์Šคํ…€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋กœ ๋ณด์กดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ณด์กดํ•  ์ˆ˜ ์žˆ๋Š” ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์™€ ์ „์†ก์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ณด์กด์˜ Amazon S3์—์„œ Cloud Storage๋กœ ์ „์†ก ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก
Storage Transfer Service๋Š” Amazon SQS๋กœ ์ „์†ก๋œ Amazon S3 ์ด๋ฒคํŠธ ์•Œ๋ฆผ์„ ๋ฆฌ์Šจํ•˜์—ฌ ์†Œ์Šค ์œ„์น˜์— ์ถ”๊ฐ€๋˜๊ฑฐ๋‚˜ ์—…๋ฐ์ดํŠธ๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ž๋™์œผ๋กœ ์ „์†กํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก์„ ์ฐธ์กฐํ•˜์„ธ์š”.
๋กœ๊น… ๋ฐ ๋ชจ๋‹ˆํ„ฐ๋ง
Cloud Logging ๋ฐ Cloud Monitoring์—์„œ S3์—์„œ์˜ ์ „์†ก์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Storage Transfer Service์šฉ Cloud Logging ๋ฐ ์ „์†ก ์ž‘์—… ๋ชจ๋‹ˆํ„ฐ๋ง์„ ์ฐธ์กฐํ•˜์„ธ์š”. ๋˜ํ•œ Pub/Sub ์•Œ๋ฆผ์„ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ „์†ก ๋งŒ๋“ค๊ธฐ

Storage Transfer Service๋Š” ์ „์†ก์„ ๋งŒ๋“œ๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์—ฌ๋Ÿฌ ๊ฐœ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

์ „์†ก ์ž‘์—… ์ด๋ฆ„์— ๊ฐœ์ธ ์‹๋ณ„ ์ •๋ณด(PII) ๋˜๋Š” ๋ณด์•ˆ ๋ฐ์ดํ„ฐ์™€ ๊ฐ™์€ ๋ฏผ๊ฐํ•œ ์ •๋ณด๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”. ๋ฆฌ์†Œ์Šค ์ด๋ฆ„์€ ๋‹ค๋ฅธ Google Cloud ๋ฆฌ์†Œ์Šค ์ด๋ฆ„์œผ๋กœ ์ „ํŒŒ๋  ์ˆ˜ ์žˆ์œผ๋ฉฐ ํ”„๋กœ์ ํŠธ ์™ธ๋ถ€์˜ Google ๋‚ด๋ถ€ ์‹œ์Šคํ…œ์— ๋…ธ์ถœ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Google Cloud ์ฝ˜์†”

  1. Google Cloud ์ฝ˜์†”์—์„œ Storage Transfer Service ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    Storage Transfer Service๋กœ ์ด๋™

  2. ์ „์†ก ์ž‘์—… ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค. ์ „์†ก ์ž‘์—… ๋งŒ๋“ค๊ธฐ ํŽ˜์ด์ง€๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

  3. ์†Œ์Šค ์œ ํ˜•์—์„œ Amazon S3๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  4. ๋Œ€์ƒ ์œ ํ˜•์œผ๋กœ Google Cloud Storage๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

  5. ์˜ˆ์•ฝ ๋ชจ๋“œ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ผ๊ด„ ์ „์†ก์€ ์ผํšŒ์„ฑ ๋˜๋Š” ์˜ˆ์•ฝ ๊ธฐ๋ฐ˜์œผ๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก์€ ์†Œ์Šค๋ฅผ ์ง€์†์ ์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ๋ฐ์ดํ„ฐ๊ฐ€ ์ถ”๊ฐ€๋˜๊ฑฐ๋‚˜ ์ˆ˜์ •๋˜๋ฉด ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.

    ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก์„ ๊ตฌ์„ฑํ•˜๋ ค๋ฉด ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก์˜ ์•ˆ๋‚ด๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  6. ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  7. ๋ฒ„ํ‚ท ๋˜๋Š” ํด๋” ์ด๋ฆ„ ํ•„๋“œ์— ์†Œ์Šค ๋ฒ„ํ‚ท ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

    ๋ฒ„ํ‚ท ์ด๋ฆ„์€ AWS ๊ด€๋ฆฌ ์ฝ˜์†”์— ๋‚˜ํƒ€๋‚˜๋Š” ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

  8. CloudFront ๋ฐฐํฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ S3์—์„œ ์ „์†กํ•˜๋Š” ๊ฒฝ์šฐ CloudFront ๋„๋ฉ”์ธ ํ•„๋“œ์— ๋ฐฐํฌ ๋„๋ฉ”์ธ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค๋ฉด https://dy1h2n3l4ob56.cloudfront.net์ž…๋‹ˆ๋‹ค. CloudFront ๋ฐฐํฌ๋ฅผ ๊ตฌ์„ฑํ•˜๋ ค๋ฉด CloudFront๋ฅผ ํ†ตํ•ด S3์—์„œ ์ „์†ก์„ ์ฐธ์กฐํ•˜์„ธ์š”.

  9. ์ด ์ „์†ก์— ๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ฒดํฌ๋ฐ•์Šค๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ด๊ทธ๋ ˆ์Šค ์˜ต์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

  10. Amazon Web Services(AWS) ์ธ์ฆ ๋ฐฉ๋ฒ•์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์†Œ์Šค์— ๋Œ€ํ•œ ์•ก์„ธ์Šค ๊ถŒํ•œ ๊ตฌ์„ฑ: Amazon S3๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

    • ์•ก์„ธ์Šค ํ‚ค: ์•ก์„ธ์Šค ํ‚ค ID ํ•„๋“œ์— ์•ก์„ธ์Šค ํ‚ค๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ๋ณด์•ˆ ๋น„๋ฐ€ ์•ก์„ธ์Šค ํ‚ค ํ•„๋“œ์— ์•ก์„ธ์Šค ํ‚ค์™€ ์—ฐ๊ด€๋œ ๋ณด์•ˆ ๋น„๋ฐ€์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

    • ID ์ œํœด๋ฅผ ์œ„ํ•œ AWS IAM ์—ญํ• : AWS IAM ์—ญํ•  ARN ํ•„๋“œ์— ๋‹ค์Œ ๊ตฌ๋ฌธ์œผ๋กœ ARN์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

      arn:aws:iam::ACCOUNT:role/ROLE-NAME-WITH-PATH
      

      ๊ฐ ํ•ญ๋ชฉ์˜ ์˜๋ฏธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      • ACCOUNT: ํ•˜์ดํ”ˆ์ด ์—†๋Š” AWS ๊ณ„์ • ID์ž…๋‹ˆ๋‹ค.
      • ROLE-NAME-WITH-PATH: ๊ฒฝ๋กœ๊ฐ€ ํฌํ•จ๋œ AWS ์—ญํ•  ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

      ARN์— ๊ด€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ IAM ARN์„ ์ฐธ์กฐํ•˜์„ธ์š”.

    • ๋ณด์•ˆ ๋น„๋ฐ€ ๋ฆฌ์†Œ์Šค: Secret Manager์— ์ €์žฅ๋œ Amazon ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ์ด ์˜ต์…˜์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ๋ชฉ๋ก์—์„œ ๋ณด์•ˆ ๋น„๋ฐ€์„ ์„ ํƒํ•˜๊ฑฐ๋‚˜ projects/PROJECT_NUMBER/secrets/SECRET_NAME ํ˜•์‹์œผ๋กœ ์ง์ ‘ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

  11. ์ด๋ฒคํŠธ ๊ธฐ๋ฐ˜ ์ „์†ก์ธ ๊ฒฝ์šฐ ๋‹ค์Œ ํ˜•์‹์„ ์‚ฌ์šฉํ•˜๋Š” Amazon SQS ํ ARN์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

    arn:aws:sqs:us-east-1:1234567890:event-queue
    
  12. ์›ํ•˜๋Š” ๊ฒฝ์šฐ ํ”„๋ฆฌํ”ฝ์Šค๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ฐ์ฒด๋ฅผ ํ•„ํ„ฐ๋งํ•˜๊ฑฐ๋‚˜ ์ตœ์ข… ์ˆ˜์ • ๋‚ ์งœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๊ฐ์ฒด๋ฅผ ํ•„ํ„ฐ๋งํ•˜๋„๋ก ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ํด๋”๋ฅผ ์†Œ์Šค ์œ„์น˜๋กœ ์ง€์ •ํ•œ ๊ฒฝ์šฐ ํ”„๋ฆฌํ”ฝ์Šค ํ•„ํ„ฐ๋Š” ํ•ด๋‹น ํด๋”๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์†Œ์Šค๊ฐ€ my-test-bucket/path/์ธ ๊ฒฝ์šฐ file์˜ ํฌํ•จ ํ•„ํ„ฐ๋Š” my-test-bucket/path/file๋กœ ์‹œ์ž‘ํ•˜๋Š” ๋ชจ๋“  ํŒŒ์ผ์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค.
  13. ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  14. ๋ฒ„ํ‚ท ๋˜๋Š” ํด๋” ํ•„๋“œ์— ๋Œ€์ƒ ๋ฒ„ํ‚ท๊ณผ ํด๋” ์ด๋ฆ„(์„ ํƒ์‚ฌํ•ญ)์„ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ์ฐพ์•„๋ณด๊ธฐ๋ฅผ ํด๋ฆญํ•˜์—ฌ ํ˜„์žฌ ํ”„๋กœ์ ํŠธ์˜ ๊ธฐ์กด ๋ชฉ๋ก์—์„œ ๋ฒ„ํ‚ท์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ƒˆ ๋ฒ„ํ‚ท์„ ๋งŒ๋“ค๋ ค๋ฉด ์ƒˆ ๋ฒ„ํ‚ท ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  15. ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  16. ์ „์†ก ์ž‘์—…์˜ ์„ค์ •์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    1. ์„ค๋ช… ํ•„๋“œ์— ์ „์†ก ์„ค๋ช…์„ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ž‘์—…์„ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋„๋ก ์˜๋ฏธ ์žˆ๊ณ  ๊ณ ์œ ํ•œ ์„ค๋ช…์„ ์ž…๋ ฅํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

    2. ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์˜ต์…˜์—์„œ ๊ธฐ๋ณธ ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋„๋ก ์„ ํƒํ•˜๊ฑฐ๋‚˜ ์˜ต์…˜ ๋ณด๊ธฐ ๋ฐ ์„ ํƒ์„ ํด๋ฆญํ•˜์—ฌ ์ง€์›๋˜๋Š” ๋ชจ๋“  ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์˜ ๊ฐ’์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ณด์กด์„ ์ฐธ์กฐํ•˜์„ธ์š”.

    3. ๋ฎ์–ด์“ธ ์‹œ์ ์—์„œ ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

      • ๋‹ค๋ฅธ ๊ฒฝ์šฐ: ์ด๋ฆ„์ด ๊ฐ™์€ ์†Œ์Šค ํŒŒ์ผ์— ๋‹ค๋ฅธ Etag ๋˜๋Š” ์ฒดํฌ์„ฌ ๊ฐ’์ด ์žˆ๋Š” ๊ฒฝ์šฐ ๋Œ€์ƒ ํŒŒ์ผ์„ ๋ฎ์–ด์”๋‹ˆ๋‹ค.

      • ํ•ญ์ƒ: ์†Œ์Šค ํŒŒ์ผ ์ด๋ฆ„์ด ๊ฐ™์œผ๋ฉด ๋™์ผํ•˜๋”๋ผ๋„ ํ•ญ์ƒ ๋Œ€์ƒ ํŒŒ์ผ์„ ๋ฎ์–ด์”๋‹ˆ๋‹ค.

    4. ์‚ญ์ œ ์‹œ์ ์—์„œ ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

      • ์‚ญ์ œ ์•ˆํ•จ: ์†Œ์Šค ๋˜๋Š” ๋Œ€์ƒ ์œ„์น˜์—์„œ ํŒŒ์ผ์„ ์‚ญ์ œํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

      • ์ „์†ก ํ›„ ์†Œ์Šค์—์„œ ํŒŒ์ผ ์‚ญ์ œ: ํŒŒ์ผ์ด ๋Œ€์ƒ์œผ๋กœ ์ „์†ก๋œ ํ›„ ์†Œ์Šค์—์„œ ํŒŒ์ผ์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋Œ€์ƒ์— ์ด๋ฏธ ์กด์žฌํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์†Œ์Šค ํŒŒ์ผ์ด ์ „์†ก๋˜์ง€ ์•Š์œผ๋ฉด ์†Œ์Šค ํŒŒ์ผ์ด ์‚ญ์ œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

      • ์†Œ์Šค์—๋„ ์—†๋Š” ๊ฒฝ์šฐ ๋Œ€์ƒ ์œ„์น˜์—์„œ ํŒŒ์ผ ์‚ญ์ œ: ๋Œ€์ƒ Cloud Storage ๋ฒ„ํ‚ท์˜ ํŒŒ์ผ์ด ์†Œ์Šค์—๋„ ์—†๋Š” ๊ฒฝ์šฐ Cloud Storage ๋ฒ„ํ‚ท์—์„œ ํŒŒ์ผ์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

        ์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๋Œ€์ƒ Cloud Storage ๋ฒ„ํ‚ท์ด ์†Œ์Šค์™€ ์ •ํ™•ํ•˜๊ฒŒ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.

    5. ์•Œ๋ฆผ ์˜ต์…˜์—์„œ Pub/Sub ์ฃผ์ œ ๋ฐ ์•Œ๋ฆผ์„ ๋ฐ›์„ ์ด๋ฒคํŠธ๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Pub/Sub ์•Œ๋ฆผ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

  17. ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

  18. ์˜ˆ์•ฝ ์˜ต์…˜์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

    1. ํ•œ ๋ฒˆ ์‹คํ–‰ ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์—์„œ ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

      • ํ•œ ๋ฒˆ ์‹คํ–‰: ์„ ํƒํ•œ ์‹œ๊ฐ„์— ๋‹จ์ผ ์ „์†ก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

      • ๋งค์ผ ์‹คํ–‰: ์„ ํƒํ•œ ์‹œ์ ๋ถ€ํ„ฐ ๋งค์ผ ์ „์†ก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

        ์„ ํƒ์‚ฌํ•ญ์ธ ์ข…๋ฃŒ์ผ์„ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ์ข…๋ฃŒ์ผ์„ ๋น„์›Œ ๋‘์–ด ์ „์†ก์„ ๊ณ„์† ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

      • ๋งค์ฃผ ์‹คํ–‰: ์„ ํƒํ•œ ์‹œ๊ฐ„๋ถ€ํ„ฐ ๋งค์ฃผ ์ „์†ก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

      • ์ปค์Šคํ…€ ๋นˆ๋„๋กœ ์‹คํ–‰: ์„ ํƒํ•œ ๋นˆ๋„๋กœ ์ „์†ก์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์‹œ๊ฐ„, ์ผ ๋˜๋Š” ์ฃผ๋ผ๋Š” ์ •๊ธฐ์ ์ธ ๊ฐ„๊ฒฉ์œผ๋กœ ์ „์†ก์„ ๋ฐ˜๋ณตํ•˜๋„๋ก ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

        ์„ ํƒ์‚ฌํ•ญ์ธ ์ข…๋ฃŒ์ผ์„ ์ž…๋ ฅํ•˜๊ฑฐ๋‚˜ ์ข…๋ฃŒ์ผ์„ ๋น„์›Œ ๋‘์–ด ์ „์†ก์„ ๊ณ„์† ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

    2. ์ง€๊ธˆ ์‹œ์ž‘ ๋“œ๋กญ๋‹ค์šด ๋ชฉ๋ก์—์„œ ๋‹ค์Œ ์ค‘ ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

      • ์ง€๊ธˆ ์‹œ์ž‘: ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•œ ํ›„ ์ „์†ก์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

      • ์‹œ์ž‘์ผ: ์„ ํƒํ•œ ๋‚ ์งœ ๋ฐ ์‹œ๊ฐ„์— ์ „์†ก์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์บ˜๋ฆฐ๋”๋ฅผ ํด๋ฆญํ•˜์—ฌ ์‹œ์ž‘์ผ์„ ์„ ํƒํ•  ์บ˜๋ฆฐ๋”๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

    3. ์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ค๋ ค๋ฉด ๋งŒ๋“ค๊ธฐ๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.

gcloud CLI

์ƒˆ ์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ค๋ ค๋ฉด gcloud transfer jobs create ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ผ์ • ๋˜๋Š” --do-not-run์ด ์ง€์ •๋˜์ง€ ์•Š์€ ํ•œ, ์ƒˆ ์ž‘์—…์„ ๋งŒ๋“ค๋ฉด ์ง€์ •๋œ ์ „์†ก์ด ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค.

gcloud CLI๋Š” CloudFront ๋˜๋Š” ๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•œ ์ „์†ก์„ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

gcloud transfer jobs create \
  s3://S3_BUCKET_NAME gs://STORAGE_BUCKET_NAME \
  --source-creds-file="relative_path/to/creds.json"

๊ฐ ํ•ญ๋ชฉ์˜ ์˜๋ฏธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • S3_BUCKET_NAME๋Š” ์ด ์ „์†ก์˜ ๋ฐ์ดํ„ฐ ์†Œ์Šค์ž…๋‹ˆ๋‹ค. ์›ํ•˜๋Š” ๊ฒฝ์šฐ s3://S3_BUCKET_NAME/S3_FOLDER_PATH ๊ฒฝ๋กœ๋ฅผ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • STORAGE_BUCKET_NAME์€ ์ „์†กํ•  Cloud Storage ๋ฒ„ํ‚ท์ž…๋‹ˆ๋‹ค. ํŠน์ • ๋””๋ ‰ํ„ฐ๋ฆฌ๋กœ ์ „์†กํ•˜๋ ค๋ฉด ํ›„ํ–‰ ์Šฌ๋ž˜์‹œ๋ฅผ ํฌํ•จํ•˜์—ฌ gs://STORAGE_BUCKET_NAME/STORAGE_FOLDER_PATH/๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  • --source-creds-file์€ ๋จธ์‹ ์—์„œ ์ „์†ก ์†Œ์Šค์˜ AWS ์‚ฌ์šฉ์ž ์ธ์ฆ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ ๋กœ์ปฌ ํŒŒ์ผ์— ๋Œ€ํ•œ ์ƒ๋Œ€ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ฝ˜ํ…์ธ ๋Š” ๋‹ค์Œ JSON ํ˜•์‹์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

    {
      "accessKeyId": string,
      "secretAccessKey": string
    }

์ถ”๊ฐ€๋กœ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” ์˜ต์…˜์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • --do-not-run์€ ๋ช…๋ น์–ด๋ฅผ ์ œ์ถœํ•  ๋•Œ Storage Transfer Service๊ฐ€ ์ž‘์—…์„ ์‹คํ–‰ํ•˜์ง€ ๋ชปํ•˜๋„๋ก ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค. ์ž‘์—…์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด ์ด๋ฅผ ์—…๋ฐ์ดํŠธํ•ด์„œ ์ผ์ •์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ jobs run์„ ์‚ฌ์šฉํ•ด์„œ ์ˆ˜๋™์œผ๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

  • --manifest-file์€ ์†Œ์Šค์—์„œ ์ „์†กํ•  ํŒŒ์ผ ๋ชฉ๋ก์ด ํฌํ•จ๋œ Cloud Storage์˜ CSV ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ๋งค๋‹ˆํŽ˜์ŠคํŠธ ํŒŒ์ผ ํ˜•์‹ ์ง€์ •์€ ๋งค๋‹ˆํŽ˜์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํŠน์ • ํŒŒ์ผ ๋˜๋Š” ๊ฐ์ฒด ์ „์†ก์„ ์ฐธ์กฐํ•˜์„ธ์š”.

  • ์ž‘์—… ์ •๋ณด: --name ๋ฐ --description์„ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์ผ์ •: --schedule-starts, --schedule-repeats-every, --schedule-repeats-until, --do-not-run์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

  • ๊ฐ์ฒด ์กฐ๊ฑด: ์กฐ๊ฑด์„ ์‚ฌ์šฉํ•ด์„œ ์ „์†ก๋˜๋Š” ๊ฐ์ฒด๋ฅผ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” --include-prefixes ๋ฐ --exclude-prefixes์™€ --include-modified-[before | after]-[absolute | relative]์˜ ์‹œ๊ฐ„ ๊ธฐ์ค€ ์กฐ๊ฑด์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ์†Œ์Šค๋กœ ํด๋”๋ฅผ ์ง€์ •ํ•œ ๊ฒฝ์šฐ ํ”„๋ฆฌํ”ฝ์Šค ํ•„ํ„ฐ๋Š” ํ•ด๋‹น ํด๋”๋ฅผ ๊ธฐ์ค€์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ํ”„๋ฆฌํ”ฝ์Šค๋กœ ์†Œ์Šค ๊ฐ์ฒด ํ•„ํ„ฐ๋ง์„ ์ฐธ์กฐํ•˜์„ธ์š”.

  • ์ „์†ก ์˜ต์…˜: ๋Œ€์ƒ ํŒŒ์ผ(--overwrite-when=different ๋˜๋Š”always)์„ ๋ฎ์–ด์“ธ์ง€ ์—ฌ๋ถ€์™€ ์ „์†ก ์ค‘ ๋˜๋Š” ์ „์†ก ํ›„์— ํŠน์ • ํŒŒ์ผ์„ ์‚ญ์ œํ• ์ง€ ์—ฌ๋ถ€(--delete-from=destination-if-unique ๋˜๋Š”source-after-transfer)๋ฅผ ์ง€์ •ํ•˜๊ณ , ๋ณด์กดํ•  ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๊ฐ’(--preserve-metadata)์„ ์ง€์ •ํ•˜๋ฉฐ, ํ•„์š”ํ•œ ๊ฒฝ์šฐ ์ „์†ก๋œ ๊ฐ์ฒด์— ์Šคํ† ๋ฆฌ์ง€ ํด๋ž˜์Šค๋ฅผ ์„ ํƒ์ ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค(--custom-storage-class).

  • ์•Œ๋ฆผ: --notification-pubsub-topic, --notification-event-types, --notification-payload-format์œผ๋กœ Pub/Sub ์ „์†ก ์•Œ๋ฆผ์„ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  • Cloud Logging: --log-actions ๋ฐ --log-action-states๋กœ Cloud Logging์„ ์‚ฌ์šฉ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Storage Transfer Service์˜ Cloud Logging์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ชจ๋“  ์˜ต์…˜์„ ๋ณด๋ ค๋ฉด gcloud transfer jobs create --help๋ฅผ ์‹คํ–‰ํ•˜๊ฑฐ๋‚˜ gcloud ์ฐธ๊ณ  ๋ฌธ์„œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

REST

๋‹ค์Œ ์ƒ˜ํ”Œ์—์„œ๋Š” REST API๋ฅผ ํ†ตํ•ด Storage Transfer Service๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

Storage Transfer Service API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก ์ž‘์—…์„ ๊ตฌ์„ฑํ•˜๊ฑฐ๋‚˜ ํŽธ์ง‘ํ•  ๋•Œ ์‹œ๊ฐ„์€ UTC์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ „์†ก ์ž‘์—… ์ผ์ •์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ผ์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ค ๋•Œ Amazon S3 ๋ฒ„ํ‚ท ์†Œ์Šค ์ด๋ฆ„์— bucketName์˜ s3:// ์ ‘๋‘์‚ฌ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”.

์—์ด์ „ํŠธ๋ฆฌ์Šค ์ „์†ก

๋‹ค์Œ ์˜ˆ์‹œ์—์„œ๋Š” ํ‘œ์ค€ ์—์ด์ „ํŠธ๋ฆฌ์Šค ๊ตฌ์„ฑ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ transferJobs.create ์ฐธ์กฐ๋ฅผ ํ™•์ธํ•˜์„ธ์š”.

POST https://storagetransfer.googleapis.com/v1/transferJobs
{
  "description": "DESCRIPTION",
  "status": "ENABLED",
  "projectId": "PROJECT_ID",
  "transferSpec": {
      "awsS3DataSource": {
          "bucketName": "AWS_SOURCE_NAME",
          "awsAccessKey": {
            "accessKeyId": "AWS_ACCESS_KEY_ID",
            "secretAccessKey": "AWS_SECRET_ACCESS_KEY"
          }
      },
      "gcsDataSink": {
          "bucketName": "GCS_SINK_NAME"
      }
  }
}

๋‹ค๋ฅธ ์ธ์ฆ ์˜ต์…˜์€ ์†Œ์Šค์— ๋Œ€ํ•œ ์•ก์„ธ์Šค ๊ถŒํ•œ ๊ตฌ์„ฑ: Amazon S3๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

CloudFront ๋ฐฐํฌ

CloudFront ๋ฐฐํฌ๋ฅผ ํ†ตํ•ด S3์—์„œ ์ „์†กํ•˜๋Š” ๊ฒฝ์šฐ ๋ฐฐํฌ ๋„๋ฉ”์ธ ์ด๋ฆ„์„ transferSpec.awsS3DataSource.cloudfrontDomain ํ•„๋“œ ๊ฐ’์œผ๋กœ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

POST https://storagetransfer.googleapis.com/v1/transferJobs
{
  "description": "DESCRIPTION",
  "status": "ENABLED",
  "projectId": "PROJECT_ID",
  "transferSpec": {
      "awsS3DataSource": {
          "bucketName": "AWS_SOURCE_NAME",
          "cloudfrontDomain": "https://dy1h2n3l4ob56.cloudfront.net",
          "awsAccessKey": {
            "accessKeyId": "AWS_ACCESS_KEY_ID",
            "secretAccessKey": "AWS_SECRET_ACCESS_KEY"
          }
      },
      "gcsDataSink": {
          "bucketName": "GCS_SINK_NAME"
      }
  }
}

๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ

Google ๊ด€๋ฆฌ ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ S3์—์„œ ์ „์†กํ•˜๋ ค๋ฉด transferSpec.awsS3DataSource.managedPrivateNetwork ํ•„๋“œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

POST https://storagetransfer.googleapis.com/v1/transferJobs
{
  "description": "DESCRIPTION",
  "status": "ENABLED",
  "projectId": "PROJECT_ID",
  "transferSpec": {
      "awsS3DataSource": {
          "bucketName": "AWS_SOURCE_NAME",
          "managedPrivateNetwork": TRUE,
          "awsAccessKey": {
            "accessKeyId": "AWS_ACCESS_KEY_ID",
            "secretAccessKey": "AWS_SECRET_ACCESS_KEY"
          }
      },
      "gcsDataSink": {
          "bucketName": "GCS_SINK_NAME"
      }
  }
}

ํด๋ผ์ด์–ธํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

๋‹ค์Œ ์ƒ˜ํ”Œ์—์„œ๋Š” Go, Java, Node.js, Python์„ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ๊ทธ๋ž˜๋งคํ‹ฑ ๋ฐฉ์‹์œผ๋กœ Storage Transfer Service๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

์ „์†ก ์ž‘์—…์„ ํ”„๋กœ๊ทธ๋ž˜๋งคํ‹ฑ ๋ฐฉ์‹์œผ๋กœ ๊ตฌ์„ฑํ•˜๊ฑฐ๋‚˜ ํŽธ์ง‘ํ•  ๋•Œ ์‹œ๊ฐ„์€ UTC์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ „์†ก ์ž‘์—… ์ผ์ •์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์ผ์ •์„ ์ฐธ์กฐํ•˜์„ธ์š”.

Storage Transfer Service ํด๋ผ์ด์–ธํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ Storage Transfer Service ํด๋ผ์ด์–ธํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์‹œ์ž‘ํ•˜๊ธฐ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

Amazon S3์—์„œ Cloud Storage๋กœ ์ด์ „

์ด ์˜ˆ์‹œ์—์„œ๋Š” ํŒŒ์ผ์„ Amazon S3์—์„œ Cloud Storage ๋ฒ„ํ‚ท์œผ๋กœ ์ด๋™ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ํ•™์Šตํ•ฉ๋‹ˆ๋‹ค.

์ „์†ก ์ž‘์—…์„ ๋งŒ๋“ค ๋•Œ Amazon S3 ๋ฒ„ํ‚ท ์†Œ์Šค ์ด๋ฆ„์— bucketName์˜ s3:// ์ ‘๋‘์‚ฌ๋ฅผ ํฌํ•จํ•˜์ง€ ๋งˆ์„ธ์š”.

Storage Transfer Service ํด๋ผ์ด์–ธํŠธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์—์„œ๋Š” CloudFront ๋˜๋Š” ๊ด€๋ฆฌํ˜• ๋น„๊ณต๊ฐœ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•œ ์ „์†ก์„ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Go

import (
	"context"
	"fmt"
	"io"
	"os"
	"time"

	storagetransfer "cloud.google.com/go/storagetransfer/apiv1"
	"cloud.google.com/go/storagetransfer/apiv1/storagetransferpb"
	"google.golang.org/genproto/googleapis/type/date"
	"google.golang.org/genproto/googleapis/type/timeofday"
)

func transferFromAws(w io.Writer, projectID string, awsSourceBucket string, gcsSinkBucket string) (*storagetransferpb.TransferJob, error) {
	// Your Google Cloud Project ID
	// projectID := "my-project-id"

	// The name of the Aws bucket to transfer objects from
	// awsSourceBucket := "my-source-bucket"

	// The name of the GCS bucket to transfer objects to
	// gcsSinkBucket := "my-sink-bucket"

	ctx := context.Background()
	client, err := storagetransfer.NewClient(ctx)
	if err != nil {
		return nil, fmt.Errorf("storagetransfer.NewClient: %w", err)
	}
	defer client.Close()

	// A description of this job
	jobDescription := "Transfers objects from an AWS bucket to a GCS bucket"

	// The time to start the transfer
	startTime := time.Now().UTC()

	// The AWS access key credential, should be accessed via environment variable for security
	awsAccessKeyID := os.Getenv("AWS_ACCESS_KEY_ID")

	// The AWS secret key credential, should be accessed via environment variable for security
	awsSecretKey := os.Getenv("AWS_SECRET_ACCESS_KEY")

	req := &storagetransferpb.CreateTransferJobRequest{
		TransferJob: &storagetransferpb.TransferJob{
			ProjectId:   projectID,
			Description: jobDescription,
			TransferSpec: &storagetransferpb.TransferSpec{
				DataSource: &storagetransferpb.TransferSpec_AwsS3DataSource{
					AwsS3DataSource: &storagetransferpb.AwsS3Data{
						BucketName: awsSourceBucket,
						AwsAccessKey: &storagetransferpb.AwsAccessKey{
							AccessKeyId:     awsAccessKeyID,
							SecretAccessKey: awsSecretKey,
						}},
				},
				DataSink: &storagetransferpb.TransferSpec_GcsDataSink{
					GcsDataSink: &storagetransferpb.GcsData{BucketName: gcsSinkBucket}},
			},
			Schedule: &storagetransferpb.Schedule{
				ScheduleStartDate: &date.Date{
					Year:  int32(startTime.Year()),
					Month: int32(startTime.Month()),
					Day:   int32(startTime.Day()),
				},
				ScheduleEndDate: &date.Date{
					Year:  int32(startTime.Year()),
					Month: int32(startTime.Month()),
					Day:   int32(startTime.Day()),
				},
				StartTimeOfDay: &timeofday.TimeOfDay{
					Hours:   int32(startTime.Hour()),
					Minutes: int32(startTime.Minute()),
					Seconds: int32(startTime.Second()),
				},
			},
			Status: storagetransferpb.TransferJob_ENABLED,
		},
	}
	resp, err := client.CreateTransferJob(ctx, req)
	if err != nil {
		return nil, fmt.Errorf("failed to create transfer job: %w", err)
	}
	if _, err = client.RunTransferJob(ctx, &storagetransferpb.RunTransferJobRequest{
		ProjectId: projectID,
		JobName:   resp.Name,
	}); err != nil {
		return nil, fmt.Errorf("failed to run transfer job: %w", err)
	}
	fmt.Fprintf(w, "Created and ran transfer job from %v to %v with name %v", awsSourceBucket, gcsSinkBucket, resp.Name)
	return resp, nil
}

์ž๋ฐ”

์ด์ „ ์ƒ˜ํ”Œ์„ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”? Storage Transfer Service ์ด์ „ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.


import com.google.storagetransfer.v1.proto.StorageTransferServiceClient;
import com.google.storagetransfer.v1.proto.TransferProto.CreateTransferJobRequest;
import com.google.storagetransfer.v1.proto.TransferTypes.AwsAccessKey;
import com.google.storagetransfer.v1.proto.TransferTypes.AwsS3Data;
import com.google.storagetransfer.v1.proto.TransferTypes.GcsData;
import com.google.storagetransfer.v1.proto.TransferTypes.Schedule;
import com.google.storagetransfer.v1.proto.TransferTypes.TransferJob;
import com.google.storagetransfer.v1.proto.TransferTypes.TransferJob.Status;
import com.google.storagetransfer.v1.proto.TransferTypes.TransferSpec;
import com.google.type.Date;
import com.google.type.TimeOfDay;
import java.io.IOException;
import java.util.Calendar;

public class TransferFromAws {

  // Creates a one-off transfer job from Amazon S3 to Google Cloud Storage.
  public static void transferFromAws(
      String projectId,
      String jobDescription,
      String awsSourceBucket,
      String gcsSinkBucket,
      long startDateTime)
      throws IOException {

    // Your Google Cloud Project ID
    // String projectId = "your-project-id";

    // A short description of this job
    // String jobDescription = "Sample transfer job from S3 to GCS.";

    // The name of the source AWS bucket to transfer data from
    // String awsSourceBucket = "yourAwsSourceBucket";

    // The name of the GCS bucket to transfer data to
    // String gcsSinkBucket = "your-gcs-bucket";

    // What day and time in UTC to start the transfer, expressed as an epoch date timestamp.
    // If this is in the past relative to when the job is created, it will run the next day.
    // long startDateTime =
    //     new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2000-01-01 00:00:00").getTime();

    // The ID used to access your AWS account. Should be accessed via environment variable.
    String awsAccessKeyId = System.getenv("AWS_ACCESS_KEY_ID");

    // The Secret Key used to access your AWS account. Should be accessed via environment variable.
    String awsSecretAccessKey = System.getenv("AWS_SECRET_ACCESS_KEY");

    // Set up source and sink
    TransferSpec transferSpec =
        TransferSpec.newBuilder()
            .setAwsS3DataSource(
                AwsS3Data.newBuilder()
                    .setBucketName(awsSourceBucket)
                    .setAwsAccessKey(
                        AwsAccessKey.newBuilder()
                            .setAccessKeyId(awsAccessKeyId)
                            .setSecretAccessKey(awsSecretAccessKey)))
            .setGcsDataSink(GcsData.newBuilder().setBucketName(gcsSinkBucket))
            .build();

    // Parse epoch timestamp into the model classes
    Calendar startCalendar = Calendar.getInstance();
    startCalendar.setTimeInMillis(startDateTime);
    // Note that this is a Date from the model class package, not a java.util.Date
    Date startDate =
        Date.newBuilder()
            .setYear(startCalendar.get(Calendar.YEAR))
            .setMonth(startCalendar.get(Calendar.MONTH) + 1)
            .setDay(startCalendar.get(Calendar.DAY_OF_MONTH))
            .build();
    TimeOfDay startTime =
        TimeOfDay.newBuilder()
            .setHours(startCalendar.get(Calendar.HOUR_OF_DAY))
            .setMinutes(startCalendar.get(Calendar.MINUTE))
            .setSeconds(startCalendar.get(Calendar.SECOND))
            .build();
    Schedule schedule =
        Schedule.newBuilder()
            .setScheduleStartDate(startDate)
            .setScheduleEndDate(startDate)
            .setStartTimeOfDay(startTime)
            .build();

    // Set up the transfer job
    TransferJob transferJob =
        TransferJob.newBuilder()
            .setDescription(jobDescription)
            .setProjectId(projectId)
            .setTransferSpec(transferSpec)
            .setSchedule(schedule)
            .setStatus(Status.ENABLED)
            .build();

    // Create a Transfer Service client
    StorageTransferServiceClient storageTransfer = StorageTransferServiceClient.create();

    // Create the transfer job
    TransferJob response =
        storageTransfer.createTransferJob(
            CreateTransferJobRequest.newBuilder().setTransferJob(transferJob).build());

    System.out.println("Created transfer job from AWS to GCS:");
    System.out.println(response.toString());
  }
}

Node.js


// Imports the Google Cloud client library
const {
  StorageTransferServiceClient,
} = require('@google-cloud/storage-transfer');

/**
 * TODO(developer): Uncomment the following lines before running the sample.
 */
// The ID of the Google Cloud Platform Project that owns the job
// projectId = 'my-project-id'

// A useful description for your transfer job
// description = 'My transfer job'

// AWS S3 source bucket name
// awsSourceBucket = 'my-s3-source-bucket'

// AWS Access Key ID
// awsAccessKeyId = 'AKIA...'

// AWS Secret Access Key
// awsSecretAccessKey = 'HEAoMK2.../...ku8'

// Google Cloud Storage destination bucket name
// gcsSinkBucket = 'my-gcs-destination-bucket'

// Creates a client
const client = new StorageTransferServiceClient();

/**
 * Creates a one-time transfer job from Amazon S3 to Google Cloud Storage.
 */
async function transferFromS3() {
  // Setting the start date and the end date as the same time creates a
  // one-time transfer
  const now = new Date();
  const oneTimeSchedule = {
    day: now.getDate(),
    month: now.getMonth() + 1,
    year: now.getFullYear(),
  };

  // Runs the request and creates the job
  const [transferJob] = await client.createTransferJob({
    transferJob: {
      projectId,
      description,
      status: 'ENABLED',
      schedule: {
        scheduleStartDate: oneTimeSchedule,
        scheduleEndDate: oneTimeSchedule,
      },
      transferSpec: {
        awsS3DataSource: {
          bucketName: awsSourceBucket,
          awsAccessKey: {
            accessKeyId: awsAccessKeyId,
            secretAccessKey: awsSecretAccessKey,
          },
        },
        gcsDataSink: {
          bucketName: gcsSinkBucket,
        },
      },
    },
  });

  console.log(
    `Created and ran a transfer job from '${awsSourceBucket}' to '${gcsSinkBucket}' with name ${transferJob.name}`
  );
}

transferFromS3();

Python

์ด์ „ ์ƒ˜ํ”Œ์„ ์ฐพ๊ณ  ๊ณ„์‹ ๊ฐ€์š”? Storage Transfer Service ์ด์ „ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

from datetime import datetime

from google.cloud import storage_transfer


def create_one_time_aws_transfer(
    project_id: str,
    description: str,
    source_bucket: str,
    aws_access_key_id: str,
    aws_secret_access_key: str,
    sink_bucket: str,
):
    """Creates a one-time transfer job from Amazon S3 to Google Cloud
    Storage."""

    client = storage_transfer.StorageTransferServiceClient()

    # The ID of the Google Cloud Platform Project that owns the job
    # project_id = 'my-project-id'

    # A useful description for your transfer job
    # description = 'My transfer job'

    # AWS S3 source bucket name
    # source_bucket = 'my-s3-source-bucket'

    # AWS Access Key ID
    # aws_access_key_id = 'AKIA...'

    # AWS Secret Access Key
    # aws_secret_access_key = 'HEAoMK2.../...ku8'

    # Google Cloud Storage destination bucket name
    # sink_bucket = 'my-gcs-destination-bucket'

    now = datetime.utcnow()
    # Setting the start date and the end date as
    # the same time creates a one-time transfer
    one_time_schedule = {"day": now.day, "month": now.month, "year": now.year}

    transfer_job_request = storage_transfer.CreateTransferJobRequest(
        {
            "transfer_job": {
                "project_id": project_id,
                "description": description,
                "status": storage_transfer.TransferJob.Status.ENABLED,
                "schedule": {
                    "schedule_start_date": one_time_schedule,
                    "schedule_end_date": one_time_schedule,
                },
                "transfer_spec": {
                    "aws_s3_data_source": {
                        "bucket_name": source_bucket,
                        "aws_access_key": {
                            "access_key_id": aws_access_key_id,
                            "secret_access_key": aws_secret_access_key,
                        },
                    },
                    "gcs_data_sink": {
                        "bucket_name": sink_bucket,
                    },
                },
            }
        }
    )

    result = client.create_transfer_job(transfer_job_request)
    print(f"Created transferJob: {result.name}")