Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.ts #31

Merged
merged 1 commit into from
Apr 30, 2021
Merged

Update index.ts #31

merged 1 commit into from
Apr 30, 2021

Conversation

TRANTANKHOA
Copy link
Contributor

set assetHashType: AssetHashType.SOURCE, see aws/aws-cdk#12984

set `assetHashType: AssetHashType.SOURCE`, see aws/aws-cdk#12984
@@ -87,6 +87,7 @@ export class ECRDeployment extends CoreConstruct {
const handler = new lambda.SingletonFunction(this, 'CustomResourceHandler', {
uuid: this.renderSingletonUuid(props.memoryLimit),
code: lambda.Code.fromAsset(path.join(__dirname, '../lambda'), {
assetHashType: AssetHashType.SOURCE, // see https://github.com/aws/aws-cdk/pull/12984
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TRANTANKHOA What will happen if I don't set this? I don't really get it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find cdk keeps rebuilding the lambda image on repeated builds, which is similar to the issue mentioned. I think change the hashType should fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, I've tried your stack and the go lambda failed for me with error fork/exec /var/task/main: permission denied: PathError null. Do you have a hint why that is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll merge this PR firstly. And Please verify if this can solve your problem. @TRANTANKHOA

Copy link
Contributor

@wchaws wchaws Apr 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TRANTANKHOA Can you give me a sample repo of how you write your stack? And which region did u deploy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine. Thanks @wchaws ! I'll work it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants