Skip to content

aws-cdk-lib/aws-sagemaker: CfnApp #/AppType: CodeEditor is not a valid enum value #34223

Open
@mikevoets

Description

@mikevoets

Describe the bug

I noted that in the CloudFormation documentation, 'CodeEditor' is not a valid type for AppType: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-app.html#cfn-sagemaker-app-apptype. However, when I look up existing apps for my domain with AWS CLI (configured with click-ops), it does return my app with AppType 'CodeEditor'.

{
    "Apps": [
        {
            "DomainId": "d-u0oecosdfsf",
            "SpaceName": "code-editor-mike",
            "AppType": "CodeEditor",
            "AppName": "default",
            "Status": "InService",
            "CreationTime": "2025-04-22T07:24:35.004000+12:00",
            "ResourceSpec": {
                "SageMakerImageArn": "arn:aws:sagemaker:us-east-1:885854791233:image/sagemaker-distribution-cpu",
                "SageMakerImageVersionAlias": "2.4.1",
                "InstanceType": "ml.t3.medium"
            }
        }
    ]
}

When I declare this app via CDK, it throws an error.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

I expect CodeEditor to be a valid enum type, and CDK to create the app.

Current Behavior

_ToolkitError: The stack named dev-sagemaker-ai-stack failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Properties validation failed for resource SagemakerCodeEditorApp with message:
[#/AppType: CodeEditor is not a valid enum value]

Reproduction Steps

Deploy the following with CDK:

const domain: CfnDomain;
const userProfile: CfnUserProfile;

new CfnApp(this, 'SagemakerCodeEditorApp', {
  appName: 'CodeEditor',
  domainId: domain.attrDomainId,
  userProfileName: userProfile.userProfileName,
  appType: 'CodeEditor',
  resourceSpec: {
    instanceType: 'ml.t3.medium',
    sageMakerImageArn: `arn:aws:sagemaker:us-east-1:885854791233:image/sagemaker-distribution-cpu`,
  },
});

Possible Solution

Add CodeEditor to possible types of the AppType enum.

Additional Information/Context

No response

CDK CLI Version

2.1007.0

Framework Version

No response

Node.js Version

v22.10.0

OS

macOS Sequioa Version 15.3.2 (24D81)

Language

TypeScript

Language Version

5.6.3

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions