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

Iot Endpoint Data Source #4303

Merged
merged 4 commits into from
Apr 24, 2018
Merged

Conversation

scottwinkler
Copy link
Contributor

The iot endpoint is unique per account and is needed for connecting things to the iot registry. By having a data source for the iot endpoint, now it is possible to configure your things as part of a regular terraform deployment.

@ghost ghost added the size/M Managed by automation to categorize the size of a PR. label Apr 21, 2018
@bflad bflad added new-data-source Introduces a new data source. service/iot Issues and PRs that pertain to the iot service. labels Apr 23, 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 @scottwinkler! Please see the below and we'll get this in. 👍

"github.com/hashicorp/terraform/helper/schema"
)

func dataSourceAwsIotEndpoint() *schema.Resource {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing documentation:

  • Link in website/aws.erb
  • New page website/docs/d/iot_endpoint.html.markdown

"github.com/hashicorp/terraform/helper/resource"
)

func TestAccAWSIotEndpoint(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Test name should include DataSource, e.g. TestAccAWSIotEndpointDataSource

resource.TestStep{
Config: testAccAWSIotEndpointConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("aws_iot_endpoint.example", "id"),
Copy link
Contributor

Choose a reason for hiding this comment

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

The "resource" name here should be data.aws_iot_endpoint.example

=== RUN   TestAccAWSIotEndpoint
--- FAIL: TestAccAWSIotEndpoint (4.88s)
    testing.go:518: Step 0 error: Check failed: Check 1/2 error: Not found: aws_iot_endpoint.example in [root]

@ghost ghost added size/L Managed by automation to categorize the size of a PR. and removed size/M Managed by automation to categorize the size of a PR. labels Apr 23, 2018
@scottwinkler
Copy link
Contributor Author

Thanks, @bflad . I made the changes you requested. I am wondering if I should include the "endpoint-type" parameter for the data source. I could not find any documentation about what this type is, I think it might be something that will be used in the future but is not currently used. Should I include this parameter which doesn't appear to do anything to have a complete solution or leave this for a future enhancement? https://docs.aws.amazon.com/cli/latest/reference/iot/describe-endpoint.html

@bflad
Copy link
Contributor

bflad commented Apr 24, 2018

Should I include this parameter which doesn't appear to do anything to have a complete solution or leave this for a future enhancement?

Interesting - its not well documented. I think we're okay leaving it out for now and can always add it in later.

@bflad bflad added this to the v1.16.0 milestone Apr 24, 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.

Let's get this in 🚀

1 test passed (all tests)
=== RUN   TestAccAWSIotEndpointDataSource
--- PASS: TestAccAWSIotEndpointDataSource (6.67s)

resource.TestStep{
Config: testAccAWSIotEndpointConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.aws_iot_endpoint.example", "id"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I missed this the first review, we don't need to explicitly check id, its implicitly expected to be there as part of being a Terraform resource/data source. I'll remove this on merge 👍


## Attributes Reference

* `endpoint_address` - The endpoint. The format of the endpoint is as follows: identifier .iot.*region* .amazonaws.com.
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting got a little wonky here, I'll fix on merge 👍

@bflad bflad merged commit 299e162 into hashicorp:master Apr 24, 2018
bflad added a commit that referenced this pull request Apr 24, 2018
@bflad
Copy link
Contributor

bflad commented Apr 25, 2018

This has been released in version 1.16.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 6, 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 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/iot Issues and PRs that pertain to the iot service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants