-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
New resource for Appstream Directory Config #21505
New resource for Appstream Directory Config #21505
Conversation
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.
Hi @coderGo93, I wasn't able to run the acceptance tests. The tests need an ActiveDirectory directory to work with. I've also added some comments on the code
|
||
resource "aws_appstream_directory_config" "test" { | ||
directory_name = %[1]q | ||
organizational_unit_distinguished_names = data.aws_organizations_organizational_units.test.children.*.id |
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 organizational unit referenced by this parameter is an Active Directory OU, and isn't related to AWS Organizations. You'll want to create an aws_directory_service_directory to test this with.
This function is in a draft PR, so pulling it in early
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.
Hi @coderGo93. I've made a few updates to the PR.
Acceptance test results in Commercial partition
--- PASS: TestAccAppStreamDirectoryConfig_disappears (1745.24s)
--- PASS: TestAccAppStreamFleet_completeWithStop (1779.84s)
--- PASS: TestAccAppStreamDirectoryConfig_OrganizationalUnitDistinguishedNames (1874.46s)
--- PASS: TestAccAppStreamDirectoryConfig_basic (3211.72s)
Acceptance test results in GovCloud partition
--- PASS: TestAccAppStreamDirectoryConfig_disappears (1525.85s)
--- PASS: TestAccAppStreamDirectoryConfig_OrganizationalUnitDistinguishedNames (1598.33s)
--- PASS: TestAccAppStreamDirectoryConfig_basic (3017.28s)
} | ||
|
||
var output *appstream.CreateDirectoryConfigOutput | ||
err := resource.RetryContext(ctx, directoryConfigTimeout, func() *resource.RetryError { |
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.
CreateDirectoryConfig
is a synchronous operation, so we don't need the Retry
return diag.FromErr(fmt.Errorf("error creating Appstream DirectoryConfig (%s): %w", d.Id(), err)) | ||
} | ||
|
||
d.SetId(aws.StringValue(output.DirectoryConfig.DirectoryName)) |
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.
We need to make sure that neither output
nor output.DirectoryConfig
is nil
to avoid panics
|
||
resource "aws_appstream_directory_config" "test" { | ||
directory_name = %[1]q | ||
organizational_unit_distinguished_names = [aws_directory_service_directory.test.id] |
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.
This should be an Active Directory Organizational Unit Distinguished Name: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ldap/distinguished-names
}, | ||
}) | ||
} | ||
|
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.
There should be tests for multiple OUs and adding and removing OUs
This functionality has been released in v3.66.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Added a new resource, doc and tests for AppStream Directory Config called
aws_appstream_directory_config
Community Note
Relates #6508
Output from acceptance testing: