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

aws-lambda: LoggingConfig is not supported in us-gov-east-1. #29227

Closed
ssshahri opened this issue Feb 23, 2024 · 7 comments
Closed

aws-lambda: LoggingConfig is not supported in us-gov-east-1. #29227

ssshahri opened this issue Feb 23, 2024 · 7 comments
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@ssshahri
Copy link

Describe the bug

Even after building in release v2.125.0, I still see this issue when trying to create Lambda.

Resource handler returned message: "LoggingConfig is not supported in us-gov-east-1. Remove LoggingConfig value from your request and try again (Service: Lambda, Status Code: 400, Request ID: 3ac89cff-8a9c-4d23-845b-790cb1069268)" (RequestToken: ba4e6739-c3ea-10b0-4dc3-8d1fd0b2583d, HandlerErrorCode: InvalidRequest)

Expected Behavior

We've built in new release, and don't specify LoggingConfig on creation of Lambda so not sure why we're still seeing this error.

Current Behavior

Error in stack creation

Resource handler returned message: "LoggingConfig is not supported in us-gov-east-1. Remove LoggingConfig value from your request and try again (Service: Lambda, Status Code: 400, Request ID: 3ac89cff-8a9c-4d23-845b-790cb1069268)" (RequestToken: ba4e6739-c3ea-10b0-4dc3-8d1fd0b2583d, HandlerErrorCode: InvalidRequest)

Reproduction Steps

N/A

Possible Solution

No response

Additional Information/Context

AWS Internal Slack Message with more details: https://amzn-wwc.slack.com/archives/C01853SDU7N/p1708647464531339

Similar issue: #28919
Original fix: #28934

CDK CLI Version

^2.125.0

Framework Version

No response

Node.js Version

18.x

OS

N/A

Language

TypeScript

Language Version

Typescript ~4.5.5

Other information

No response

@ssshahri ssshahri added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2024
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Feb 23, 2024
@ssshahri
Copy link
Author

ssshahri commented Feb 23, 2024

I think we might be specifying some kind of log configuration via a custom resource. Not able to get help here considering I can't link internal amazon code. Closing out.

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.

@ssshahri ssshahri reopened this Feb 23, 2024
@ssshahri
Copy link
Author

ssshahri commented Feb 23, 2024

re-opening and providing some sample pseudo code, to show we don't use Log configs in our Lambda CustomProvider

        const onEventHandler = new lambda.Function(this,
            `{lambdaName}-${stackSuffix}`,
            {
                runtime: lambda.Runtime.NODEJS_12_X,
                code: lambdaHandlerCode,
                handler: props.onEventHandler,
                vpc: Vpc,
                timeout: cdk.Duration.seconds(30)
            });

        const isCompleteHandler = new lambda.Function(this,
            `{LambdaName}-${stackSuffix}`,
            {
                runtime: lambda.Runtime.NODEJS_12_X,
                code: lambdaHanlderCode,
                handler: props.isCompleteHandler,
                vpc: Vpc,
                timeout: cdk.Duration.minutes(1)
            });

        const provider = new cr.Provider(this,
            `Provider-${stackSuffix}`,
            {
                onEventHandler: onEventHandler,
                isCompleteHandler: isCompleteHandler,
                queryInterval: cdk.Duration.minutes(2),
                totalTimeout: cdk.Duration.minutes(60)
            });

const customResource = new cdk.CustomResource(
            this,
            `customResource-${(new Date()).toLocaleString()}`,
            {
                serviceToken: provider.serviceToken,
                properties: {
                    ...bunch of properties
                }
            })

@ssshahri
Copy link
Author

Just looked at a template in non-us-gov region and found that there was LoggingConfig there. If I don't specify in my CDK code, that means it's auto-generated in template right? How do I avoid getting this error?

@pahud
Copy link
Contributor

pahud commented Feb 23, 2024

I think it should have been reverted #28934

I am using 2.130.0 now and my code like

export class DummyStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps) {
    super(scope, id, props);

    const stackSuffix = 'foo';
    const dummyFunction = getLambdaFunction(this);

    const provider = new cr.Provider(this,
      `Provider-${stackSuffix}`,
      {
          onEventHandler: dummyFunction,
          isCompleteHandler: dummyFunction,
          queryInterval: Duration.minutes(2),
          totalTimeout: Duration.minutes(60)
      });

    const customResource = new CustomResource(
      this,
      `customResource-${(new Date()).toLocaleString()}`,
      {
          serviceToken: provider.serviceToken,
      })
  }
}

I didn't see LoggingConfig when I cdk synth.

Feel free to ping me internally if you need any check.

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2024
@ssshahri
Copy link
Author

Ok apologies, I was looking at old commit, we recently pushed commit that used LogGroup on customProvider. Writing in conditional to fix.

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/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants