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 Datasource: aws_ssm_document #6479

Merged
merged 4 commits into from
Nov 25, 2018
Merged

Conversation

saravanan30erd
Copy link
Contributor

Fixes #6418

Change1:

  • Created new datasource for aws_ssm_document

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSsmDocumentDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSSsmDocumentDataSource_ -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSSsmDocumentDataSource_basic
=== PAUSE TestAccAWSSsmDocumentDataSource_basic
=== CONT  TestAccAWSSsmDocumentDataSource_basic
--- PASS: TestAccAWSSsmDocumentDataSource_basic (88.81s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	88.855s
...

@ghost ghost added size/L 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/ssm Issues and PRs that pertain to the ssm service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 15, 2018
@bflad bflad added the new-data-source Introduces a new data source. label Nov 16, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks as usual for the submission @saravanan30erd. Some little things then we should be able to get this in. 👍

{
Config: testAccCheckAwsSsmDocumentDataSourceConfig(name, "JSON"),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestMatchResourceAttr(resourceName, "arn",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Generally its easier to check data sources via resource.TestCheckResourceAttrPair() where possible, rather than re-implementing the test check logic. 👍

website/aws.erb Outdated
@@ -346,6 +346,9 @@
<li<%= sidebar_current("docs-aws-datasource-sns-topic") %>>
<a href="/docs/providers/aws/d/sns_topic.html">aws_sns_topic</a>
</li>
<li<%= sidebar_current("docs-aws-datasource-ssm-document") %>>
<a href="/docs/providers/aws/d/ssm_document.html">aws_ssm_parameter</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

😎 small copypasta typo here

Suggested change
<a href="/docs/providers/aws/d/ssm_document.html">aws_ssm_parameter</a>
<a href="/docs/providers/aws/d/ssm_document.html">aws_ssm_document</a>

website/docs/d/ssm_document.html.markdown Show resolved Hide resolved
To get the contents of the custom document.

```hcl
resource "aws_ssm_document" "test" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'm not sure showing an example of the resource is valuable here and generally tends to be more of a maintenance burden than anything. It'd be much better to show how the data source gets used downstream if we are going to include additional configuration in the example. 😄

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Nov 20, 2018
@saravanan30erd
Copy link
Contributor Author

@bflad changes are done 👍

$ make testacc TESTARGS='-run=TestAccAWSSsmDocumentDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -parallel 20 -run=TestAccAWSSsmDocumentDataSource_ -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSSsmDocumentDataSource_basic
=== PAUSE TestAccAWSSsmDocumentDataSource_basic
=== CONT  TestAccAWSSsmDocumentDataSource_basic
--- PASS: TestAccAWSSsmDocumentDataSource_basic (74.01s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	74.046s

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Nov 20, 2018
@bflad bflad added this to the v1.47.0 milestone Nov 25, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

LGTM with one non-blocking note, thanks @saravanan30erd! 🚀

--- PASS: TestAccAWSSsmDocumentDataSource_basic (6.84s)


func TestAccAWSSsmDocumentDataSource_basic(t *testing.T) {
resourceName := "data.aws_ssm_document.test"
name := "test_document"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: We should randomize the naming to prevent testing collisions and enable future parallel testing.

@bflad bflad merged commit 2eff73c into hashicorp:master Nov 25, 2018
bflad added a commit that referenced this pull request Nov 25, 2018
@bflad
Copy link
Contributor

bflad commented Nov 30, 2018

This was released (4 days ago) in version 1.47.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 2, 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 Apr 2, 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. new-data-source Introduces a new data source. provider Pertains to the provider itself, rather than any interaction with AWS. service/ssm Issues and PRs that pertain to the ssm service. size/L 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.

Support for Data Resource for aws_ssm_document
2 participants