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

Add support for google_compute_target_tcp_proxy #528

Merged
merged 2 commits into from
Oct 5, 2017

Conversation

enxebre
Copy link
Contributor

@enxebre enxebre commented Oct 4, 2017

Fixes #363

Introduces support google_compute_target_tcp_proxy

@rosbo rosbo self-requested a review October 4, 2017 18:29
Copy link
Contributor

@rosbo rosbo left a comment

Choose a reason for hiding this comment

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

Thank you Alberto. Overall very good. Just a few changes needed.

I also included in your PR description a link to an open issue we had related to this.

ForceNew: true,
},

"id": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you rename it to proxy_id? We are moving away from "id" field. See #399 for more details.

return err
}

d.SetId(proxy.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably set this to proxy.Id.

Can two separate proxies have the same name?

Copy link
Contributor Author

@enxebre enxebre Oct 5, 2017

Choose a reason for hiding this comment

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

At least through the UI you can not have more than one with the same name. I think I'd be in favour of leaving it with name which is also in line with the others target resources

}

if v, ok := d.GetOk("description"); ok {
proxy.Description = v.(string)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for the if statement around it. Move it inside &compute.TargetTcpProxy{...} above. d.Get("description") will return an empty string if not set which will yield the same behavior.


proxy := &compute.TargetTcpProxy{
Name: d.Get("name").(string),
Service: d.Get("backend_service").(string),
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you forgot to set the ProxyHeader field?

Providers: testAccProviders,
CheckDestroy: testAccCheckComputeTargetTcpProxyDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this testing the update feature? You need at least two TestStep. Make sure to test the update with the proxyHeader field (only updateable field) otherwise it will do a Delete/Create operation which won't test the update method.

In addition to the arguments listed above, the following computed attributes are
exported:

* `id` - A unique ID assigned by GCE.
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to proxy_id like suggested in a comment above.

@enxebre
Copy link
Contributor Author

enxebre commented Oct 5, 2017

Hey @rosbo thanks for your comments! proxy_id and tests should be fine now

@rosbo
Copy link
Contributor

rosbo commented Oct 5, 2017

Thanks Alberto for adding this new resource. Merging in!

TF_ACC=1 go test ./google -v -run TestAccComputeTargetTcpProxy_ -timeout 120m
=== RUN   TestAccComputeTargetTcpProxy_basic
--- PASS: TestAccComputeTargetTcpProxy_basic (67.52s)
=== RUN   TestAccComputeTargetTcpProxy_update
--- PASS: TestAccComputeTargetTcpProxy_update (79.31s)
PASS

@rosbo rosbo merged commit 2f94ff9 into hashicorp:master Oct 5, 2017
@rosbo rosbo changed the title Add support for target_tcp_proxy Add support for google_compute_target_tcp_proxy Oct 6, 2017
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
)

<!-- This change is generated by MagicModules. -->
/cc @drebes
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add google_compute_target_tcp_proxy resource
2 participants