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

Autogenerate IAM resources for IAP Tunnel Instance #2988

Merged
merged 3 commits into from
Jan 17, 2020

Conversation

emilymye
Copy link
Contributor

@emilymye emilymye commented Jan 17, 2020

projects/{{project_number}}/iap_tunnel/zones/{{zones}}/instances/{{instance}}

to

projects/{{project_id}}/iap_tunnel/zones/{{zones}}/instances/{{instance}}

While IAP in documentation says they only allow for project number, they actually support projectId. This change keeps TunnelInstance in line with both other IAP IAM resources and the rest of Terraform (by using project ID) and avoids two extra calls (and the necessary permissions) to fetch the project from the Cloud Resource Manager API and get the project number for an ID.

Release Note Template for Downstream PRs (will be copied)

iap: Added `google_iap_tunnel_instance_iam_*` IAM resources for IAP Tunnel Instances
iap: Supported IAM conditions in `google_iap_tunnel_instance_iam_*` IAM resources
iap: Changed resource ID for `google_iap_tunnel_instance_iam_*` IAM resources from `projects/{{project_number}}/iap_tunnel/zones/{{zones}}/instances/{{instance}}` to 
`projects/{{project}}/iap_tunnel/zones/{{zones}}/instances/{{instance}}` to maintain similar formats to other resources and avoid making  unnecessary additional requests to GCP to get project number.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 4670689.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#1654
depends: hashicorp/terraform-provider-google#5429

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 82b93f4.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

iam_conditions_request_type: :REQUEST_BODY
id_format: "projects/{{project}}/iap_tunnel/zones/{{zone}}/instances/{{name}}"
import_format: [
"projects/{{project}}/iap_tunnel/zones/{{zone}}/instances/{{name}}",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently the handwritten has "projects/{{project}}/iap_tunnel/zones/{{zone}}/instances/{{instance}}" for id and "projects/{{project}}/zones/{{zone}}/instances/{{instance}}" for import format, so we're keeping ID format and supporting both import formats

@emilymye emilymye requested a review from slevenick January 17, 2020 00:49
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Looks good to me! There is something strange going on with the downstreams though, they have conflicts

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, efe676e.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff
Terraform Beta: Diff

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, dda2b60.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 7bab680.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 5aa4845.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

emilymye and others added 3 commits January 17, 2020 20:31
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
@modular-magician modular-magician merged commit 329adee into GoogleCloudPlatform:master Jan 17, 2020
nathkn pushed a commit to nathkn/magic-modules that referenced this pull request May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support google_iap_tunnel_instance_iam in GA provider IAM Conditions support for iap_tunnel_instance_iam
4 participants