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_sagemaker.CfnDomain.UserSettingsProperty: studio_web_portal and default_landing_uri parameters #28340

Closed
csotomon opened this issue Dec 12, 2023 · 6 comments
Labels
@aws-cdk/aws-sagemaker Related to AWS SageMaker @aws-cdk/cfnspec bug This issue is a bug. effort/medium Medium work item – several days of effort needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@csotomon
Copy link

Describe the bug

Hi, we are trying to create a Sagemaker Domain with the new Sagemaker Studio UI experience with the following code:

sagemaker_domain = aws_sagemaker.CfnDomain(self,
                                                   id=domain_config['name'],
                                                   domain_name=f'{config["projectName"]}-{domain_config["name"]}-domain',
                                                   vpc_id=domain_config['vpcId'],
                                                   subnet_ids=domain_config['subnetIds'],
                                                   app_network_access_type="VpcOnly",
                                                   auth_mode='IAM',
                                                   default_user_settings=aws_sagemaker.CfnDomain.UserSettingsProperty(
                                                       execution_role=execution_role.role_arn,
                                                       studio_web_portal="ENABLED",
                                                       default_landing_uri="studio::"
                                                   )
                                       )

if I run the cdk diff command, the cloudformation templates is rendered without problems. Here is the generated template

{
    "sagemaker": {
        "Type": "AWS::SageMaker::Domain",
        "Properties": {
            "AppNetworkAccessType": "VpcOnly",
            "AuthMode": "IAM",
            "DefaultUserSettings": {
                "DefaultLandingUri": "studio::",
                "ExecutionRole": {
                    "Fn::GetAtt": [
                        "rolesagemakerdomain716A4613",
                        "Arn"
                    ]
                },
                "StudioWebPortal": "ENABLED"
            },
            "DomainName": "lla-tst-mul-dev-sagemaker-domain",
            "SubnetIds": [
                "subnet-123",
                "subnet-456"
            ],
            "Tags": [],
            "VpcId": "vpc-04123"
        },
        "Metadata": {
            "aws:cdk:path": "tst-mul-dev-MlSkeletonStack/sagemaker"
        }
    }
}

But when we try to deploy the changes, the deployment process fails with this error:

$ cdk deploy

✨  Synthesis time: 5.9s

lla-tst-mul-dev-MlSkeletonStack: deploying... [1/1]
lla-tst-mul-dev-MlSkeletonStack: creating CloudFormation changeset...
1:29:32 PM | CREATE_FAILED        | AWS::SageMaker::Domain         | sagemaker
Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted


 ❌  tst-mul-dev-MlSkeletonStack failed: Error: The stack named ltst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/usr/lib/node_modules/aws-cdk/lib/index.js:421:10708)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/usr/lib/node_modules/aws-cdk/lib/index.js:424:180229)
    at async /usr/lib/node_modules/aws-cdk/lib/index.js:424:163477

 ❌ Deployment failed: Error: The stack named tst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/usr/lib/node_modules/aws-cdk/lib/index.js:421:10708)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/usr/lib/node_modules/aws-cdk/lib/index.js:424:180229)
    at async /usr/lib/node_modules/aws-cdk/lib/index.js:424:163477

The stack named tst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted

Expected Behavior

A Sagemaker domain with the new Studio UI Experencie

Current Behavior

$ cdk deploy

✨  Synthesis time: 5.9s

lla-tst-mul-dev-MlSkeletonStack: deploying... [1/1]
lla-tst-mul-dev-MlSkeletonStack: creating CloudFormation changeset...
1:29:32 PM | CREATE_FAILED        | AWS::SageMaker::Domain         | sagemaker
Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted


 ❌  tst-mul-dev-MlSkeletonStack failed: Error: The stack named ltst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/usr/lib/node_modules/aws-cdk/lib/index.js:421:10708)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/usr/lib/node_modules/aws-cdk/lib/index.js:424:180229)
    at async /usr/lib/node_modules/aws-cdk/lib/index.js:424:163477

 ❌ Deployment failed: Error: The stack named tst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted
    at FullCloudFormationDeployment.monitorDeployment (/usr/lib/node_modules/aws-cdk/lib/index.js:421:10708)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.deployStack2 [as deployStack] (/usr/lib/node_modules/aws-cdk/lib/index.js:424:180229)
    at async /usr/lib/node_modules/aws-cdk/lib/index.js:424:163477

The stack named tst-mul-dev-MlSkeletonStack failed to deploy: UPDATE_ROLLBACK_COMPLETE: Properties validation failed for resource sagemaker with message:
#/DefaultUserSettings: extraneous key [StudioWebPortal] is not permitted
#/DefaultUserSettings: extraneous key [DefaultLandingUri] is not permitted

Reproduction Steps

from aws_cdk import (aws_sagemaker)

sagemaker_domain = aws_sagemaker.CfnDomain(self,
                                                   id=domain_config['name'],
                                                   domain_name=f'{config["projectName"]}-{domain_config["name"]}-domain',
                                                   vpc_id=domain_config['vpcId'],
                                                   subnet_ids=domain_config['subnetIds'],
                                                   app_network_access_type="VpcOnly",
                                                   auth_mode='IAM',
                                                   default_user_settings=aws_sagemaker.CfnDomain.UserSettingsProperty(
                                                       execution_role=execution_role.role_arn,
                                                       studio_web_portal="ENABLED",
                                                       default_landing_uri="studio::"
                                                   )
                                       )

Possible Solution

No response

Additional Information/Context

Checking the cloudformation documentacion the AWS::SageMaker::Domain UserSettings doesn't have that parameters.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html

CDK CLI Version

2.114.1

Framework Version

2.114.1

Node.js Version

v18.17.0

OS

Ubuntu 20.04.6 LTS

Language

Python

Language Version

3.10

Other information

No response

@csotomon csotomon added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2023
@github-actions github-actions bot added the @aws-cdk/aws-sagemaker Related to AWS SageMaker label Dec 12, 2023
@pahud pahud self-assigned this Dec 12, 2023
@pahud pahud added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2023
@pahud pahud removed their assignment Dec 12, 2023
@pahud
Copy link
Contributor

pahud commented Dec 12, 2023

I will investigate this as there seems to be something wrong from the upstream CFN spec.

If you look at the CFN doc https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html those properties actually are not available.

@pahud pahud added needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. @aws-cdk/cfnspec investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Dec 12, 2023
@pahud pahud self-assigned this Dec 12, 2023
@pahud
Copy link
Contributor

pahud commented Dec 12, 2023

ticket: V1153968204

@pahud
Copy link
Contributor

pahud commented Dec 19, 2023

Hi @csotomon

I've seen the doc has been updated and the missing keys including StudioWebPortal and DefaultLandingUri are added.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-domain-usersettings.html

Can you deploy again and see if this issue still exists?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-review labels Dec 19, 2023
@pahud pahud removed their assignment Dec 19, 2023
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.

@csotomon
Copy link
Author

@pahud , thank U

@pahud
Copy link
Contributor

pahud commented Dec 20, 2023

@csotomon Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-sagemaker Related to AWS SageMaker @aws-cdk/cfnspec bug This issue is a bug. effort/medium Medium work item – several days of effort needs-cfn This issue is waiting on changes to CloudFormation before it can be addressed. p1 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