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

backend: Add service account impersonation to GCS Backend and update the docs #26837

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

alisdair
Copy link
Contributor

@alisdair alisdair commented Nov 6, 2020

0.14-targeted backport of #26700

Acceptance test output for the GCS backend
$ TF_ACC=1 go test -v ./backend/remote-state/gcs/
=== RUN   TestStateFile
=== PAUSE TestStateFile
=== RUN   TestRemoteClient
=== PAUSE TestRemoteClient
=== RUN   TestRemoteClientWithEncryption
=== PAUSE TestRemoteClientWithEncryption
=== RUN   TestRemoteLocks
=== PAUSE TestRemoteLocks
=== RUN   TestBackend
=== PAUSE TestBackend
=== RUN   TestBackendWithPrefix
=== PAUSE TestBackendWithPrefix
=== RUN   TestBackendWithEncryption
=== PAUSE TestBackendWithEncryption
=== CONT  TestStateFile
=== CONT  TestBackend
--- PASS: TestStateFile (0.00s)
=== CONT  TestRemoteLocks
=== CONT  TestRemoteClientWithEncryption
=== CONT  TestBackend
    backend_test.go:134: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2478e1755e8-testbackend"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
=== CONT  TestRemoteClientWithEncryption
    backend_test.go:80: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2478e185ba0-testremoteclientwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
=== CONT  TestRemoteClient
=== CONT  TestRemoteLocks
    backend_test.go:100: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2478e1784c8-testremotelocks"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
=== CONT  TestRemoteClient
    backend_test.go:61: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2478e1ec828-testremoteclient"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
=== CONT  TestBackend
    backend_test.go:137: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2478e1755e8-testbackend"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("")}}
2020/11/06 09:42:42 Object deleted: default.tfstate
=== CONT  TestBackendWithEncryption
--- PASS: TestRemoteClientWithEncryption (6.22s)
=== CONT  TestBackendWithEncryption
    backend_test.go:163: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2490109fb68-testbackendwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
--- PASS: TestRemoteClient (6.35s)
=== CONT  TestBackendWithPrefix
    backend_test.go:150: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f24908c8f020-testbackendwithprefix"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("test/prefix")}}
--- PASS: TestRemoteLocks (6.59s)
=== CONT  TestBackendWithEncryption
    backend_test.go:166: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f2490109fb68-testbackendwithencryption"), "encryption_key":cty.StringVal("yRyCOikXi1ZDNE0xN3yiFsJjg7LGimoLrGFcLZgQoVk="), "prefix":cty.StringVal("")}}
=== CONT  TestBackendWithPrefix
    backend_test.go:153: TestBackendConfig on *gcs.Backend with configs.synthBody{Filename:"<TestWrapConfig>", Values:map[string]cty.Value{"bucket":cty.StringVal("tf-1644f24908c8f020-testbackendwithprefix"), "encryption_key":cty.StringVal(""), "prefix":cty.StringVal("test/prefix/")}}
=== CONT  TestBackend
    backend_test.go:140: TestBackend: testing state locking for *gcs.Backend
    backend_test.go:141: TestBackend: testing state locking for *gcs.Backend
=== CONT  TestBackendWithPrefix
    backend_test.go:156: TestBackend: testing state locking for *gcs.Backend
=== CONT  TestBackendWithEncryption
    backend_test.go:169: TestBackend: testing state locking for *gcs.Backend
2020/11/06 09:42:55 Object deleted: bar.tfstate
2020/11/06 09:42:55 Object deleted: default.tfstate
--- PASS: TestBackend (20.06s)
2020/11/06 09:42:56 Object deleted: test/prefix/bar.tfstate
2020/11/06 09:42:56 Object deleted: bar.tfstate
2020/11/06 09:42:56 Object deleted: test/prefix/default.tfstate
2020/11/06 09:42:57 Object deleted: default.tfstate
--- PASS: TestBackendWithPrefix (14.58s)
--- PASS: TestBackendWithEncryption (15.27s)
PASS
ok  	github.com/hashicorp/terraform/backend/remote-state/gcs	23.435s

@alisdair alisdair requested a review from a team November 6, 2020 14:45
@alisdair alisdair self-assigned this Nov 6, 2020
@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #26837 into v0.14 will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted Files Coverage Δ
backend/remote-state/gcs/backend.go 0.00% <0.00%> (ø)
dag/marshal.go 53.42% <0.00%> (-1.37%) ⬇️
terraform/evaluate.go 53.11% <0.00%> (+0.41%) ⬆️
terraform/eval_apply.go 73.45% <0.00%> (+0.58%) ⬆️
internal/providercache/dir.go 71.42% <0.00%> (+6.12%) ⬆️

@alisdair alisdair merged commit b93de8f into v0.14 Nov 6, 2020
@alisdair alisdair deleted the upodroid-gcs-backend branch November 6, 2020 17:44
@ghost
Copy link

ghost commented Dec 7, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

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

Successfully merging this pull request may close these issues.

3 participants