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

Add support for creating Managed Microsoft Active Directory and Directory Connectors in AWS #4388

Conversation

jszwedko
Copy link
Contributor

This action is almost exactly the same as creating a SimpleAD so we
reuse this resource and allow the user to specify the type when creating
the directory (ignoring the size if the type is MicrosoftAD).

I also thought about overloading the size parameter to allow the specification of MicrosoftAD or Enterprise there, but using the type felt closer to the actual API.

@jszwedko
Copy link
Contributor Author

As an aside, are there downsides to marking these tests as t.Parallel()? The entire suite could probably benefit from this so I'm sure there are some reasons this hasn't been done. These tests in particular can take upwards of 10 minutes.

@jszwedko jszwedko force-pushed the add-support-for-aws-directory-service-microsoft-active-directory branch from fb6b4eb to 5d39511 Compare December 18, 2015 17:58
This action is almost exactly the same as creating a SimpleAD so we
reuse this resource and allow the user to specify the type when creating
the directory (ignoring the size if the type is MicrosoftAD).
@jszwedko jszwedko force-pushed the add-support-for-aws-directory-service-microsoft-active-directory branch from 5d39511 to 82fe67f Compare December 18, 2015 18:24
Computed: true,
Optional: true,
Default: "SimpleAD",
ForceNew: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider adding a ValidateFunc here in order to provide feedback as early as possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about ValidateFunc! Will do.

@jen20
Copy link
Contributor

jen20 commented Dec 18, 2015

Hi @jszwedko! Thanks for this - it looks good to me. I've left a comment inline on the diff, so if you could let me know your opinion on that it would be great. Thanks!

@jszwedko
Copy link
Contributor Author

@jen20 added ValidateFunc in jszwedko@6bf1011

According to the AWS docs, creating a MS directory could take up to 25
minutes.
@jszwedko jszwedko changed the title Add support for creating Managed Microsoft Active Directory in AWS Add support for creating Managed Microsoft Active Directory and Directory Connectors in AWS Dec 18, 2015
This adds support for creating AD Connectors. It is pretty close to the
same as creating AD and simple directories so we reuse the resource.
@jszwedko
Copy link
Contributor Author

Pushed another commit adding support for AD connectors since I was making changes in the area anyway. Let me know what you think though, I can split that one off into a separate pull request if needed, just wanted to start the conversation (and to avoid others duplicating work).

@jen20
Copy link
Contributor

jen20 commented Dec 18, 2015

Hi @jszwedko! This looks great! I'm going to pull it locally and run the acceptance tests but I don't see anything preventing this being merged currently.

@jen20
Copy link
Contributor

jen20 commented Dec 18, 2015

Actually looks like the acceptance tests are leaving dangling resources - need to investigate whether this is an issue with the changes or the original work:

$ make testacc TEST=./builtin/providers/aws TESTARGS="-run AWSDirectoryService"
==> Checking that code complies with gofmt requirements...
go generate ./...
TF_ACC=1 go test ./builtin/providers/aws -v -run AWSDirectoryService -timeout 90m
=== RUN TestAccAWSDirectoryServiceDirectory_basic
--- FAIL: TestAccAWSDirectoryServiceDirectory_basic (498.86s)
    testing.go:165: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Expected all resources to be gone, but found: map[string]*terraform.ResourceState{"aws_subnet.foo":*terraform.ResourceState{Type:"aws_subnet", Dependencies:[]string{"aws_vpc.main"}, Primary:*terraform.InstanceState{ID:"subnet-bb6767de", Attributes:map[string]string{"availability_zone":"us-west-2a", "map_public_ip_on_launch":"false", "tags.#":"0", "id":"subnet-bb6767de", "vpc_id":"vpc-e496aa81", "cidr_block":"10.0.1.0/24"}, Ephemeral:terraform.EphemeralState{ConnInfo:map[string]string{}}, Meta:map[string]string(nil)}, Tainted:[]*terraform.InstanceState(nil), Deposed:[]*terraform.InstanceState(nil), Provider:""}, "aws_directory_service_directory.bar":*terraform.ResourceState{Type:"aws_directory_service_directory", Dependencies:[]string{"aws_vpc.main", "aws_subnet.foo", "aws_subnet.bar"}, Primary:*terraform.InstanceState{ID:"d-9267380520", Attributes:map[string]string{"id":"d-9267380520", "vpc_settings.0.subnet_ids.2142165099":"subnet-b3f8dfc4", "type":"SimpleAD", "dns_ip_addresses.1043607771":"10.0.1.155", "size":"Small", "vpc_settings.0.subnet_ids.#":"2", "access_url":"d-9267380520.awsapps.com", "vpc_settings.0.vpc_id":"vpc-e496aa81", "vpc_settings.#":"1", "password":"SuperSecretPassw0rd", "name":"corp.notexample.com", "enable_sso":"false", "connect_settings.#":"0", "vpc_settings.0.subnet_ids.730190149":"subnet-bb6767de", "short_name":"corp", "dns_ip_addresses.2432167742":"10.0.2.153", "dns_ip_addresses.#":"2", "alias":"d-9267380520"}, Ephemeral:terraform.EphemeralState{ConnInfo:map[string]string{}}, Meta:map[string]string(nil)}, Tainted:[]*terraform.InstanceState(nil), Deposed:[]*terraform.InstanceState(nil), Provider:""}, "aws_vpc.main":*terraform.ResourceState{Type:"aws_vpc", Dependencies:[]string{}, Primary:*terraform.InstanceState{ID:"vpc-e496aa81", Attributes:map[string]string{"default_security_group_id":"sg-9b9ba1ff", "cidr_block":"10.0.0.0/16", "tags.#":"0", "main_route_table_id":"rtb-14232c71", "default_network_acl_id":"acl-6fdfe70a", "dhcp_options_id":"dopt-60f40f05", "id":"vpc-e496aa81"}, Ephemeral:terraform.EphemeralState{ConnInfo:map[string]string{}}, Meta:map[string]string(nil)}, Tainted:[]*terraform.InstanceState(nil), Deposed:[]*terraform.InstanceState(nil), Provider:""}, "aws_subnet.bar":*terraform.ResourceState{Type:"aws_subnet", Dependencies:[]string{"aws_vpc.main"}, Primary:*terraform.InstanceState{ID:"subnet-b3f8dfc4", Attributes:map[string]string{"tags.#":"0", "id":"subnet-b3f8dfc4", "vpc_id":"vpc-e496aa81", "cidr_block":"10.0.2.0/24", "availability_zone":"us-west-2b", "map_public_ip_on_launch":"false"}, Ephemeral:terraform.EphemeralState{ConnInfo:map[string]string{}}, Meta:map[string]string(nil)}, Tainted:[]*terraform.InstanceState(nil), Deposed:[]*terraform.InstanceState(nil), Provider:""}}

        State: <no state>

@jszwedko
Copy link
Contributor Author

Hi @jen20! I did see that locally, but I also saw the same error with master so I was hoping that it was just something with me. I should have some time next week to dig into it if you don't before me.

@catsby
Copy link
Member

catsby commented Jan 13, 2016

Hey all –

The Error: Check failed: Expected all resources to be gone, but found message should be resolved in #4510; I'm pulling this locally to verify the acceptance tests and then I'll merge

@catsby
Copy link
Member

catsby commented Jan 13, 2016

Things look good here, pulling in, thanks!

catsby added a commit that referenced this pull request Jan 13, 2016
…service-microsoft-active-directory

Add support for creating Managed Microsoft Active Directory and Directory Connectors in AWS
@catsby catsby merged commit 921f6eb into hashicorp:master Jan 13, 2016
@jszwedko
Copy link
Contributor Author

Awesome, thank you so much @catsby! I hadn't yet had a chance to look into this.

@jszwedko jszwedko deleted the add-support-for-aws-directory-service-microsoft-active-directory branch January 14, 2016 05:27
@ghost
Copy link

ghost commented Apr 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants