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

(custom-resources): singleton function runtime out of date #20426

Closed
maclema opened this issue May 19, 2022 · 2 comments
Closed

(custom-resources): singleton function runtime out of date #20426

maclema opened this issue May 19, 2022 · 2 comments
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@maclema
Copy link

maclema commented May 19, 2022

Describe the bug

The AwsCustomResource construct uses an out-of-date Lambda runtime.

Line: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts#L373

Expected Behavior

Should use latest NodeJS version.

Current Behavior

Uses old Node JS version.

Reproduction Steps

import * as cdk from "@aws-cdk/core";
import * as cr from "@aws-cdk/custom-resources";
import { Aspects } from "@aws-cdk/core";
import { AwsSolutionsChecks, NagSuppressions } from "cdk-nag";
// import * as sqs from '@aws-cdk/aws-sqs';

export class CrTestStack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    const mycr = new cr.AwsCustomResource(this, "test", {
      policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
        resources: ["s3"]
      }),
      onCreate: {
        action: "PutObject",
        service: "s3",
        physicalResourceId: cr.PhysicalResourceId.of("hi")
      }
    });

    // FAILS cdk-nag
    Aspects.of(this).add(new AwsSolutionsChecks());
  }
}

Possible Solution

Update runtime version.

Additional Information/Context

No response

CDK CLI Version

1.156.1

Framework Version

No response

Node.js Version

v18.0.0

OS

Mac

Language

Typescript

Language Version

No response

Other information

No response

@maclema maclema added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 19, 2022
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label May 19, 2022
@kaizencc kaizencc changed the title AwsCustomResource: Lambda function runtime out of date (custom-resources): singleton function runtime out of date May 20, 2022
@kaizencc kaizencc added @aws-cdk/custom-resources Related to AWS CDK Custom Resources and removed @aws-cdk/aws-lambda Related to AWS Lambda labels May 20, 2022
@kaizencc kaizencc added p1 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels May 20, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented May 25, 2022

Duplicate of #19992

@rix0rrr rix0rrr marked this as a duplicate of #19992 May 25, 2022
@rix0rrr rix0rrr closed this as completed May 25, 2022
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/custom-resources Related to AWS CDK Custom Resources bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

No branches or pull requests

3 participants