hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.85k stars 9.19k forks source link

[Enhancement]: New data sources `aws_grafana_workspace`, `aws_prometheus_workspace` #27150

Open maxkoko-co opened 2 years ago

maxkoko-co commented 2 years ago

Description

When trying to provision grafana using grafana provider I cannot do it in the same terraform run, the common provider issue of resource not being known at the creation time for provider to refresh state, or being deleted on a destroy which results in some resources being orphaned in the terraform state making it invalid.

Affected Resource(s) and/or Data Source(s)

aws_grafana_workspace, aws_prometheus_workspace

Potential Terraform Configuration

data "aws_grafana_workspace" "example" {
  filter {
    name   = "name"
    values = ["$MYENV-GRAFANA"]
}

data "aws_prometheus_workspace" "example" {
  filter {
    name   = "name"
    values = ["$MYENV-PROM"]
}

provider "grafana" {
  url  = "https://${data.aws_grafana_workspace.example.endpoint}"
  auth = data.aws_grafana_workspace.example.auth_keys.admin.json
}

References

Raised earlier here: https://github.com/terraform-aws-modules/terraform-aws-managed-service-grafana/issues/10

Would you like to implement a fix?

No response

github-actions[bot] commented 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 month ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!