-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 data source for retrieving the root Organizational Unit #4229
Conversation
"github.com/hashicorp/terraform/terraform" | ||
) | ||
|
||
func TestAccDataSourceAwsOrganizationRoot_basic(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to worry about Organizations possibly not being enabled?
Decided that having a single data source for organizational units (in the future) made more sense than having a special one for roots, so changed the naming around. |
aws/provider.go
Outdated
@@ -221,6 +221,7 @@ func Provider() terraform.ResourceProvider { | |||
"aws_region": dataSourceAwsRegion(), | |||
"aws_route_table": dataSourceAwsRouteTable(), | |||
"aws_route53_zone": dataSourceAwsRoute53Zone(), | |||
"aws_organizations_unit": dataSourceAwsOrganizationUnit(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data sources in this code are in alphabetical order but this is between r and s when it should be n and p.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh, fixed!
Anything else needed here? |
This will be more future-proof, allowing support for non-root organizational units.
…ations_unit data source
Is this data source ready to be reviewed // accepted? @breser |
FYI: The commits from this pull request were included with #4207 to add the |
@ndobbs Not sure why you're asking me and I'd missed that you had till now. But yes I think that data source could be merged. I was using at a previous job with a custom built copy of the aws provider. But I'm not longer with the company that we were using it. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Part of #571.
Corresponds to this API. The motivation here is that I want to be able to create Organizational Units (OUs) from Terraform (see #4207), but to do so I need the ID of the root OU.
Acceptance tests pass:
Also tried with with an actual test case:
Thanks!