How to use @aws-sdk/util-format-url - 3 common examples

To help you get started, we’ve selected a few @aws-sdk/util-format-url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / aws-sdk-js-v3-workshop / Exercise2 / frontend / src / libs / getObjectUrl.ts View on Github external
new GetObjectCommand({
      Key: fileName,
      Bucket: config.s3Bucket
    })
  );

  const signer = new S3RequestPresigner({
    ...s3Client.config
  });

  const url = await signer.presignRequest(
    request,
    new Date(Date.now() + 60 * 60 * 1000)
  );
  // @ts-ignore
  return formatUrl(url);
};
github aws / aws-sdk-js-v3 / packages / middleware-ec2-copysnapshot / src / index.ts View on Github external
resolvedEndpoint,
        new QueryBuilder(base64Encoder, utf8Decoder, "ec2")
      );
      let request = requestSerializer.serialize(model, input);
      const presignedRequest = await presignRequestQuery(request, {
        //FIXME: need an endpoint provider for given region
        endpoint: {
          ...resolvedEndpoint,
          hostname: `ec2.${input.SourceRegion}.amazonaws.com`
        },
        credentials: await credentialsProvider(),
        sha256,
        signingName: "ec2",
        signingRegion: input.SourceRegion
      });
      input.PresignedUrl = formatUrl(presignedRequest);
    }
    const revisedArgs = { ...args, input: input as Input };
    return next(revisedArgs);
  };
}
github aws / aws-sdk-js-v3 / packages / middleware-rds-presignedurl / src / index.ts View on Github external
let request = requestSerializer.serialize(model, input);
      //DestinationRegion is not present in model
      request.query = request.query || ({} as QueryParameterBag);
      request.query["DestinationRegion"] = region;
      const presignedRequest = await presignRequestQuery(request, {
        //FIXME: need an endpoint provider for given region
        endpoint: {
          ...resolvedEndpoint,
          hostname: `rds.${sourceRegion}.amazonaws.com`
        },
        credentials: await credentialsProvider(),
        sha256,
        signingName: "rds",
        signingRegion: sourceRegion
      });
      input.PreSignedUrl = formatUrl(presignedRequest);
    }
    return next({ ...args, input: input as Input });
  };
}

@aws-sdk/util-format-url

[![NPM version](https://img.shields.io/npm/v/@aws-sdk/util-format-url/latest.svg)](https://www.npmjs.com/package/@aws-sdk/util-format-url) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/util-format-url.svg)](https://www.npmjs.com/package/@aws-sd

Apache-2.0
Latest version published 3 days ago

Package Health Score

100 / 100
Full package analysis

Popular @aws-sdk/util-format-url functions

Similar packages