Skip to content

Hard-coded CDKToolkit stack name causes false bootstrap prompt #1799

Description

@pluralistix

Description

agentcore deploy checks for a CloudFormation stack named exactly CDKToolkit:

export const CDK_TOOLKIT_STACK_NAME = 'CDKToolkit';

new DescribeStacksCommand({
  StackName: CDK_TOOLKIT_STACK_NAME,
});

This breaks in environments where CDK bootstrap infrastructure is deployed centrally, for example through CloudFormation StackSets, which create stack names such as:

StackSet-CDKToolkit-9afdf51a-b1cf-4dfc-9b0c-63ccafe70cbc

The environment is already bootstrapped, but AgentCore still prompts:

Bootstrap AWS environment

In interactive mode, this prompt can be cancelled and deployment continues successfully. In CI/CD, there is no clean equivalent.

Expected behavior

AgentCore should support externally managed bootstrap infrastructure without assuming ownership of it.

A minimal fix would be:

agentcore deploy --skip-bootstrap-check

or a configuration option such as:

{
  "bootstrap": {
    "management": "external"
  }
}

In this mode, AgentCore must not:

  • require a stack named CDKToolkit
  • create bootstrap infrastructure
  • update existing bootstrap infrastructure
  • assume ownership of a detected bootstrap stack

Making the stack name configurable alone is not sufficient, because detection must not imply permission to manage that stack.

Steps to Reproduce

  1. Bootstrap an AWS account and region through CloudFormation StackSets

  2. Ensure the resulting bootstrap stack has a generated name, for example:

    StackSet-CDKToolkit-9afdf51a-b1cf-4dfc-9b0c-63ccafe70cbc
    
  3. Configure AgentCore to deploy to the same account and region.

  4. Run:

    agentcore deploy
  5. Observe that AgentCore prompts to bootstrap the AWS environment.

  6. Cancel the bootstrap prompt.

  7. Observe that the deployment continues successfully using the existing bootstrap infrastructure.

Expected Behavior

agentcore deploy should not report that bootstrapping is required when a usable CDK bootstrap environment already exists.

The bootstrap check should not depend exclusively on a CloudFormation stack named exactly CDKToolkit.

AgentCore should also provide a way to mark bootstrap infrastructure as externally managed, ensuring that the CLI does not attempt to create or update it.

Actual Behavior

agentcore deploy checks only for a CloudFormation stack named exactly CDKToolkit.

If the bootstrap infrastructure was provisioned through CloudFormation StackSets and the resulting stack has a generated name, AgentCore reports that the environment needs to be bootstrapped.

In interactive mode, the bootstrap prompt can be cancelled and the deployment continues successfully using the existing bootstrap infrastructure.

CLI Version

No response

Operating System

Linux

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions