SamuelFisher / TerraformPluginDotNet

Write Terraform providers in C#.
MIT License
46 stars 14 forks source link

DataSource support added #30

Closed ThomasBleijendaal closed 2 years ago

ThomasBleijendaal commented 2 years ago

This PR adds support for building custom data sources in terraform, which can be used like this:

data "example_data" ""example"" {
  id = ""test""
}

The associated data source provider gets a request with a resource containing id = "test" and that provider can enrich the resource with data from external systems.

I think this feature is quite useful because it allows for creating simple custom terraform provider that add a little bit of data that is missing from other providers. Data sources do not have any real state in terraform and can be viewed as a nice wrapper around an API call.

(This PR is implemented using nullable enabled so it got some of those annotations)