-
Notifications
You must be signed in to change notification settings - Fork 232
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
Description: "The name of the Azure Credential.", | ||
Required: true, | ||
}, | ||
"client_id": schema.StringAttribute{ |
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.
For a Terraform data source, we should only mark fields required if the user must supply values for them to be able to look up a unique resource. All other fields should be marked only as Computed: true
, see e.g.
versus
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.
}, | ||
}, | ||
Blocks: map[string]schema.Block{ | ||
"resource_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.
terraform-provider-grafana/internal/resources/cloudprovider/resource_aws_cloudwatch_scrape_job.go
Line 167 in 9fb1148
"resource_discovery_tag_filter": schema.ListNestedBlock{ |
resource_discovery_tag_filter
, should we make things consistent, or is it an Azure thing?
// Tests both managed resource and data source | ||
func TestAcc_AzureCredential(t *testing.T) { | ||
resourceID := "3" | ||
// Mock the Connections API response for Create, Get, and Delete |
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.
comment leftover from copy
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.