terraform-aws-arc-workspace¶
Overview¶
SourceFuse AWS Reference Architecture (ARC) Terraform module for managing Workspaces.
Usage¶
To see a Microsoft AD example, check out the main.tf file in the example folder.
To see a AD Connector example, check out the main.tf file in the example folder.
customer_dns_ips
and customer_username
which is required for ADConnector but not required for AWS Managed Microsoft-AD
IMPORTANT NOTE¶
For user_names attribute which is shown in example. There are two approaches you can follow 1. If you want to create custom user_names so you have to first run terraform apply and then create custom user names in workspace manually and specify here that username and re-run tf apply so that workspace with custom-username gets created with appropriate configuration.
-
By default you can specify Administrators , Admins here which are default in directory and that will create workspace
-
if you specify custom user_names which can be any number make sure if you specify, lets say 5 custom user_names then terraform will create 5 workspaces for each user.
-
custom user_names need to be created manually as mentioned in 1st point as there is no functionality in terraform to achieve this as of now.
-
if you leave user_names attribute empty then no workspace will get created , only directory will get created and iam-roles etc.
-
example to specify custom user_names
As we specified three custom user_names that means three workspaces for each user will get created -
Last thing but not the least and this is very important that if you are trying to deploy in us-east-1 then below AZs are supported. When you are creating a virtual private cloud (VPC) for use with Amazon WorkSpaces, your VPC's subnets must reside in different Availability Zones in the Region where you're launching WorkSpaces. Availability Zones are distinct locations that are engineered to be isolated from failures in other Availability Zones. By launching instances in separate Availability Zones, you can protect your applications from the failure of a single location. Each subnet must reside entirely within one Availability Zone and cannot span zones. Here is the picture of supported Availability Zones For Workspaces.
Requirements¶
Name | Version |
---|---|
terraform | >= 1.5, < 2.0.0 |
aws | >= 4.0, < 6.0 |
random | ~> 3.0 |
Providers¶
Name | Version |
---|---|
aws | 5.17.0 |
random | 3.5.1 |
Modules¶
No modules.
Resources¶
Name | Type |
---|---|
aws_directory_service_directory.ADConnector | resource |
aws_directory_service_directory.microsoftAD | resource |
aws_iam_role.workspaces_default | resource |
aws_iam_role_policy_attachment.workspaces_default_self_service_access | resource |
aws_iam_role_policy_attachment.workspaces_default_service_access | resource |
aws_security_group.workspace | resource |
aws_ssm_parameter.ad_connector_password | resource |
aws_ssm_parameter.ad_password | resource |
aws_workspaces_directory.directory_ADConnector | resource |
aws_workspaces_directory.directory_microsoftAD | resource |
aws_workspaces_ip_group.nat | resource |
aws_workspaces_workspace.workspace | resource |
random_password.ad_connector_password | resource |
random_password.ad_password | resource |
aws_iam_policy_document.workspaces | data source |
aws_workspaces_bundle.bundle | data source |
Inputs¶
Name | Description | Type | Default | Required |
---|---|---|---|---|
bundle_id | The ID of the bundle to use for the workspaces. | string |
null |
no |
customer_dns_ips | Connect settings for ADConnector. | list(string) |
[] |
no |
customer_username | Connect settings for ADConnector. | string |
"" |
no |
directory_name | must be a fully qualified domain name and cannot end with a trailing period | string |
"poc.woebothealth.com" |
no |
directory_size | The size of the directory (Small or Large are accepted values). Large by default. | string |
"Small" |
no |
directory_type | Type of the directory service (MicrosoftAD or ADConnector). | string |
"MicrosoftAD" |
no |
egress_rules | List of egress rules | list(object({ |
[ |
no |
iam_role_name | workspace iam-role-name | string |
"workspaces_DefaultRole" |
no |
ingress_rules | List of ingress rules | list(object({ |
[ |
no |
ip_group_description | Description of the IP access control group | string |
"nat-gateway-ip-list control group" |
no |
ip_group_name | Name of the IP access control group | string |
"nat-gateway-ip-list" |
no |
ip_rules | List of IP rules | list(object({ |
[] |
no |
region | AWS region | string |
"us-west-2" |
no |
security_group_description | Description of the security group | string |
"My security group description" |
no |
security_group_name | Name of the security group | string |
"workspace-SG" |
no |
self_service_permissions | Self-service permissions configuration. | object({ |
{ |
no |
ssm_ad_connector_parameter_name | ssm parameter name for microsoft AD | string |
"/workspace/Connector/password" |
no |
ssm_parameter_name | ssm parameter name for microsoft AD | string |
"/workspace/microsoft-ad/password" |
no |
subnet_ids | private subnet_ids | list(string) |
n/a | yes |
tags | tags to add to your resources | map(string) |
n/a | yes |
user_names | List of usernames to create workspaces for | map(string) |
{} |
no |
volume_encryption_key | encryption key | string |
"" |
no |
vpc_id | default vpc | string |
n/a | yes |
workspace_access_properties | Workspace access properties configuration. | object({ |
{ |
no |
workspace_creation_properties | Workspace creation properties configuration. | object({ |
{ |
no |
workspace_properties | Workspace properties configuration. | object({ |
{ |
no |
workspaces_self_service_access_arn | workspaces self service access from aws | string |
n/a | yes |
workspaces_service_access_arn | workspaces service access from aws | string |
n/a | yes |
Outputs¶
Name | Description |
---|---|
workspace_bundle_id | The ID of the AWS Workspaces bundle. |
workspace_directory_id | The ID of the AWS Workspaces directory. |
workspace_properties | The properties of the AWS Workspaces. |
workspace_root_volume_encryption_enabled | Whether root volume encryption is enabled for the AWS Workspaces. |
workspace_user_name | The username of the AWS Workspaces user. |
workspace_user_volume_encryption_enabled | Whether user volume encryption is enabled for the AWS Workspaces. |
workspace_volume_encryption_key | The encryption key used for AWS Workspaces volumes. |
Git commits¶
while Contributing or doing git commit please specify the breaking change in your commit message whether its major,minor or patch
For Example
Development¶
Prerequisites¶
Configurations¶
- Configure pre-commit hooks
Tests¶
- Tests are available in
test
directory - Configure the dependencies
- Now execute the test
Authors¶
This project is authored by: - SourceFuse ARC Team