aws-sdk

From AWS SDK, how to I get the current logged in username (or IAM user)?

♀尐吖头ヾ 提交于 2020-07-20 07:03:30
问题 I'm using the Ruby SDK (V2), but I guess my question is more general than the specific implementation as I couldn't find an answer in any of the SDKs. How do I get the username (and/or IAM user) that my session currently belongs to? I let the SDK run its default behaviour for choosing credentials (ENV vars, then 'default' profile or other if specified and then machine role). Then I initialize my client and run commands. I'd like to know 'who is running the commands'. I expect to get the AWS

Error in AWS CLI (Amplify) when executing the “amplify init” command in windows environment (for an android studio project)

纵饮孤独 提交于 2020-07-07 11:13:16
问题 I'am new to the AWS SDK and I'am trying to create a new android studio project with AWS SDK for mobile. My ultimate goal is to get AWS SDK working on my Android studio project, I tried adding dependencies on Gradle, but it does not all all packages I need and it's not helping me, and thus I followed the official AWS documentation which lead me to Amplify CLI. As suggested by the official AWS documentation (this is the link to the documentation page I'm talking about), I was following along

AWS IoT Connection error : Invalid “caCert” option supplied with aws-iot-device-sdk

我是研究僧i 提交于 2020-06-28 05:26:28
问题 I've provisioned a device in AWS with device Certificate which is signed by my CA. Also, I've registered my CA along with verificationCert in AWS previously. Now when I send the data, In the options, var awsIot = require('aws-iot-device-sdk'); var device = awsIot.device({ privateKey: '--BEGIN RSA PRIVATE KEY--', //private key of my device clientCert: '--BEGIN CERTIFICATE --', //cat deviceCertificate and registered CA caCert: '--BEGIN CERTIFICATE--', //Amazon root CA clientId: 'Thing01',

AWS Elastic Beanstalk - Environment must have instance profile associated with it

坚强是说给别人听的谎言 提交于 2020-06-27 11:59:10
问题 I am working on a project that will programmatically create environments in AWS elastic beanstalk. I am using the AWS SDK for PHP Version 3. My script creates the environment. From the AWS console, the environment is displayed in gray and says that it is terminated. Viewing the events shows that an error of "Environment must have instance profile associated with it". I have tried using the access key and secret of two different users. One user has AmazonEC2FullAccess, IAMFullAccess, and

How change S3 file ownership while cross-account uploading

安稳与你 提交于 2020-06-25 10:40:30
问题 I have an application which upload ( copy ) some files to a S3 bucket in another AWS account, I use copyObject command from AWS SDK ( Nodejs ) var params = { Bucket: "MyBucket_AccountB", CopySource: encodeURI('/Accunt_A_Bocket/file.png'), Key: "file.png", ACL: 'bucket-owner-full-control' }; s3.copyObject(params, function(err, datas) { if (err) console.log(err, err.stack); // an error occurred else console.log(datas); // successful response }); This code, run from a diffrent AWS Account, let's

Which NPM modules are preinstalled in AWS Lambda execution environment?

时光总嘲笑我的痴心妄想 提交于 2020-06-22 10:11:23
问题 Recently I found that aws-sdk NPM module is preinstalled in AWS Lambda nodejs8.10. And I can't find any information in the internet about it. Which other node.js modules are pre-installed in AWS Lambda? 回答1: Only the aws-sdk package is preinstalled . All the rest is loaded from the "node_modules" directory.. You can find information about it here: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html 回答2: I've used the "https" and the "url" package, so those at least

Which NPM modules are preinstalled in AWS Lambda execution environment?

主宰稳场 提交于 2020-06-22 10:09:06
问题 Recently I found that aws-sdk NPM module is preinstalled in AWS Lambda nodejs8.10. And I can't find any information in the internet about it. Which other node.js modules are pre-installed in AWS Lambda? 回答1: Only the aws-sdk package is preinstalled . All the rest is loaded from the "node_modules" directory.. You can find information about it here: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html 回答2: I've used the "https" and the "url" package, so those at least

How to decode ion_binary of Amazon QLDB in ruby

萝らか妹 提交于 2020-06-17 00:51:30
问题 I was playing with QLDB of Amazon with ruby and used the aws-sdk-qldb and aws-sdk-qldbsession gem. I was getting result as IonBinary. But not able to decode and parse it. Following is the code cred = Aws::Credentials.new(ENV['AWS_ACCESS_KEY'], ENV['AWS_SECRET_ACCESS_KEY']) qldb_session_client = Aws::QLDBSession::Client.new(region: 'ap-southeast-1', credentials: cred) start_session_req = Aws::QLDBSession::Types::StartSessionRequest.new start_session_req.ledger_name = 'ledger-test' command

Amazon Web Services (AWS) Cognito error “Token is not from a supported provider of this identity pool.”

时光总嘲笑我的痴心妄想 提交于 2020-06-15 04:15:45
问题 I am running this app from GitHub which allows a user to sign up and sign in to a Cognito Client App. I am using Eclipse IDE for Enterprise Java Developers Version: 2019-03 (4.11.0), Build id: 20190314-1200. I have ensured that I put all the necessary credentials accurately. I am able to sign up using both the form and the console. When I try to sign in, I get an error in the console that says, "Token is not from a supported provider of this identity pool." using both form and console. I have

Invoke function async on AWS Lambda

孤人 提交于 2020-06-13 08:49:09
问题 I'm trying to invoke a function as async because I don't wan't to wait the response. I've read the AWS docs and there says to use InvocationType as Event but it only works if I do a .promise() . not working version : lambda.invoke({ FunctionName: 'rock-function', InvocationType: 'Event', Payload: JSON.stringify({ queryStringParameters: { id: c.id, template: c.csvTemplate } }) }) working version : lambda.invoke({ FunctionName: 'rock-function', InvocationType: 'Event', Payload: JSON.stringify({