-
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
Iot Endpoint Data Source #4303
Iot Endpoint Data Source #4303
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.
Thanks @scottwinkler! Please see the below and we'll get this in. 👍
"github.com/hashicorp/terraform/helper/schema" | ||
) | ||
|
||
func dataSourceAwsIotEndpoint() *schema.Resource { |
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.
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) { |
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.
Test name should include DataSource
, e.g. TestAccAWSIotEndpointDataSource
resource.TestStep{ | ||
Config: testAccAWSIotEndpointConfig, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttrSet("aws_iot_endpoint.example", "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 "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]
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 |
Interesting - its not well documented. I think we're okay leaving it out for now and can always add it in later. |
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.
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"), |
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.
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. |
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.
Formatting got a little wonky here, I'll fix on merge 👍
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. |
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! |
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.