Skip to content

[Bug]: Cloudfront Signer is not replaced #736

@darioackermann

Description

@darioackermann

Self-service

  • I'd be willing to implement a fix

Describe the bug

Running transform containing a Cloudfront Signer does not transform, but only remove the legacy import

Steps to reproduce

import { CloudFront } from "aws-sdk";
//....
export async function cloudfrontSignUrl(url, expires_at_ms, options = {}) {
        // ...
	let signer = new CloudFront.Signer(accessKeyID, privateKeyContents);
	return signer.getSignedUrl({ url, expires: expires_at_ms, ...options });
}

Observed behavior

  • Removes import { CloudFront } from "aws-sdk";

Expected behavior

Should result in

import { getSignedUrl } from "@aws-sdk/cloudfront-signer";
// ...
export async function cloudfrontSignUrl(url, expires_at_ms, options = {}) {
        // ...
	return getSignedUrl({ url, privateKey: privateKeyContents, keyPairId: accessKeyID, dateLessThan: expires_at_ms})
}

Environment

aws-sdk-js-codemod: 0.28.2
- jscodeshift: 0.15.0
- recast: 0.23.4

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions