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

Support lb type param on terraform sdk #1023

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup tests
  • Loading branch information
asaha2 committed Sep 19, 2023
commit 94f9079ecd4f3dffa638abf584bf69f21f3be7dd
4 changes: 2 additions & 2 deletions digitalocean/loadbalancer/datasource_loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ resource "digitalocean_tag" "foo" {

resource "digitalocean_droplet" "foo" {
count = 2
image = "ubuntu-18-04-x64"
image = "ubuntu-22-04-x64"
name = "%s-${count.index}"
region = "nyc3"
size = "s-1vcpu-1gb"
Expand Down Expand Up @@ -699,7 +699,7 @@ resource "digitalocean_tag" "foo" {

resource "digitalocean_droplet" "foo" {
count = 2
image = "ubuntu-18-04-x64"
image = "ubuntu-22-04-x64"
name = "%s-${count.index}"
region = "nyc3"
size = "s-1vcpu-1gb"
Expand Down
2 changes: 0 additions & 2 deletions digitalocean/loadbalancer/resource_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ func resourceDigitalOceanLoadBalancerV0() *schema.Resource {
"type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "the type of the load balancer (GLOBAL or REGIONAL)",
},
},
Expand Down Expand Up @@ -566,7 +565,6 @@ func resourceDigitalOceanLoadbalancerRead(ctx context.Context, d *schema.Resourc
d.Set("vpc_uuid", loadbalancer.VPCUUID)
d.Set("http_idle_timeout_seconds", loadbalancer.HTTPIdleTimeoutSeconds)
d.Set("project_id", loadbalancer.ProjectID)
d.Set("type", loadbalancer.Type)

if loadbalancer.SizeUnit > 0 {
d.Set("size_unit", loadbalancer.SizeUnit)
Expand Down
7 changes: 5 additions & 2 deletions digitalocean/loadbalancer/resource_loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestAccDigitalOceanLoadbalancer_Basic(t *testing.T) {
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "region", "nyc3"),
resource.TestCheckResourceAttr(
asaha2 marked this conversation as resolved.
Show resolved Hide resolved
"digitalocean_loadbalancer.foobar", "type", ""),
"digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "size_unit", "1"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestAccDigitalOceanLoadbalancer_Updated(t *testing.T) {
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "region", "nyc3"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "type", ""),
"digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "size_unit", "1"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -140,6 +140,8 @@ func TestAccDigitalOceanLoadbalancer_Updated(t *testing.T) {
"digitalocean_loadbalancer.foobar", "name", name),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "region", "nyc3"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "type", "REGIONAL"),
resource.TestCheckResourceAttr(
"digitalocean_loadbalancer.foobar", "size_unit", "1"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -838,6 +840,7 @@ resource "digitalocean_droplet" "foo" {
resource "digitalocean_loadbalancer" "foobar" {
name = "%s"
region = "nyc3"
type = "REGIONAL"

forwarding_rule {
entry_port = 81
Expand Down
Loading