Skip to content

Fetch loadbalancer resource in datasource by ID#773

Merged
andrewsomething merged 4 commits intodigitalocean:mainfrom
opeco17:find_loadbalancer_by_id
Jan 10, 2022
Merged

Fetch loadbalancer resource in datasource by ID#773
andrewsomething merged 4 commits intodigitalocean:mainfrom
opeco17:find_loadbalancer_by_id

Conversation

@opeco17
Copy link
Copy Markdown
Contributor

@opeco17 opeco17 commented Jan 10, 2022

Issue: #772

Currently we can fetch loadbalancer resource in datasource by only its name.
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/data-sources/loadbalancer

By this update, we will be able to fetch loadbalancer resource by its ID in addition to name like below.

data "digitalocean_loadbalancer" "example" {
  id = "loadbalancer_id"
}

This update is referring to the following droplet datasource.
https://github.com/digitalocean/terraform-provider-digitalocean/blob/main/digitalocean/datasource_digitalocean_droplet.go#L40

Copy link
Copy Markdown
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks great. Thanks for the contribution!

I did add one additional commit to use unique tag names in the acceptance tests. This is useful if the tests are run in parallel so that Droplets from one test are not added to load balancers from another.

05127eb

@andrewsomething andrewsomething merged commit f077a07 into digitalocean:main Jan 10, 2022
andyli added a commit to HaxeFoundation/haxe-terraform that referenced this pull request Jan 11, 2022
@andyli
Copy link
Copy Markdown

andyli commented Jan 11, 2022

Just tried it - works perfectly. Thanks!

@opeco17 opeco17 deleted the find_loadbalancer_by_id branch January 11, 2022 13:46
andyli added a commit to HaxeFoundation/haxe-terraform that referenced this pull request Jan 15, 2022
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.

3 participants