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

F aws workspaces directory dedicated tenancy #33885

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion internal/service/workspaces/directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ func ResourceDirectory() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"dedicated_tenancy": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: false,
},
"dns_ip_addresses": {
Type: schema.TypeSet,
Elem: &schema.Schema{Type: schema.TypeString},
Expand Down Expand Up @@ -219,11 +225,15 @@ func resourceDirectoryCreate(ctx context.Context, d *schema.ResourceData, meta i
conn := meta.(*conns.AWSClient).WorkSpacesClient(ctx)

directoryID := d.Get("directory_id").(string)
directoryTenancy := types.TenancyShared
if d.Get("dedicated_tenancy").(bool) {
directoryTenancy = types.TenancyDedicated
}
input := &workspaces.RegisterWorkspaceDirectoryInput{
DirectoryId: aws.String(directoryID),
EnableSelfService: aws.Bool(false), // this is handled separately below
EnableWorkDocs: aws.Bool(false),
Tenancy: types.TenancyShared,
Tenancy: directoryTenancy,
Tags: getTagsIn(ctx),
}

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/workspaces_directory.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ This resource supports the following arguments:

* `directory_id` - (Required) The directory identifier for registration in WorkSpaces service.
* `subnet_ids` - (Optional) The identifiers of the subnets where the directory resides.
* `dedicated_tenancy` - (Optional) Whether the Workspaces directory will be running in a dedicated environment (required for BYOL Workspaces). Default `false`.
* `ip_group_ids` - The identifiers of the IP access control groups associated with the directory.
* `tags` – (Optional) A map of tags assigned to the WorkSpaces directory. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level.
* `self_service_permissions` – (Optional) Permissions to enable or disable self-service capabilities. Defined below.
Expand Down