aws-sdk

How to get the last access date of any resource in a bucket in amazon s3 in node.js?

不羁岁月 提交于 2021-02-08 05:18:33
问题 I am trying to get the last access date of a resource in a bucket. But not able find anything related to it. I tried to fetch all the access logs for a bucket and parsed the logs files to check if a resource is accessed. This is a very complex approach. In the s3.listObjects I am getting the below object:- { Key: '_636579271588176973_951622.json', LastModified: 2018-08-02T08:31:29.000Z, ETag: '"c348574fabf83d603984a60983add161"', Size: 32172, StorageClass: 'STANDARD', Owner: [Object] }, 回答1:

how to get s3 bucket size via aws-sdk (javascript or node)

佐手、 提交于 2021-02-08 03:38:10
问题 I tried to find/get s3 bucket information using javascript/nodejs aws-sdk, but I didnt find such apis. How to get s3 bucket size / information via aws-sdk (javascript or node) api. 回答1: There is no API to get the bucket size other than enumerating all the objects. One alternative approach would be to investigate the billing, but I think that will only yield inaccurate data as the billing handles a specific size over a specific time. 回答2: Once a day the size of the bucket is reported to

AWS SDK can not read environment variables

醉酒当歌 提交于 2021-02-07 09:19:12
问题 I am setting AWS_ env variables as below for Jenkins sudo apt-get update -y sudo apt-get install -y python3 python-pip python-devel sudo pip install awscli S3_LOGIN=$(aws sts assume-role --role-arn rolename --role-session-name s3_session) export AWS_CREDENTIAL_PROFILES_FILE=~/.aws/credentials export AWS_ACCESS_KEY_ID=$(echo ${S3_LOGIN}| jq --raw-output '.Credentials|"\(.AccessKeyId)"') export AWS_SECRET_ACCESS_KEY=$(echo ${S3_LOGIN} | jq --raw-output '.Credentials|"\(.SecretAccessKey)"')

AWS SDK can not read environment variables

做~自己de王妃 提交于 2021-02-07 09:10:38
问题 I am setting AWS_ env variables as below for Jenkins sudo apt-get update -y sudo apt-get install -y python3 python-pip python-devel sudo pip install awscli S3_LOGIN=$(aws sts assume-role --role-arn rolename --role-session-name s3_session) export AWS_CREDENTIAL_PROFILES_FILE=~/.aws/credentials export AWS_ACCESS_KEY_ID=$(echo ${S3_LOGIN}| jq --raw-output '.Credentials|"\(.AccessKeyId)"') export AWS_SECRET_ACCESS_KEY=$(echo ${S3_LOGIN} | jq --raw-output '.Credentials|"\(.SecretAccessKey)"')

Redirect http:// requests to https:// on AWS API Gateway (using Custom Domains)

守給你的承諾、 提交于 2021-02-07 04:42:08
问题 I'm using AWS API Gateway with a custom domain. When I try to access https ://www.mydomain.com it works perfectly, but when i try http ://www.mydomain.com it can't connect. Is there a way to redirect the http -> https with the custom domain in API Gateway? If not, is there a way to get the http:// links to work just like the https:// links? 回答1: API Gateway doesn't directly support http without TLS, presumably as a security feature, as well as for some practical considerations. There is not a

How to Load config from ~/.aws/config

ⅰ亾dé卋堺 提交于 2021-02-06 10:21:34
问题 change log says Load config from ~/.aws/config if AWS_SDK_LOAD_CONFIG is set. Couldn't find any examples or documentation regarding how to load the config. Any help! 回答1: There is a little bit of magic in how aws-sdk loads the config either set the env variable export AWS_SDK_LOAD_CONFIG="true" or before loading the aws-sdk set process.env.AWS_SDK_LOAD_CONFIG = true; Then load the aws module; var AWS = require('aws-sdk'); You can access the region directly by AWS.config.region 回答2: The answer

How to Load config from ~/.aws/config

佐手、 提交于 2021-02-06 10:20:53
问题 change log says Load config from ~/.aws/config if AWS_SDK_LOAD_CONFIG is set. Couldn't find any examples or documentation regarding how to load the config. Any help! 回答1: There is a little bit of magic in how aws-sdk loads the config either set the env variable export AWS_SDK_LOAD_CONFIG="true" or before loading the aws-sdk set process.env.AWS_SDK_LOAD_CONFIG = true; Then load the aws module; var AWS = require('aws-sdk'); You can access the region directly by AWS.config.region 回答2: The answer

Custom attribute not passed into ID_TOKEN created by AWS Cognito

孤者浪人 提交于 2021-02-06 09:54:21
问题 I am not able to get custom attribute in ID_TOKEN returned from AWS Cognito after successful user login. Steps I tried : 1.Created user pool 2.Created app client and checked the custom attribute( customattrib1,customattrib2 ) User Pool screen : Check custom attribute in app client config 3.Created user using admin-create-user api Below image shows the value for user attributes: 4.Signed in user using aws-cognito-auth.js in client app.The ID token returned do not contain the custom attribute.

Custom attribute not passed into ID_TOKEN created by AWS Cognito

我只是一个虾纸丫 提交于 2021-02-06 09:54:06
问题 I am not able to get custom attribute in ID_TOKEN returned from AWS Cognito after successful user login. Steps I tried : 1.Created user pool 2.Created app client and checked the custom attribute( customattrib1,customattrib2 ) User Pool screen : Check custom attribute in app client config 3.Created user using admin-create-user api Below image shows the value for user attributes: 4.Signed in user using aws-cognito-auth.js in client app.The ID token returned do not contain the custom attribute.

AWS .NET SDK on Linux

随声附和 提交于 2021-01-29 13:09:35
问题 I am currently moving an ASP.NET application made by a third party from Windows to Linux. I read the documentation and nothing indicates this should be a problem, but sadly var profile = new CredentialProfile(profileName, credentials) { Region = RegionEndpoint.EUWest1 }; var netSDKFile = new NetSDKCredentialsFile(); netSDKFile.RegisterProfile(profile); throws the following exception Unhandled Exception: Amazon.Runtime.AmazonClientException: The encrypted store is not available. This may be