aws-sdk-nodejs

using profile that assume role in aws-sdk (AWS JavaScript SDK)

寵の児 提交于 2019-11-30 02:00:20
Using the AWS SDK for JavaScript, I want to use a default profile that assumes the a role. This works perfectly with the AWS CLI. Using node.js with the SDK does not assume the role, but only uses credentials to the AWS account that the access key belongs to. I've found this documentation but it does not deal with assuming a role: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html Any tips? This is my config file: [default] role_arn = arn:aws:iam::123456789:role/Developer source_profile = default output = json region = us-east-1 The CLI and

using profile that assume role in aws-sdk (AWS JavaScript SDK)

谁说胖子不能爱 提交于 2019-11-28 22:43:37
问题 Using the AWS SDK for JavaScript, I want to use a default profile that assumes the a role. This works perfectly with the AWS CLI. Using node.js with the SDK does not assume the role, but only uses credentials to the AWS account that the access key belongs to. I've found this documentation but it does not deal with assuming a role: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html Any tips? This is my config file: [default] role_arn = arn:aws

Call aws-cli from AWS Lambda

笑着哭i 提交于 2019-11-27 20:25:37
is there ANY way to execute aws-cli inside AWS Lambda? It doesn't seem to be pre-installed. (I've checked with "which aws" via Node.js child-process, and it didn't exist.) Now we can use Layers inside Lambda. Bash layer with aws-cli is available at https://github.com/gkrizek/bash-lambda-layer handler () { set -e # Event Data is sent as the first parameter EVENT_DATA=$1 # This is the Event Data echo $EVENT_DATA # Example of command usage EVENT_JSON=$(echo $EVENT_DATA | jq .) # Example of AWS command that's output will show up in CloudWatch Logs aws s3 ls # This is the return value because it's

Call aws-cli from AWS Lambda

二次信任 提交于 2019-11-26 22:52:45
问题 is there ANY way to execute aws-cli inside AWS Lambda? It doesn't seem to be pre-installed. (I've checked with "which aws" via Node.js child-process, and it didn't exist.) 回答1: Now we can use Layers inside Lambda. Bash layer with aws-cli is available at https://github.com/gkrizek/bash-lambda-layer handler () { set -e # Event Data is sent as the first parameter EVENT_DATA=$1 # This is the Event Data echo $EVENT_DATA # Example of command usage EVENT_JSON=$(echo $EVENT_DATA | jq .) # Example of

How to get response from S3 getObject in Node.js?

ぃ、小莉子 提交于 2019-11-26 18:13:02
问题 In a Node.js project I am attempting to get data back from S3. When I use getSignedURL , everything works: aws.getSignedUrl('getObject', params, function(err, url){ console.log(url); }); My params are: var params = { Bucket: "test-aws-imagery", Key: "TILES/Level4/A3_B3_C2/A5_B67_C59_Tiles.par" If I take the URL output to the console and paste it in a web browser, it downloads the file I need. However, if I try to use getObject I get all sorts of odd behavior. I believe I am just using it