Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from RemotePixel/cbersbucket
Browse files Browse the repository at this point in the history
change cbers metadata bucket and fix bugs
  • Loading branch information
vincentsarago authored Jan 25, 2018
2 parents 56d5406 + c06247e commit c3f3280
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

0.2.0
-----
- Change CBERS bucket


0.1.2
-----
- sentinel sceneid UTMzome bug fix
Expand Down
2 changes: 1 addition & 1 deletion handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports.cbers = (event, context, callback) => {
if (event.row === '') return callback(new Error('ROW param missing!'));
if (event.path === '') return callback(new Error('PATH param missing!'));

utils.get_cbers(event.path, event.row, event.full)
utils.get_cbers(event.path, event.row)
.then(data => {
return callback(null, {
request: { path: event.path, row: event.row },
Expand Down
14 changes: 4 additions & 10 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ provider:
region: us-east-1

iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:GetObject"
Resource:
- "arn:aws:s3:::cbers-pds/*"
- "arn:aws:s3:::landsat-pds/*"
- "arn:aws:s3:::sentinel-s2-l1c/*"
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:GetObject"
Resource:
- "arn:aws:s3:::cbers-pds"
- "arn:aws:s3:::landsat-pds"
- "arn:aws:s3:::sentinel-s2-l1c"
- "arn:aws:s3:::cbers-meta-pds*"
- "arn:aws:s3:::landsat-pds*"
- "arn:aws:s3:::sentinel-s2*"

# deploymentBucket: remotepixel-${self:provider.region}

Expand Down
6 changes: 3 additions & 3 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ const get_landsat = (path, row, full=false) => {


const get_cbers = (path, row) => {
const s3 = new AWS.S3({region: 'us-west-2'});
const cbers_bucket = 'cbers-pds';
const s3 = new AWS.S3({region: 'us-east-1'});
const cbers_bucket = 'cbers-meta-pds';

row = utils.zeroPad(row, 3);
path = utils.zeroPad(path, 3);
Expand All @@ -198,7 +198,7 @@ const get_cbers = (path, row) => {
let cbers_id = e.split('/').slice(-2,-1)[0];
let info = utils.parseCBERSid(cbers_id);
let preview_id = cbers_id.split('_').slice(0,-1).join('_');
info.browseURL = `https://cbers-pds.s3.amazonaws.com/CBERS4/MUX/${path}/${row}/${cbers_id}/${preview_id}.jpg`;
info.browseURL = `https://${cbers_bucket}.s3.amazonaws.com/CBERS4/MUX/${path}/${row}/${cbers_id}/${preview_id}_small.jpeg`;
return info;
});
});
Expand Down

0 comments on commit c3f3280

Please sign in to comment.