-
Notifications
You must be signed in to change notification settings - Fork 235
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
Add support for the Azure credentials resource #1907
base: main
Are you sure you want to change the base?
Conversation
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
fac0780
to
184378c
Compare
StackID types.String `tfsdk:"stack_id"` | ||
ClientSecret types.String `tfsdk:"client_secret"` | ||
ResourceID types.String `tfsdk:"resource_id"` | ||
ResourceTagFilters []TagFilter `tfsdk:"resource_tag_filter"` |
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.
I've recently found out that if we use Go slice types directly here, instead of the Terraform type e.g. List, you can get errors when a value is planned by Terraform with a state other than the normal state e.g. Unknown
. See https://github.com/grafana/cloud-onboarding/issues/8084. I'm still working through what the right pattern is myself, possibly handing off to @thepalbi on Wednesday, but this will need to be fixed here as well.
stack_id = grafana_cloud_provider_azure_credential.test.stack_id | ||
resource_id = grafana_cloud_provider_azure_credential.test.resource_id | ||
|
||
resource_discovery_tag_filter { |
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.
does this + the docs need to be updated to remove these blocks from the data source example?
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.
Removed 👍
}, | ||
}, | ||
Blocks: map[string]schema.Block{ | ||
"resource_discovery_tag_filter": schema.ListNestedBlock{ |
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.
are these filters required to look up a unique resource? I would think that just the stack and resource ID are sufficient, because it looks like the client GetAzureCredential
function only needs the stack ID and resource ID. I think the inner fields need to be marked with Computed instead of Required, see e.g.
terraform-provider-grafana/internal/resources/cloudprovider/data_source_aws_cloudwatch_scrape_job.go
Line 61 in 04bb863
"service": schema.ListNestedBlock{ |
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.
if so, then it looks like resource_discovery_tag_filter
needs to be retrieved and set below in the Read function from the API response as well
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.
Done
This PR introduces the
grafana_cloud_provider_azure_credential
resource and data source to the Grafana Terraform provider. The new resource allows users to manage Azure credentials within their Grafana Cloud stack. The data source enables users to retrieve information about existing Azure credentials.