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

New Data Source: aws_directory_service_directory #11282

Merged

Conversation

Tensho
Copy link
Contributor

@Tensho Tensho commented Dec 13, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

**New Data Source:** `aws_directory_service_directory` (#11282)

Example

resource "aws_directory_service_directory" "example" {
  ...
}

data "aws_directory_service_directory" "example" {
  directory_id = "aws_directory_service_directory.example.id"
}

Acceptance Tests

$ make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsDirectoryServiceDirectory'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAwsDirectoryServiceDirectory -timeout 120m
=== RUN   TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== PAUSE TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== RUN   TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
=== PAUSE TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
=== CONT  TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== CONT  TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
--- FAIL: TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD (755.12s)
    testing.go:635: Step 0 error: Check failed: 1 error occurred:
        	* Check 6/14 error: data.aws_directory_service_directory.test-simple-ad: Attribute 'password' not found


--- FAIL: TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD (1966.92s)
    testing.go:635: Step 0 error: Check failed: 1 error occurred:
        	* Check 6/14 error: data.aws_directory_service_directory.test-microsoft-ad: Attribute 'password' not found


FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	1968.212s
FAIL
make: *** [testacc] Error 1

References

@Tensho Tensho requested a review from a team December 13, 2019 13:32
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/directoryservice tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 13, 2019
@Tensho
Copy link
Contributor Author

Tensho commented Dec 13, 2019

@bflad Please could you guide me on why does password attribute is not found in tests?

$ make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsDirectoryServiceDirectory'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAwsDirectoryServiceDirectory -timeout 120m
=== RUN   TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== PAUSE TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== RUN   TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
=== PAUSE TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
=== CONT  TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD
=== CONT  TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD
--- FAIL: TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD (755.12s)
    testing.go:635: Step 0 error: Check failed: 1 error occurred:
        	* Check 6/14 error: data.aws_directory_service_directory.test-simple-ad: Attribute 'password' not found


--- FAIL: TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD (1966.92s)
    testing.go:635: Step 0 error: Check failed: 1 error occurred:
        	* Check 6/14 error: data.aws_directory_service_directory.test-microsoft-ad: Attribute 'password' not found


FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	1968.212s
FAIL
make: *** [testacc] Error 1

I thought it could be because of the sensitive nature of password attribute, but I have the same error even if I off Sensitive: true option.

@Tensho
Copy link
Contributor Author

Tensho commented Dec 17, 2019

@gdavison Hi, could you help me with password attribute?

@gdavison gdavison removed the needs-triage Waiting for first response or review from a maintainer. label Dec 18, 2019
@gdavison
Copy link
Contributor

Hi @Tensho. The API doesn't return the password. That's definitely a good thing for security! :)

Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

Looks good. A couple tweaks to make and removing password.


# Data Source: aws_directory_service_directory

Get attributes of AWS Directory Service directory (SimpleAD, Managed AD, AD Connector). It's especially useful to refer AWS Managed AD or on-premis AD in AD Connector configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling: should be "on-premise"


func testAccDataSourceAwsDirectoryServiceDirectoryConfig_SimpleAD(alias string) string {
return fmt.Sprintf(`
%s
Copy link
Contributor

Choose a reason for hiding this comment

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

Use return fmt.Sprintf(...) + testAccDataSourceAwsDirectoryServiceDirectoryConfig_Prerequisites("simple-ad")


func testAccDataSourceAwsDirectoryServiceDirectoryConfig_MicrosoftAD(alias string) string {
return fmt.Sprintf(`
%s
Copy link
Contributor

Choose a reason for hiding this comment

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

Use return fmt.Sprintf(...) + testAccDataSourceAwsDirectoryServiceDirectoryConfig_Prerequisites("microsoft-ad")

@Tensho Tensho force-pushed the directory-service-directory-data-source branch from a515200 to e73d1ff Compare December 21, 2019 19:56
@Tensho
Copy link
Contributor Author

Tensho commented Dec 21, 2019

@gdavison Thank you, TBH, I thought sensitive attributes are returned back from the state on read as they were set there on create. Fixed typo on-premis(e), removed password and replaced test config string interpolation with concatenation. Please let me know if I can do anything else here.

@Tensho
Copy link
Contributor Author

Tensho commented Jan 6, 2020

@gdavison Please let me know if I can do anything else here 🙇 It would be nice to squash all review commits on merge.

@gdavison gdavison self-assigned this Jan 6, 2020
Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

--- PASS: TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD (506.62s)
--- PASS: TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD (1834.16s)

@gdavison gdavison added this to the v2.44.0 milestone Jan 6, 2020
@gdavison gdavison merged commit dd845d1 into hashicorp:master Jan 7, 2020
gdavison added a commit that referenced this pull request Jan 7, 2020
@Tensho Tensho deleted the directory-service-directory-data-source branch January 8, 2020 09:54
@ghost
Copy link

ghost commented Jan 10, 2020

This has been released in version 2.44.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 for triage. Thanks!

@ghost
Copy link

ghost commented Mar 27, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants