Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:29

    aws-sdk-js-automation on v2.779.0

    (compare)

  • 18:29

    aws-sdk-js-automation on master

    Updates SDK to v2.779.0 (compare)

  • 12:47
    raghda94 edited #3513
  • 12:47
    raghda94 edited #3513
  • 12:47
    raghda94 labeled #3513
  • 12:47
    raghda94 labeled #3513
  • 12:47
    raghda94 opened #3513
  • 12:35
    mbelang commented #3481
  • 11:15
    johndpope commented #3029
  • 03:05
    jacknagel commented #3481
  • 01:16
    aws-sdk-js-automation commented #3512
  • 01:09
    trivikr opened #3512
  • 00:34
    github-actions[bot] closed #2815
  • 00:34
    github-actions[bot] labeled #2815
  • 00:34
    github-actions[bot] unlabeled #2815
  • Oct 25 00:35
    github-actions[bot] closed #3111
  • Oct 25 00:35
    github-actions[bot] labeled #3111
  • Oct 25 00:35
    github-actions[bot] unlabeled #3111
  • Oct 24 12:56
    jeromecovington commented #2855
  • Oct 24 12:52
    aws-sdk-js-automation commented #3511
kes333
@kes333
@BertrandMarechal Thanks that works ! The other issue is with the file name download, it downloads as response.jpg / pdf and not the actual filename
BertrandMarechal
@BertrandMarechal
where do you download from ? is the S3 key correct ?
yeah, I mean, the file on s3 is not called response.jpg or pdf ?
kes333
@kes333
Nope, it has a specific filename
BertrandMarechal
@BertrandMarechal
so that's your download code then
kes333
@kes333
I upload a file in S3, an event is fired and then a lambda function generated a pre signed URL for the document and posts to an external document management API. I built this API with backend dynamodb and AWS API gateway. I then copy the URL from the DB and then fire a postman GET request which fetches the file from S3 . The URL is valid for 5 mins after which it expires
The issue is with the file name which gets replaced with response everytime
BertrandMarechal
@BertrandMarechal
hum
if you paste this url in the browser, what is the file downloaded as ?
it seems to be a postman thing :)
kes333
@kes333
If I post the file in browser, it is rendered on page
BertrandMarechal
@BertrandMarechal
ok. but yeah, it's a postman thing. if you had a Frontend, you would choose your file name
kes333
@kes333
I added the content dispostion in the code : ResponseContentDisposition: "attachment;filename=key"; as suggested in the post you forwarded
BertrandMarechal
@BertrandMarechal
yeah, does it work ?
I was just reading through
kes333
@kes333
nope, I already had that
BertrandMarechal
@BertrandMarechal
there seem to be a way when generating the presigned url
kes333
@kes333
ok, let me try that
kes333
@kes333
Excellent, it works :-) Thanks for your help @BertrandMarechal ! Appreciate it
I just added content disposition as a parameter object
var url = s3.getSignedUrl('getObject', {
Bucket: bucket,
Key: key,
Expires: 60 * 5,
ResponseContentDisposition: attachment; filename="${key}"
});
BertrandMarechal
@BertrandMarechal
nice :)
Gareth Denny
@gpdenny

Howdy :bow:
Wanted to drop in in case I'm missing anything obvious before asking in an issue.

I have an ECS Task which is using s3.uploadto put files of varying sizes in S3.
When the object is put using PutObject it works as expected, with the correct ECS Task Role.
When the object is put using CreateMultipartUpload it seems to somehow end up with the ECS EC2 Instance Role, not the Task Role, so fails to upload with AccessDenied.
Am I missing something?
Much Thanks!

Prashant Singh
@prashant1k99
Hi everyone, I am facing cors err: Access to XMLHttpRequest at '<lambda-url>' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I have specifically enabled cors in my API Gateway for that lambda and also set the response header. But facing the issue
BertrandMarechal
@BertrandMarechal
@prashant1k99 did you figure it out ?
Michał Kłoda
@pyemkey
Hi everyone. I have dynamodb table and I would like to run post deployment script to populate table by some data. Any thoughts how it can be done?
Prashant Singh
@prashant1k99

Hi everyone, I want to create image manipulation on the image fetched from the AWS S3 and would like to perform manipulation action on it. I am using stream to solve the problem of loading big files.

import AWS from 'aws-sdk'
import sharp from 'sharp'

const s3 = new AWS.S3()
const transformer = (w, res, next) =>
    sharp()
        .resize(w)
        .on('data', (data) => {
            console.log(data)
            res.write(data, 'binary')
        })
        .on('error', (err) => next(err))
        .on('end', () => {
            console.log('finished')
            res.status(200).end()
        })

const readStream = s3
    .getObject({
        Bucket: process.env.UPLOAD_BUCKET_NAME,
        Key: 'test.jpg'
    })
    .createReadStream()

const getImage = (w, res, next) => {
    readStream.pipe(transformer(w, res, next))
    readStream.on('error', (err) => next(err))
}

export default getImage

I am calling the getImage method on the route and this function serves images for the first time but when the second time the Image is requested, it throws Error: Input buffer contains unsupported image format

Jairo Campos Vargas
@jcamposv
Hi, guys, I have a question I am using getCostandusage js SDK, I wanted to get all the charges with this filter "Other out-of-cycle charges" but I did not find the machine name to put into the RECORD_TYPE filter do you know what is this name ?
Jairo Campos Vargas
@jcamposv
ok I found it, it's Other
andrewjc32
@andrewjc32_gitlab
Hi guys, how do you get an access token to call changeUserPassword for cognito?
markabdallah
@markabdallah
Hi guys, I'm not able to find a solution to this problem: https://stackoverflow.com/questions/63741402/aws-lambda-usermigration-forgotpassword-trigger-not-migrating-users any help would be awesome! Thanks a lot!
Roman
@moltar
Can anyone please shed some light what is the significance of $response.error in the response object when using .promise() variant. I am assuming that SDK will throw in every case of error, or is it not the case? Do I ever need to check $response.error or should I assume if the promise resolved, then everything is a-ok? Thanks.
Talha Javaid Malik
@Talha089
Can anyone please tell me why my terminal showing this error message? SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method
iamnns
@iamnns
Dear all, I appreciate your support, I want to use Node.js SDK to perform some tasks on AWS, for example:
  • I want to list my account information
  • List my regions
  • List my resources per region
    any guidelines where should I start?
Lachlan Vass
@lachlanvass-srg
Hey @iamnns - sorry for the late reply. I only just joined this chat, but can offer some insight. I would start by looking at the Organizations section of the SDK (https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Organizations.html)
I am pretty sure that will allow you to complete the first two points on your list. As for listing resources per region, I am not really sure where to look. I know it is weirdly difficult to look at the resource in an AWS account which have been "set up" by a user at some point. All the resources are available, but not all are in use at a given time. Maybe Resource Groups would be a good place to start? (https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ResourceGroups.html)
Nare Sai Chaitanya
@saichaitanyan
@Talha089 Can you provide more info about the issue by sharing the http response
cutebadmash
@cutebadmash
Hi All, am trying to get results from cloudwatchlogs using GetQueryResults, but cant figure out how to wait till the status reaches complete. Dont want to use SetTimeout. Is there a graceful way to achieve this other than SetTimeout? Any help is appreciated.
Usama Tahir
@Usama-Tahir
Hi all, I used this tutorial (https://coderwall.com/p/j5nk9w/access-ec2-linux-box-over-ssh-without-pem-file) to access ec2 instance without .pem file.
Now what I want is to access ec2 only when I have .pem file. How can I reverse the process done by the tutorial above?
Thanks.
2 replies
ssanri
@ssanri
hey guys, sorry new here and noob question. When I use initializeAuth with REFRESH_TOKEN_AUTH or REFRESH_TOKEN, response only includes authToken, type, idtoken and expiration. Documentation says it also returns refreshToken. Is there something I am missing?
         const params = {
                UserPoolId: this.userPoolId,
                ClientId: this.clientId,
                AuthFlow: 'REFRESH_TOKEN',
                AuthParameters: {
                    REFRESH_TOKEN: request.body.refresh_token
                }
            };

            const cognito = new AWS.CognitoIdentityServiceProvider();

            const response = await cognito.adminInitiateAuth(params).promise();
I have the assumption, from OAUTH2, each time you retrieve an access token, your refresh token also gets regenerated and expiration starts from new generation time. Is that not the case for aws cognito? meaning, if user signs in today, refresh token is valid for 30 days, and no matter what they have to login again after 30 days, even though they actively used the application that period?
ssanri
@ssanri
image.png
image.png
both adminInitateAuth and initateAuth requests returns same response with REFRESH_TOKEN or REFRESH_TOKEN_AUTH parameters in AuthFlow
Ronique Ricketts
@RoniqueRicketts
Hello guys I have a question regarding aws workmail
sivac47123
@sivac47123
Hi Team, Any body have idea on how to initialize AWS.Connect() with Amazon connect endpoint.
Daniel Schultz
@slifty
Hey all -- is this project still maintained? I have an open bug report and offer to patch but it's been sitting there for about 12 days. aws/aws-sdk-js#3486