Skip to content

update_domain async

update_domain(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional[DomainId] = None,
    default_user_settings: Optional[UserSettings] = None,
    domain_settings_for_update: Optional[DomainSettingsForUpdate] = None,
    app_security_group_management: Optional[AppSecurityGroupManagement] = None,
    default_space_settings: Optional[DefaultSpaceSettings] = None,
    subnet_ids: Optional[Subnets] = None,
    app_network_access_type: Optional[AppNetworkAccessType] = None,
    tag_propagation: Optional[TagPropagation] = None,
    home_efs_file_system_creation: Optional[HomeEfsFileSystemCreation] = None,
    vpc_id: Optional[VpcId] = None,
) -> UpdateDomainResponse

Updates the default settings for new user profiles in the domain.

Parameters:

  • domain_id (Optional[DomainId], default: None ) –

    The ID of the domain to be updated.

  • default_user_settings (Optional[UserSettings], default: None ) –

    A collection of settings.

  • domain_settings_for_update (Optional[DomainSettingsForUpdate], default: None ) –

    A collection of DomainSettings configuration values to update.

  • app_security_group_management (Optional[AppSecurityGroupManagement], default: None ) –

    The entity that creates and manages the required security groups for inter-app communication in VPCOnly mode. Required when CreateDomain.AppNetworkAccessType is VPCOnly and DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is provided. If setting up the domain for use with RStudio, this value must be set to Service.

  • default_space_settings (Optional[DefaultSpaceSettings], default: None ) –

    The default settings for shared spaces that users create in the domain.

  • subnet_ids (Optional[Subnets], default: None ) –

    The VPC subnets that Studio uses for communication.

    If removing subnets, ensure there are no apps in the InService, Pending, or Deleting state.

  • app_network_access_type (Optional[AppNetworkAccessType], default: None ) –

    Specifies the VPC used for non-EFS traffic.

    • PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access.

    • VpcOnly - All Studio traffic is through the specified VPC and subnets.

    This configuration can only be modified if there are no apps in the InService, Pending, or Deleting state. The configuration cannot be updated if DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is already set or DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is provided as part of the same request.

  • tag_propagation (Optional[TagPropagation], default: None ) –

    Indicates whether custom tag propagation is supported for the domain. Defaults to DISABLED.

  • home_efs_file_system_creation (Optional[HomeEfsFileSystemCreation], default: None ) –

    Indicates whether to create a home EFS file system for the domain. You can change from Disabled to Enabled to provision EFS on demand, but you cannot change from Enabled to Disabled.

  • vpc_id (Optional[VpcId], default: None ) –

    The identifier for the VPC used by the domain for network communication. Use this field only when adding VPC configuration to a SageMaker AI domain used in Amazon SageMaker Unified Studio that was created without VPC settings. SageMaker AI doesn't automatically apply VPC updates to existing applications. Stop and restart your applications to apply the changes.

Raises:

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def update_domain(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional["capo_sagemaker.types.domain_id.DomainId"] = None,
    default_user_settings: Optional[
        "capo_sagemaker.types.user_settings.UserSettings"
    ] = None,
    domain_settings_for_update: Optional[
        "capo_sagemaker.types.domain_settings_for_update.DomainSettingsForUpdate"
    ] = None,
    app_security_group_management: Optional[
        "capo_sagemaker.types.app_security_group_management.AppSecurityGroupManagement"
    ] = None,
    default_space_settings: Optional[
        "capo_sagemaker.types.default_space_settings.DefaultSpaceSettings"
    ] = None,
    subnet_ids: Optional["capo_sagemaker.types.subnets.Subnets"] = None,
    app_network_access_type: Optional[
        "capo_sagemaker.types.app_network_access_type.AppNetworkAccessType"
    ] = None,
    tag_propagation: Optional[
        "capo_sagemaker.types.tag_propagation.TagPropagation"
    ] = None,
    home_efs_file_system_creation: Optional[
        "capo_sagemaker.types.home_efs_file_system_creation.HomeEfsFileSystemCreation"
    ] = None,
    vpc_id: Optional["capo_sagemaker.types.vpc_id.VpcId"] = None,
) -> "capo_sagemaker.types.update_domain_response.UpdateDomainResponse":
    """<p>Updates the default settings for new user profiles in the domain.</p>

    Args:
        domain_id: <p>The ID of the domain to be updated.</p>
        default_user_settings: <p>A collection of settings.</p>
        domain_settings_for_update: <p>A collection of <code>DomainSettings</code> configuration values to update.</p>
        app_security_group_management: <p>The entity that creates and manages the required security groups for inter-app communication in <code>VPCOnly</code> mode. Required when <code>CreateDomain.AppNetworkAccessType</code> is <code>VPCOnly</code> and <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is provided. If setting up the domain for use with RStudio, this value must be set to <code>Service</code>.</p>
        default_space_settings: <p>The default settings for shared spaces that users create in the domain.</p>
        subnet_ids: <p>The VPC subnets that Studio uses for communication.</p> <p>If removing subnets, ensure there are no apps in the <code>InService</code>, <code>Pending</code>, or <code>Deleting</code> state.</p>
        app_network_access_type: <p>Specifies the VPC used for non-EFS traffic.</p> <ul> <li> <p> <code>PublicInternetOnly</code> - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access.</p> </li> <li> <p> <code>VpcOnly</code> - All Studio traffic is through the specified VPC and subnets.</p> </li> </ul> <p>This configuration can only be modified if there are no apps in the <code>InService</code>, <code>Pending</code>, or <code>Deleting</code> state. The configuration cannot be updated if <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is already set or <code>DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn</code> is provided as part of the same request.</p>
        tag_propagation: <p>Indicates whether custom tag propagation is supported for the domain. Defaults to <code>DISABLED</code>.</p>
        home_efs_file_system_creation: <p>Indicates whether to create a home EFS file system for the domain. You can change from <code>Disabled</code> to <code>Enabled</code> to provision EFS on demand, but you cannot change from <code>Enabled</code> to <code>Disabled</code>.</p>
        vpc_id: <p>The identifier for the VPC used by the domain for network communication. Use this field only when adding VPC configuration to a SageMaker AI domain used in Amazon SageMaker Unified Studio that was created without VPC settings. SageMaker AI doesn't automatically apply VPC updates to existing applications. Stop and restart your applications to apply the changes.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_domain_request.UpdateDomainRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_domain_response.UpdateDomainResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_domain

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_domain.async_update_domain(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDomain")
    )
    input_: capo_sagemaker.types.update_domain_request.UpdateDomainRequest = {}
    if domain_id is not None:
        input_["domain_id"] = domain_id
    if default_user_settings is not None:
        input_["default_user_settings"] = default_user_settings
    if domain_settings_for_update is not None:
        input_["domain_settings_for_update"] = domain_settings_for_update
    if app_security_group_management is not None:
        input_["app_security_group_management"] = app_security_group_management
    if default_space_settings is not None:
        input_["default_space_settings"] = default_space_settings
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids
    if app_network_access_type is not None:
        input_["app_network_access_type"] = app_network_access_type
    if tag_propagation is not None:
        input_["tag_propagation"] = tag_propagation
    if home_efs_file_system_creation is not None:
        input_["home_efs_file_system_creation"] = home_efs_file_system_creation
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output