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 shared VPC #572

Merged
merged 11 commits into from
Oct 11, 2017
Merged

Add support for shared VPC #572

merged 11 commits into from
Oct 11, 2017

Conversation

rosbo
Copy link
Contributor

@rosbo rosbo commented Oct 11, 2017

Fixes #452

Introduced two new sources:

  • google_compute_shared_vpc_host_project
  • google_compute_shared_vpc_service_project
TF_ACC=1 go test ./google -v -run TestAccComputeSharedVpc_basic -timeout 120m
=== RUN   TestAccComputeSharedVpc_basic
--- PASS: TestAccComputeSharedVpc_basic (176.18s)
PASS

@rosbo rosbo requested a review from danawillow October 11, 2017 01:00
return nil
}
}
return fmt.Errorf("%s is not a service project of %s", serviceProject, hostProject)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the result is on the second page of results?


func isDisabledXpnResourceError(err error) bool {
if gerr, ok := err.(*googleapi.Error); ok {
if gerr.Code == 400 && len(gerr.Errors) > 0 && gerr.Errors[0].Reason == "invalidResourceUsage" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment as to why this error is special?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


resource "google_compute_shared_vpc_host_project" "host" {
project = "${google_project.host.project_id}"
depends_on = ["google_project_services.host", "google_project_services.service"]
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the service project depend on the service apis being enabled, not the host?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the host project was depending on compute apis enabled for both project, then having the service project depends on the host project being set up worked. But you are right, we can start enabling XPN for the host project before we are done updating the google services for the service project. It should be slightly faster. I updated the dependencies to reflect this.

page_title: "Google: google_compute_shared_vpc_host_project"
sidebar_current: "docs-google-compute-shared-vpc-host-project"
description: |-
Allows enablig and disabling Shared VPC for the host Google Cloud Platform project.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: enabling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


# google\_compute\_shared\_vpc\_host\_project

Allows enablig and disabling Shared VPC for the host Google Cloud Platform project. For more information see
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

page_title: "Google: google_compute_shared_vpc_service_project"
sidebar_current: "docs-google-compute-shared-vpc-service-project"
description: |-
Allows enablig and disabling Shared VPC for a service Google Cloud Platform project.
Copy link
Contributor

Choose a reason for hiding this comment

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

and here and line 11

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

"os"
)

func TestAccComputeSharedVpc_basic(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also check that delete works? 5f9ef48 may be of use here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rosbo
Copy link
Contributor Author

rosbo commented Oct 11, 2017

TF_ACC=1 go test ./google -v -run TestAccComputeSharedVpc_basic -timeout 120m
=== RUN   TestAccComputeSharedVpc_basic
--- PASS: TestAccComputeSharedVpc_basic (164.84s)
PASS

@rosbo rosbo merged commit e5d9fe6 into hashicorp:master Oct 11, 2017
@rosbo rosbo deleted the shared_vpc branch October 11, 2017 19:51
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* Add VPC host project resource
* Add VPC service project resource
* Add combined acceptance test for shared VPC
* Add docs for shared VPC
* Increase deadline for project services operation
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* Add VPC host project resource
* Add VPC service project resource
* Add combined acceptance test for shared VPC
* Add docs for shared VPC
* Increase deadline for project services operation
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
* Add VPC host project resource
* Add VPC service project resource
* Add combined acceptance test for shared VPC
* Add docs for shared VPC
* Increase deadline for project services operation
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 👉 hashibot-feedback@hashicorp.com. 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.

Ability to associate a service project with a Shared VPC after the Shared VPC is created
2 participants