Skip to content
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

Fix terraform provider data sources #52545

Merged
merged 6 commits into from
Mar 5, 2025

Conversation

bernardjkim
Copy link
Contributor

@bernardjkim bernardjkim commented Feb 27, 2025

Closes #46313, https://github.com/gravitational/customer-sensitive-requests/issues/412

See: https://developer.hashicorp.com/terraform/plugin/framework/data-sources for proper implementation of the Read method.

Note: We should consider updating the terraform-plugin-framework package. We're currently using v0.10.0 while the latest version is v1.14.x.

Changelog: Fix terraform provider data sources

Testing

terraform {
  required_providers {
    teleport = {
      source  = "terraform.releases.teleport.dev/gravitational/teleport"
      version = "18.0.0-dev"
    }
  }
}

provider "teleport" {...}

data "teleport_role" "test" {
  version = "v7"
  kind = "role"
  metadata = {
    name = "test"
  }
}

data "teleport_cluster_networking_config" "test" {
  version = "v2"
  kind = "cluster_networking_config"
}

output "role_name" {
  value = data.teleport_role.test.metadata["name"]
}

output "cluster_networking_config_id" {
  value = data.teleport_cluster_networking_config.test.id
}
# After terraform apply
$ terraform output
cluster_networking_config_id = "cluster-networking-config"
role_name = "test"

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from tigrato March 5, 2025 09:17
@bernardjkim bernardjkim added this pull request to the merge queue Mar 5, 2025
Merged via the queue into master with commit 6f33839 Mar 5, 2025
45 checks passed
@bernardjkim bernardjkim deleted the bernard/fix-terraform-datasource branch March 5, 2025 18:19
@public-teleport-github-review-bot

@bernardjkim See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken data source in Terraform provider
4 participants