aws

AWS S3 upload without access and secret key in Java

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to upload a file to S3 without using my access and secret key from AWS server. AWS keys should be taken as default. However running the below command in server I can access it without providing any access and secret keys. aws s3 cp somefile.txt s3://somebucket/ From java code its not accessible since it was unable to load credentials. Below is my code. AmazonS3 s3client = new AmazonS3Client(new DefaultAWSCredentialsProviderChain()); 回答1: You can use the below Java code to get the s3client instance when you are trying to connect to S3

Unable to import module in AWS Lambda (Python)

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a python script named foo.py . It has a lambda handler function defined like this: def handler ( event , context ): for record in event [ 'Records' ]: bucket = record [ 's3' ][ 'bucket' ][ 'name' ] key = record [ 's3' ][ 'object' ][ 'key' ] download_path = '/tmp/{}.gz' . format ( key ) csv_path = '/tmp/{}.csv' . format ( key ) ... proceed to proprietary stuff This is in a zip file like so: - foo . zip - foo . py - dependencies I have uploaded this zip file to AWS Lambda and configured an AWS Lambda Function to run foo

Spring Boot, Spring Cloud AWS and AWS SQS not reading from the queue

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying a to build a minimal gradle java project with Spring Boot and Spring Cloud AWS SQS but I can't get it to read from the queue. These are my project files: build.gradle: apply plugin: "java" apply plugin: "eclipse" apply plugin: "spring-boot" apply plugin: "io.spring.dependency-management" sourceCompatibility = 1.8 targetCompatibility = 1.8 buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.5.RELEASE") classpath("io.spring.gradle:dependency-management

AWS Lambda: ClassNotFoundException

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I currently get a ClassNotFoundException whenever I try to test my Lambda function on AWS Lambda. The exception is shown here: I've searched online, including this link here: AWS Lambda: class java.lang.ClassNotFoundException , to no avail. I am working in Android Studio and created a JAR file (using this link: How to make a .jar out from an Android Studio project ) to use to upload the class to the AWS Lambda console. Below is the structure of my project: When I upload my JAR file to the AWS Lambda console, the Configuration tab

Amazon S3 Upload error PermanentRedirectException

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've installed the Amazon SDK for PHP using composer. I copied the example code and implemented into my system, but when I attempt to upload a file, I'm getting the following (i've made the paths generic for security): Fatal error: Uncaught exception 'Aws\S3\Exception\PermanentRedirectException' with message 'Encountered a permanent redirect while requesting https://s3.amazonaws.com/mybucket/path/to/image.jpg . Are you sure you are using the correct region for this bucket?' in /path/to/vendor/aws/aws-sdk-php/src/S3

AWS Lambda and Redis client. Why can't I call callback?

匿名 (未验证) 提交于 2019-12-03 08:57:35
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to write an AWS Lambda function which uses Redis. When I run the code below: 'use strict' function handler (data, context, callback) { const redis = require("redis") const _ = require("lodash") console.log('before client') const client = redis.createClient({ url: 'redis://cache-url.euw1.cache.amazonaws.com:6379', }) console.log('after client') callback(null, {status: 'result'}) console.log('after callback') } exports.handler = handler I have an answer like this: { "errorMessage": "2016-09-20T15:22:27.301Z 07d24e0b-7f46-11e6-85e9

AWS EC2 IAM role access denied on S3

匿名 (未验证) 提交于 2019-12-03 08:56:10
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have launched an EC2 instance with IAM role "webapp". role is attached and i can confirm it using curl http://169.254.169.254/latest/meta-data/iam/security-credentials/webapp { "Code" : "Success", "LastUpdated" : "2016-01-04T06:44:50Z", "Type" : "AWS-HMAC", "AccessKeyId" : "xxx", "SecretAccessKey" : "xxx", "Token" : "xxx", "Expiration" : "2016-01-04T12:46:27Z" } webapp Role has an attached policy for S3 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*" } ] } But I am unable to access objects

AWS S3 Pre-signed URL via CLI

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to create pre-signed url for objects in S3 bucket using AWS CLI? I know that could be done using SDK, but is it possible with CLI? I found this on one of the AWS docs, but can't complete the command: s3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset> Any help? 回答1: Did you try aws s3 presign ? Generate a pre-signed URL for an Amazon S3 object. This allows anyone who receives the pre-signed URL to retrieve the S3 object with an HTTP GET request. For sigv4 requests the region needs to be configured explicitly. This

Spark AMI for AWS EC-2

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to specify the AWS AMI with particular OS (say Ubuntu) when launching Spark on Amazon cloud with provided scripts? What is the default AMI, operating system that is launched by EC-2 script? Is it eligible for "Free Tier" program by AWS? 回答1: The script ( spark_ec2.py ) takes the AMI list from https://github.com/mesos/spark-ec2/tree/branch-1.3/ami-list by default. You can override it by creating a fork with your preferences and selecting it with --spark-ec2-git-repo and --spark-ec2-git-branch . 文章来源: Spark AMI for AWS EC-2

Unknown Host exception from the AWS Java client?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Has anyone else run across this exception? We saw it during a load test last night. The hostname is correct and normally works fine. It just started throwing this exception last night. Either it was a random DNS fail on amanzon's part or the Aws SDK for Java does something unexpected under load. > Caused by: java.net.UnknownHostException: sdb.amazonaws.com at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:867) at java.net.InetAddress.getAddressFromNameService