Category : amazon-s3

I have the aws – s3 setup in my project. I am generating presigned URL from Javascript SDK like this var params = {Bucket: ‘bucket’, Key: ‘key’}; var promise = s3.getSignedUrlPromise(‘getObject’, params); promise.then(function(url) { console.log(‘The URL is’, url); }, function(err) { … }); From above code I get the file download URL, my code to ..

Read more

I will get a Error with the s3.upload function. uploadParams = Bucket: _cloudMediaData.bucket Key: uploadPrfx + doc.filename ACL: "public-read" ContentType: doc.contentType Body: Buffer.from(doc.file, "binary") The Key output is workdata/A_/A_100/A_100_test.gif And the Output of console.log(typeof(Key)) is string. I don’t know what the Problem is. Source: Ask Javascript..

Read more

I am trying to create a proxy API Gateway using CDK that can access non-public S3 bucket. To do this, I created a role: const role = new iam.Role(this, ‘apigw-s3-readonly-role’, { roleName: ‘ApiGw-S3-ReadOnly’, assumedBy: new iam.ServicePrincipal(‘apigateway.amazonaws.com’), }) role.addToPolicy(new iam.PolicyStatement({ resources: [bucket.bucketArn], actions: [‘s3:GetObject’] })) And created an API like this: const api = new apigw.RestApi(this, ..

Read more