-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement Service Account Impersonation #4015
Implement Service Account Impersonation #4015
Conversation
Fork Update
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. Thanks for your contribution! A human will be with you soon. @megan07, please review this PR or find an appropriate assignee. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 117 insertions(+), 24 deletions(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 117 insertions(+), 24 deletions(-)) |
@rileykarson I'm going to use this PR to also fix hashicorp/terraform-provider-google#7351 because I rewrote the auth docs of the provider. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 119 insertions(+), 24 deletions(-)) |
@upodroid: Sounds good! Marked you as assigned to that issue as well. |
Have a look at the latest commit. |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=149631" |
third_party/terraform/website/docs/guides/provider_reference.html.markdown
Outdated
Show resolved
Hide resolved
@@ -72,15 +94,6 @@ same configuration. | |||
|
|||
### Quick Reference | |||
|
|||
* `credentials` - (Optional) Either the path to or the contents of a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do. I want to bury this configuration parameter at the bottom of the page. IMHO, it shouldn't be used at all and I have an open proposal to remove it entirely from terraform in the next major release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe credentials
is the most commonly used authentication method for the provider. Depriorisiting it in the middle of the 3.X
chain is probably something we should avoid doing, at least until we've committed to removing the field in 4.0.0
(assuming we do so).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it in the Quick reference but I'll move it down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -91,6 +104,9 @@ region is specified on a regional resource, it will take precedence. | |||
zone should be within the default region you specified. If another zone is | |||
specified on a zonal resource, it will take precedence. | |||
|
|||
* `impersonate_service_account` - (Optional) The service account to impersonate for all Google API Calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add an impersonate_service_account_delegates
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delegates is a complex configuration and in most cases direct impersonation is generally sufficient. It is documented at the bottom
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 119 insertions(+), 24 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 122 insertions(+), 24 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccConfigLoadValidate_accessTokenImpersonated|TestAccConfigLoadValidate_impersonated|TestAccDataSourceGoogleActiveFolder_default|TestAccDataSourceGoogleActiveFolder_space|TestAccDataSourceGoogleForwardingRule|TestAccDataSourceGoogleServiceAccountIdToken_basic|TestAccProviderMeta_setModuleName|TestAccAccessApprovalOrganizationSettings_update|TestAccBigQueryJob_bigqueryJobQueryExample|TestAccBigQueryJob_bigqueryJobLoadExample|TestAccBigQueryJob_bigqueryJobQueryTableReferenceExample|TestAccBigQueryJob_bigqueryJobLoadTableReferenceExample|TestAccBigQueryJob_bigqueryJobExtractExample|TestAccBigQueryJob_bigqueryJobExtractTableReferenceExample|TestAccBigQueryJob_bigqueryJobCopyExample|TestAccBigQueryJob_bigqueryJobCopyTableReferenceExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccContainerCluster_withNodeConfig|TestAccContainerCluster_withSandboxConfig|TestAccContainerNodePool_withSandboxConfig|TestAccDNSPolicy_dnsPolicyBasicExample|TestAccDNSPolicy_update|TestAccProjectServiceIdentity_basic|TestAccRedisInstance_redisInstanceAuthEnabled You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=151460" |
How is this looking in terms of making it into the next release? |
Sorry for the delay on this, I've had numerous internal deadlines I've needed to hit, but have time to focus on this more this morning. I left off and the As for when it will be released, @joe-a-t, it won't be in the next release, as that has already been cut, however, if we can get this out within the next week, it should be able to make |
Hmm, that is weird. I'll run a selection of the failed tests with debug logging enabled and will report back. |
Hi @upodroid ! I think I figured out the other tests failing, as I was suspecting - I had given the impersonate service account only permission for
so that just the |
I fixed it now. I assumed a highly credentialed identity was being impersonated. I was doing that. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
proj := getTestProjectFromEnv() | ||
serviceaccount := multiEnvSearch([]string{"IMPERSONATE_SERVICE_ACCOUNT_ACCTEST"}) | ||
|
||
c, err := google.CredentialsFromJSON(context.Background(), []byte(creds), testOauthScope) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last thing @rileykarson found, we need to pass the DefaultClientScopes
along with testOauthScope
here, I think thats why this test was failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, i'll replace testOauthScope with DefaultClientScopes. Instead of appending the two, you can use the default one as it in includes compute + cloud-platform
@upodroid thank you for the last fix! I'll run the tests again after the last comment here is addressed. Thank you so much for your patience and all of your work on this! |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=152337" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
1 similar comment
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=152341" |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 4 files changed, 176 insertions(+), 26 deletions(-)) |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGoogleActiveFolder_default|TestAccDataSourceGoogleActiveFolder_space|TestAccDataSourceGoogleForwardingRule|TestAccDataSourceComputeInstanceSerialPort_basic|TestAccDataSourceGoogleComputeInstanceGroup_basic|TestAccDataSourceGoogleComputeInstanceGroup_withNamedPort|TestAccDataSourceGoogleComputeInstanceGroup_fromIGM|TestAccDataSourceSpannerInstance_basic|TestAccComputeInstanceIamBindingGenerated|TestAccComputeInstanceIamMemberGenerated|TestAccComputeInstanceIamMemberGenerated_withCondition|TestAccComputeInstanceIamBindingGenerated_withCondition|TestAccComputeInstanceIamPolicyGenerated|TestAccComputeInstanceIamPolicyGenerated_withCondition|TestAccIapTunnelInstanceIamBindingGenerated|TestAccIapTunnelInstanceIamMemberGenerated|TestAccIapTunnelInstanceIamPolicyGenerated|TestAccIapTunnelInstanceIamBindingGenerated_withCondition|TestAccIapTunnelInstanceIamMemberGenerated_withCondition|TestAccIapTunnelInstanceIamPolicyGenerated_withCondition|TestAccStorageBucketIamPolicyGenerated|TestAccStorageBucketIamPolicyGenerated_withCondition|TestAccProviderMeta_setModuleName|TestAccBigQueryJob_bigqueryJobQueryExample|TestAccBigQueryJob_bigqueryJobQueryTableReferenceExample|TestAccBigQueryJob_bigqueryJobLoadExample|TestAccBigQueryJob_bigqueryJobLoadTableReferenceExample|TestAccBigQueryJob_bigqueryJobExtractExample|TestAccBigQueryJob_bigqueryJobExtractTableReferenceExample|TestAccBigQueryJob_bigqueryJobCopyExample|TestAccBigQueryJob_bigqueryJobCopyTableReferenceExample|TestAccCloudTasksQueue_update|TestAccCloudTasksQueue_update2Basic|TestAccComputeAutoscaler_autoscalerSingleInstanceExample|TestAccComputeAutoscaler_autoscalerBasicExample|TestAccComputeAutoscaler_update|TestAccComputeAutoscaler_multicondition|TestAccComputeAutoscaler_scaleDownControl|TestAccComputeBackendService_withBackend|TestAccComputeBackendService_withBackendAndIAP|TestAccComputeBackendService_withMaxConnections|TestAccComputeBackendService_withMaxConnectionsPerInstance|TestAccComputeBackendService_withMaxRatePerEndpoint|TestAccComputeBackendService_withMaxConnectionsPerEndpoint|TestAccComputeBackendService_internalLoadBalancing|TestAccComputeDisk_deleteDetach|TestAccComputeForwardingRule_forwardingRuleHttpLbExample|TestAccComputeGlobalForwardingRule_globalForwardingRuleInternalExample|TestAccComputeGlobalForwardingRule_internalLoadBalancing|TestAccComputeHealthCheck_tcp_update|TestAccComputeInstanceFromTemplate_overrideBootDisk|TestAccComputeInstanceFromTemplate_overrideAttachedDisk|TestAccComputeInstanceFromTemplate_overrideScheduling|TestAccComputeInstanceFromTemplate_012_removableFields|TestAccComputeInstanceFromTemplate_overrideMetadataDotStartupScript|TestAccInstanceGroupManager_targetSizeZero|TestAccInstanceGroupManager_basic|TestAccInstanceGroupManager_versions|TestAccInstanceGroupManager_update|TestAccInstanceGroupManager_autoHealingPolicies|TestAccInstanceGroupManager_stateful|TestAccComputeInstanceGroup_basic|TestAccComputeInstanceGroup_update|TestAccComputeInstanceGroup_rename|TestAccComputeInstanceGroup_outOfOrderInstances|TestAccComputeInstanceGroup_network|TestAccComputeInstanceIamPolicy|TestAccComputeInstanceTemplate_preemptible|TestAccComputeInstanceTemplate_basic|TestAccComputeInstanceTemplate_imageShorthand|TestAccComputeInstanceTemplate_IP|TestAccComputeInstanceTemplate_networkTier|TestAccComputeInstanceTemplate_networkIP|TestAccComputeInstanceTemplate_disks|TestAccComputeInstanceTemplate_subnet_auto|TestAccComputeInstanceTemplate_networkIPAddress|TestAccComputeInstanceTemplate_regionDisks|TestAccComputeInstanceTemplate_primaryAliasIpRange|TestAccComputeInstanceTemplate_subnet_custom|TestAccComputeInstanceTemplate_metadata_startup_script|TestAccComputeInstanceTemplate_secondaryAliasIpRange|TestAccComputeInstanceTemplate_guestAccelerator|TestAccComputeInstanceTemplate_minCpuPlatform|TestAccComputeInstanceTemplate_shieldedVmConfig1|TestAccComputeInstanceTemplate_guestAcceleratorSkip|TestAccComputeInstanceTemplate_soleTenantNodeAffinities|TestAccComputeInstanceTemplate_EncryptKMS|TestAccComputeInstanceTemplate_shieldedVmConfig2|TestAccComputeInstanceTemplate_withScratchDisk|TestAccComputeInstanceTemplate_enableDisplay|TestAccComputeInstance_basic2|TestAccComputeInstance_basic1|TestAccComputeInstance_IP|TestAccComputeInstance_basic4|TestAccComputeInstance_basic3|TestAccComputeInstance_PTRRecord|TestAccComputeInstance_basic5|TestAccComputeInstance_networkTier|TestAccComputeInstance_diskEncryptionRestart|TestAccComputeInstance_diskEncryption You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=152361" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests have passed! Thanks so much!
Thanks |
Fixes: hashicorp/terraform-provider-google#7064
Fixes: hashicorp/terraform-provider-google#7351
Part of: hashicorp/terraform-provider-google#7332
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)