amazon-web-services

How to display image from aws s3 in blade laravel 5.2

两盒软妹~` 提交于 2021-02-18 17:10:51
问题 I have created a method for getting the data(image file) from aws S3 like this : public static function getImage ($imagePath) { if(Storage::exists($imagePath)) { return Storage::disk('s3')->get($imagePath); }else { return 'No Image'; } } I'm sure that those image is exist on the aws, so there is no problem with that. And then I use above method as the src in my blade view like this : {!!Html::image(getImage($myPath),'logo',['width'=>60,'height'=>55])!!} $myPath here already point to the

Can't connect to my AWS Database Instance | psql: could not connect to server: Operation timed out

泄露秘密 提交于 2021-02-18 17:08:17
问题 I created a postgres DB instance on AWS RDS. I am trying to connect this DB instance to my django zappa app so I can perform AWS Lambda functions. I've added a new security group to my DB instance so I can allow my django app to connect to it: My DB details show that the new security group is active: However when I try to connect to it, either by running psql --host="*************.us-east-2.rds.amazonaws.com" --port="5432" --username="*********" --password --dbname="*****" via my terminal, or

AWS was not able to validate the provided access credentials. AuthFailed only at SPECIFIC regions

回眸只為那壹抹淺笑 提交于 2021-02-18 16:55:24
问题 I am trying to perform some actions via linux aws CLI. My credentials file is 100% correct. User has EC2FullAccess and Amdinistrative(highest rank) permissions. I am able to execute all commands. The problem is that following regions produce AuthFailed error, rest regions work fine: Ohio Central Frankfurt Seoul London. Those regions are all available to my account via web interface, and also aws ec2 describe-regions prints all of regions. Creating instances, for example, via web interface in

Amazon Bucket Policy for only mobile app access

夙愿已清 提交于 2021-02-18 13:51:54
问题 I have a bucket in Amazon S3 and I set data inside read only for everyone. However, this is not what I want. I would like that data to be accessible only from my mobile application and restrict it to download by url. Is that possible? if so how to implement such bucket policy? 回答1: Traditionally, access to a mobile app is done this way: The mobile app user authenticates to your back-end (through your mobile app). This could be done with Amazon Cognito or with your own database of username

Accessing Parameter Store from VPC / Lambda

依然范特西╮ 提交于 2021-02-18 11:45:14
问题 My lambda function can access Systems Manager parameters (ssm.getParameter) when NOT in a VPC. When I add the lambda function to my VPC, I lose access to SSM. The function times out. Clearly I am missing a security group setting or something but can't figure it out. What do I need to do to enable lambda access to SSM when running it in my VPC? 回答1: Most likely this is because you're creating your lambda function in the public subnet, Lambda does get public ip address and uses NAT to access

Download S3 Files with Boto

岁酱吖の 提交于 2021-02-18 11:42:05
问题 I am trying to set up an app where users can download their files stored in an S3 Bucket. I am able to set up my bucket, and get the correct file, but it won't download, giving me the this error: No such file or directory: 'media/user_1/imageName.jpg' Any idea why? This seems like a relatively easy problem, but I can't quite seem to get it. I can delete an image properly, so it is able to identify the correct image. Here's my views.py def download(request, project_id=None): conn =

Elastic Beanstalk: log task customization on Amazon Linux 2 platforms

血红的双手。 提交于 2021-02-18 10:18:11
问题 I'm wondering how to do log task customization in the new Elastic Beanstalk platform (the one based on Amazon Linux 2). Specifically, I'm comparing: Old : Single-container Docker running on 64bit Amazon Linux/2.14.3 New : Single-container Docker running on 64bit Amazon Linux 2/3.0.0 (My question actually has nothing to do with Docker as such, I'm speculating the problem exist for any of the new Elastic Beanstalk platforms). Previously I could follow Amazon's recipe, meaning put a file into

AWS Cloudformation Role is not authorized to perform AssumeRole on Role

可紊 提交于 2021-02-18 10:14:14
问题 I am trying to execute a cloudformation stack which contains the following resources: Codebuild project Codepipeline pipeline Roles needed While trying to execute the stack, it fails with the following error: arn:aws:iam::ACCOUNT_ID:role/CodePipelineRole is not authorized to perform AssumeRole on role arn:aws:iam::ACCOUNT_ID:role/CodePipelineRole (Service: AWSCodePipeline; Status Code: 400; Error Code: InvalidStructureException; Request ID: 7de2b1c6-a432-47e6-8208-2c0072ebaf4b) I created the

Restricting file types on amazon s3 bucket with a policy

六眼飞鱼酱① 提交于 2021-02-18 10:11:34
问题 I'm trying to set up so the only file types the bucket can hold would be png, jpeg, and gif images. I'm trying to put in a bucket policy like this { "conditions": [ {"bucket": "bucketname"}, ["starts-with", "$Content-Type", "image/jpeg"], ["starts-with", "$Content-Type", "image/png"], ["starts-with", "$Content-Type", "image/gif"], ["content-length-range", 0, 10485760] ] } Then I'm also trying to limit the size but when I try to update my policy I get the error "Invalid policy element -

AWS Cloudformation Role is not authorized to perform AssumeRole on Role

[亡魂溺海] 提交于 2021-02-18 10:10:57
问题 I am trying to execute a cloudformation stack which contains the following resources: Codebuild project Codepipeline pipeline Roles needed While trying to execute the stack, it fails with the following error: arn:aws:iam::ACCOUNT_ID:role/CodePipelineRole is not authorized to perform AssumeRole on role arn:aws:iam::ACCOUNT_ID:role/CodePipelineRole (Service: AWSCodePipeline; Status Code: 400; Error Code: InvalidStructureException; Request ID: 7de2b1c6-a432-47e6-8208-2c0072ebaf4b) I created the