将 ModifyWorkspaceCreationProperties 与 CLI 配合使用 - AWS SDK 代码示例

AWS 文档 SDK 示例 GitHub 存储库中还有更多 AWS SDK 示例。

ModifyWorkspaceCreationProperties 与 CLI 配合使用

以下代码示例演示如何使用 ModifyWorkspaceCreationProperties

CLI
AWS CLI

修改目录 WorkSpace 创建属性

以下 modify-workspace-creation-properties 示例为指定目录启用 EnableInternetAccess 属性。这样可以针对为目录创建的 WorkSpaces 自动分配公共 IP 地址。

aws workspaces modify-workspace-creation-properties \ --resource-id d-926722edaf \ --workspace-creation-properties EnableInternetAccess=true

此命令不生成任何输出。

有关更多信息,请参阅《Amazon WorkSpaces 管理指南》中的更新 WorkSpaces 的目录详细信息

PowerShell
Tools for PowerShell V4

示例 1:此示例支持在创建工作空间时将互联网访问和维护模式设置为 true 作为默认值

Edit-WKSWorkspaceCreationProperty -Region us-west-2 -ResourceId d-123454a369 -WorkspaceCreationProperties_EnableInternetAccess $true -WorkspaceCreationProperties_EnableMaintenanceMode $true
Tools for PowerShell V5

示例 1:此示例支持在创建工作空间时将互联网访问和维护模式设置为 true 作为默认值

Edit-WKSWorkspaceCreationProperty -Region us-west-2 -ResourceId d-123454a369 -WorkspaceCreationProperties_EnableInternetAccess $true -WorkspaceCreationProperties_EnableMaintenanceMode $true