amazon-s3

Access Denied while querying S3 files from AWS Athena within Lambda in different account

馋奶兔 提交于 2020-04-16 21:12:07
问题 I am trying to query Athena View from my Lambda code. Created Athena table for S3 files which are in different account. Athena Query editor is giving me below error: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; I tried accessing Athena View from my Lambda code. Created Lambda Execution Role and allowed this role in Bucket Policy of another account S3 bucket as well like below: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS"

How to Transfer data from Google cloud storage to S3 without any manual activity?

杀马特。学长 韩版系。学妹 提交于 2020-04-15 06:52:53
问题 I want to transfer data from my cloud storage bucket to S3. I did a lot of research . I found an interesting article in which this can be done using gsutil command. Again it requires a manual activity. Is there any way to do this without any manual activity or like any possibility to run this gsutil command through Java API ? I have created a VM instance on my Google cloud project.I have configured the boto file which has my AWS credentials.Using gsutil command I was able to copy my data from

S3 Creation CloudFormation results in 400 Bad Request

孤街醉人 提交于 2020-04-14 03:44:26
问题 I have this problem when creating S3 bucket using CloudFormation. I get a 400 Bad request. Would appreciate if anyone can help. aws cloudformation deploy --profile DEV --stack-name testBucket --template-file create_bucket.yml --region us-east-1 --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM --parameter-overrides BucketName=myBucket Template: AWSTemplateFormatVersion: 2010-09-09 Parameters: BucketName: Description: Provisioned read throughput for each table Type: String Resources: MYBUCKET

CloudFront Error: This XML file does not appear to have any style information associated with it [duplicate]

戏子无情 提交于 2020-04-13 05:29:17
问题 This question already has answers here : CloudFront + S3 Website: “The specified key does not exist” when an implicit index document should be displayed (5 answers) Closed 2 years ago . I have a React app that runs on AWS S3 and CloudFront. When I access the app from the given URL it opens the home page fine. When I navigate to another page using a button on the nav bar it opens the page just fine. But if I then refresh the page I get this error: I also get that same error if I attempt to

Rails 5.2 Active Storage direct upload failure: CORS header ‘Access-Control-Allow-Origin’ missing

牧云@^-^@ 提交于 2020-04-13 02:55:51
问题 I am trying out Rail 5.2.0.rc1 Active Storage, using its included JavaScript library to upload PDF docs directly from the client to the cloud. But on submitting a form I get a browser error in both Firefox & Chrome: Cross-Origin Request Blocked... (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Headers are set thus this.xhr.setRequestHeader... in the activestorage.js and dont appear to be configurable: https://github.com/rails/rails/blob/master/activestorage/app/javascript

How to display media files stored in Amazon S3 in Django template?

最后都变了- 提交于 2020-04-11 16:22:55
问题 I have integrated Amazon S3 with my Django app. A media folder has been created in my S3 bucket, and when users upload a file it shows up there just fine. What I'm unclear about is how to display these files in the template. Currently the code is: <img src="https://s3.console.aws.amazon.com/s3/buckets/myprojectbucket/media/{{ model.file }}"/> I've also tried: <img src="{{ model.file }}"/> Another thing to keep in mind is when I try to access these files from the S3 account I get this output.

Cloudfront returns 403 forbidden when refreshing page

丶灬走出姿态 提交于 2020-04-11 12:41:16
问题 I have uploaded a react app to AWS S3 and am using static website hosting. I then linked a cloudfront distribution to the s3 bucket. I am able to navigate to the site and it functions properly except when I navigate to a new page my-domain/new-page. At first it succeeds but if I try and load the page directly or refresh I get a 403 forbidden error. 回答1: Using react with S3 and CloudFront, I had this or a similar issue where loading the initial index page and then linking to other pages worked

Cloudfront returns 403 forbidden when refreshing page

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-11 12:40:46
问题 I have uploaded a react app to AWS S3 and am using static website hosting. I then linked a cloudfront distribution to the s3 bucket. I am able to navigate to the site and it functions properly except when I navigate to a new page my-domain/new-page. At first it succeeds but if I try and load the page directly or refresh I get a 403 forbidden error. 回答1: Using react with S3 and CloudFront, I had this or a similar issue where loading the initial index page and then linking to other pages worked

Check metadata of S3 objects with AWS SDK for Java 2.x

可紊 提交于 2020-04-11 12:35:43
问题 I was not able to find a way to check the metadata fields of an S3 object such as the Content-Type or the Cache-Control with the AWS SDK for Java 2.x. With the AWS SDK for Java 1.x it was as easy as this: s3Client.getObjectMetadata("myBucket", "myfile.doc"); But I cannot see the analogous method for the newest version of the API. 回答1: The solution is to use HeadObjectRequest and HeadObjectResponse : HeadObjectRequest headObjectRequest = HeadObjectRequest.builder() .bucket(bucketName) .key(key

Check metadata of S3 objects with AWS SDK for Java 2.x

爱⌒轻易说出口 提交于 2020-04-11 12:34:21
问题 I was not able to find a way to check the metadata fields of an S3 object such as the Content-Type or the Cache-Control with the AWS SDK for Java 2.x. With the AWS SDK for Java 1.x it was as easy as this: s3Client.getObjectMetadata("myBucket", "myfile.doc"); But I cannot see the analogous method for the newest version of the API. 回答1: The solution is to use HeadObjectRequest and HeadObjectResponse : HeadObjectRequest headObjectRequest = HeadObjectRequest.builder() .bucket(bucketName) .key(key