Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

CDK deploy fails: duplicate CloudWatch log group (/aws/lambda/websearch-lambda already exists)

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, python
Domain
cloud, devops

Research direction

Start with README.md and reproduce the failure using cdk deploy. Compare the CloudFormation resources WebSearchLogGroupD9C96826 and WebSearchLogGroup40A38A8A, tracing why both resolve to /aws/lambda/websearch-lambda. Done means the deployment creates distinct intended log groups without the duplicate-resource failure.

Written by the indexing model from the issue text.

Description

Dear contributors (@philikai, @rollwagen, @amazon-auto),

I tried deploying the WebSearch Agent (v2) following the steps described in the README.md.

After completing all prerequisites, I checked in AWS CloudWatch console that no Log group is defined. Then I ran:

cdk deploy

Environment:

  • OS: Windows 11
  • Python: 3.12.7
  • AWS CLI: 2.31.11
  • CDK: 2.1031.0

The deployment fails during the creation of the CloudWatch log groups, as shown in the log below.

  1. The log group WebSearchLogGroup is successfully created with logical ID WebSearchLogGroupD9C96826.
  2. In the AWS CloudWatch console, its corresponding name is: /aws/lambda/websearch-lambda.
  3. Later in the deployment, another log group named WebSearch/LogGroup (logical ID WebSearchLogGroup40A38A8A) is attempted.
  4. The deployment then fails with the following error: /aws/lambda/websearch-lambda already exists, indicating both log groups map to the same CloudWatch name.

I spent quite some time debugging this but couldn’t resolve the issue. Could you please advise what might be wrong or if this is a known configuration conflict?

Thank you for your help.

Best regards.

WebSearchAgentStack-v2: creating CloudFormation changeset...
WebSearchAgentStack-v2 | 0/20 | 4:47:31 PM | REVIEW_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 User Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:37 PM | CREATE_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 User Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) 👈
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47)
WebSearchAgentStack-v2 | 0/20 | 4:47:40 PM | CREATE_IN_PROGRESS | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393)
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) Resource creation Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588) Resource creation Initiated
WebSearchAgentStack-v2 | 0/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_COMPLETE | AWS::CDK::Metadata | CDKMetadata/Default (CDKMetadata)
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:41 PM | CREATE_IN_PROGRESS | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281) Resource creation Initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:50 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588) Eventual consistency check initiated
WebSearchAgentStack-v2 | 1/20 | 4:47:50 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) Eventual consistency check initiated
WebSearchAgentStack-v2 | 2/20 | 4:47:50 PM | CREATE_COMPLETE | AWS::Logs::LogGroup | AdvancedWebSearchLogGroup (AdvancedWebSearchLogGroup9033C588)
WebSearchAgentStack-v2 | 3/20 | 4:47:50 PM | CREATE_COMPLETE | AWS::Logs::LogGroup | WebSearchLogGroup (WebSearchLogGroupD9C96826) ✅
WebSearchAgentStack-v2 | 3/20 | 4:47:54 PM | CREATE_IN_PROGRESS | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393) Resource creation Initiated
WebSearchAgentStack-v2 | 4/20 | 4:47:55 PM | CREATE_COMPLETE | AWS::Lambda::LayerVersion | WebSearchLambdaLayers/WebSearchAgentStack-v2-project-dependencies-layer (WebSearchLambdaLayersWebSearchAgentStackv2projectdependencieslayer87E63393)
WebSearchAgentStack-v2 | 5/20 | 4:47:59 PM | CREATE_COMPLETE | AWS::IAM::Role | AmazonBedrockExecutionRoleForAgents (AmazonBedrockExecutionRoleForAgents8FB4CD47)
WebSearchAgentStack-v2 | 6/20 | 4:48:00 PM | CREATE_COMPLETE | AWS::IAM::Role | WebSearchLambdaRole (WebSearchLambdaRoleBB6EC993)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_COMPLETE | AWS::IAM::Role | AdvancedWebSearchLambdaRole (AdvancedWebSearchLambdaRoleBEF4C281)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89)
WebSearchAgentStack-v2 | 7/20 | 4:48:00 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897)
WebSearchAgentStack-v2 | 7/20 | 4:48:01 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6)
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:02 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897) Resource creation Initiated
WebSearchAgentStack-v2 | 7/20 | 4:48:03 PM | CREATE_IN_PROGRESS | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6) Resource creation Initiated
WebSearchAgentStack-v2 | 8/20 | 4:48:17 PM | CREATE_COMPLETE | AWS::IAM::Policy | WebSearchLambdaRole/DefaultPolicy (WebSearchLambdaRoleDefaultPolicyF4844A89)
WebSearchAgentStack-v2 | 9/20 | 4:48:17 PM | CREATE_COMPLETE | AWS::IAM::Policy | AgentPolicy (AgentPolicyEF976063)
WebSearchAgentStack-v2 | 10/20 | 4:48:18 PM | CREATE_COMPLETE | AWS::IAM::Policy | AdvancedWebSearchLambdaRole/DefaultPolicy (AdvancedWebSearchLambdaRoleDefaultPolicy922CE897)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_COMPLETE | AWS::IAM::Policy | LambdaPolicy (LambdaPolicy7FF67BE6)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428)
WebSearchAgentStack-v2 | 11/20 | 4:48:19 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2)
WebSearchAgentStack-v2 | 11/20 | 4:48:20 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428) Resource creation Initiated
WebSearchAgentStack-v2 | 11/20 | 4:48:21 PM | CREATE_IN_PROGRESS | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2) Resource creation Initiated
WebSearchAgentStack-v2 | 12/20 | 4:48:28 PM | CREATE_COMPLETE | AWS::Lambda::Function | WebSearch (WebSearchAD7A9428)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_COMPLETE | AWS::Lambda::Function | AdvancedWebSearch (AdvancedWebSearchCB05C1A2)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_IN_PROGRESS | AWS::Logs::LogGroup | WebSearch/LogGroup (WebSearchLogGroup40A38A8A) 👈
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_IN_PROGRESS | AWS::Lambda::Permission | WebSearch/WebSearchLambdaResourcePolicyAgentsInvokeFunction (WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49)
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_FAILED | AWS::Logs::LogGroup | WebSearch/LogGroup (WebSearchLogGroup40A38A8A) /aws/lambda/websearch-lambda already exists in stack arn:aws:cloudformation: ... ❌
WebSearchAgentStack-v2 | 13/20 | 4:48:29 PM | CREATE_FAILED | AWS::Lambda::Permission | WebSearch/WebSearchLambdaResourcePolicyAgentsInvokeFunction (WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49) Resource creation cancelled
WebSearchAgentStack-v2 | 13/20 | 4:48:30 PM | ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | WebSearchAgentStack-v2 The following resource(s) failed to create: [WebSearchLogGroup40A38A8A, WebSearchWebSearchLambdaResourcePolicyAgentsInvokeFunctionE4068E49]. Rollback requested by user.

Dominant language
Python
Stars
22
Forks
3
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.