Scalable Storage in the cloud
[ { "AllowedHeaders": [ "*" ], "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "http://localhost:2314", "https://example.com" ], "ExposeHeaders": [] } ]
const signedUrl = s3.getSignedUrl('getObject', { Bucket: config.aws.s3.bucket, Key: `Some/Where/Over/The/Rainbow`, Expires: 60 * 60, // seconds ResponseContentDisposition: `attachment; filename="${encodeURIComponent('filename.ext')}"` });
router.get('/s3/makeSignedUrl', async (req, res) => { try { const s3 = new AWS.S3(); const url = s3.getSignedUrl('putObject', { Bucket: "<bucketName>", Key: 'signedUrlTest/' + moment().format('YYYYMMDD.HHmmss') + '.txt', Expires: 60, // seconds }); res.json({url}); } catch(err) { res.json({err}); } });
PUT Request using Issued Signed Url router.get('/s3/uploadUsingSignedUrl', async (req, res) => { try { const result = await rp({ method: "PUT", url: '<SignedUrl>', body: 'test ' + moment().format() }); res.json({result}); } catch(err) { res.json({err}); } });
CognitoCachingCredentialsProvidercphttps://docs.aws.amazon.com/cli/latest/reference/s3/cp.html
cp <LocalPath> <S3Uri> cp <S3Uri> <LocalPath> cp <S3Uri> <S3Uri>
aws s3 cp src dst aws s3 cp path/to/local/file.txt s3://bucket/key/file.txt aws s3 cp s3://bucket/key/file.txt path/to/local/file.txt
synchttps://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
local -> s3, s3 -> local, s3 -> s3 간 파일을 동기화한다.
aws s3 sync ./out "s3://bucket/path"Similar pages by cosine similarity. Words after page name are term frequency.