Skip to content

Support display_name argument in network_link_service data source #578

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

Merged
merged 2 commits into from
Mar 19, 2025

Conversation

t0ffel
Copy link
Contributor

@t0ffel t0ffel commented Feb 28, 2025

Release Notes

New Features

  • Add display_name argument to network_link_service data source. Make id argument optional

Bug Fixes

  • [Briefly describe any bugs fixed in this PR].

Examples

  • [Briefly describe any Terraform configuration example updates in this PR].

Checklist

  • I can successfully build and use a custom Terraform provider binary for Confluent.
  • I have verified my PR with real Confluent Cloud resources in a pre-prod or production environment, or both.
  • I have attached manual Terraform verification results or screenshots in the Test & Review section below.
  • I have included appropriate Terraform acceptance or unit tests for any new resource, data source, or functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have updated the corresponding documentation and include relevant examples for this PR.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Check this box if the feature is enabled for certain organizations only

What

Addresses #548
Usually when using data source we want to get the id of the resource given some parameters like display name. The PR allows for exactly that.

Blast Radius

data source is read-only, won't apply any changes.

References

#548

Test & Review

tested with acceptance tests and used the provider manually to obtain NLS data source.

@t0ffel t0ffel requested a review from a team as a code owner February 28, 2025 16:36
@danielayaz
Copy link
Member

danielayaz commented Mar 11, 2025

Hi @t0ffel ! Would you be able to document the manual testing of spinning up the relevant data source for using both Display Name and ID as two different cases and document the resultant TF Apply and TF Plan results to ensure no TF drift? I can also provide assistance if you'd like, just let me know.

@t0ffel
Copy link
Contributor Author

t0ffel commented Mar 11, 2025

I'm not sure exactly what you mean.
I used this terraform:

data "confluent_network_link_service" "cluster_linking_by_name" {
  display_name = "Network link service for cluster linking"
  environment {
    id = "env-XXXXXXXX"
  }
}

data "confluent_network_link_service" "cluster_linking_by_id" {
  id = "nls-eg2zpg"
  environment {
    id = "env-XXXXXXXX"
  }
}

output "by_name" {
  value = data.confluent_network_link_service.cluster_linking_by_name
}

output "by_id" {
  value = data.confluent_network_link_service.cluster_linking_by_id
}

and the result is:

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

by_id = {
  "accept" = tolist([
    {
      "environments" = toset([
        "env-XXXXXXXX",
      ])
      "networks" = toset([
        "n-1rvqrp",
      ])
    },
  ])
  "description" = "Network link in us-east-1 to access from us-east-2"
  "display_name" = "Network link service for cluster linking"
  "environment" = tolist([
    {
      "id" = "env-XXXXXXXX"
    },
  ])
  "id" = "nls-eg2zpg"
  "network" = tolist([
    {
      "id" = "n-jv7rm4"
    },
  ])
  "resource_name" = "crn://confluent.cloud/organization=XXXXXXXXXXXXXXXXX/environment=env-XXXXXXXX/network=n-jv7rm4/network-link-service=nls-eg2zpg"
}
by_name = {
  "accept" = tolist([
    {
      "environments" = toset([
        "env-XXXXXXXX",
      ])
      "networks" = toset([
        "n-1rvqrp",
      ])
    },
  ])
  "description" = "Network link in us-east-1 to access from us-east-2"
  "display_name" = "Network link service for cluster linking"
  "environment" = tolist([
    {
      "id" = "env-XXXXXXXX"
    },
  ])
  "id" = "nls-eg2zpg"
  "network" = tolist([
    {
      "id" = "n-jv7rm4"
    },
  ])
  "resource_name" = "crn://confluent.cloud/organization=XXXXXXXXXXXXXXXXX/environment=env-XXXXXXXX/network=n-jv7rm4/network-link-service=nls-eg2zpg"
}

danielayaz
danielayaz previously approved these changes Mar 18, 2025
@danielayaz danielayaz dismissed their stale review March 18, 2025 16:17

Approved, but removing approval so it can be merged after the release goes out this afternoon.

@danielayaz danielayaz merged commit 9260dca into confluentinc:master Mar 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants