Commit Graph

10 Commits

Author SHA1 Message Date
The Magician
c605b0bc4b [Terraform]: Apply gofmt -s to all files managed by MM (#2676)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
Paddy Carver
1c8d56eca2 Fix the perma-diff in storage bucket ACLs.
Add a CustomDiff function to storage bucket ACLs that will ignore a diff
if the config and state have the same role_entities, even if they're in
a different order.

Fixes #1525.
2018-06-21 23:42:25 -07:00
Dana Hoffman
6d0b87ec1e
s/TestAccGoogle/TestAcc/ (#1121)
* s/TestAccGoogle/TestAcc/

* add back import

* reorder imports
2018-02-23 15:14:24 -08:00
Joe Selman
4b77dca918 Revert "Revert "Add t.Parallel to all acceptance tests (#558)""
This reverts commit 8ab9d96d25 and revives
the original commit that adds t.Parallel to all acceptance tests. It
turns out test failures were unrelated to this change (rather, they were
related to quota issues).
2017-10-12 15:07:29 -07:00
Joe Selman
8ab9d96d25 Revert "Add t.Parallel to all acceptance tests (#558)"
This reverts commit 42de44592f. It appears
there might be thread-safety issues as panics have started occuring when
parallism is ramped up. Reverting for now while investigating.
2017-10-10 17:55:34 -07:00
Joe Selman
42de44592f Add t.Parallel to all acceptance tests (#558) 2017-10-10 16:28:00 -07:00
Paddy
b343829d22 Stop fighting with the test framework.
Project number is now set through an environment variable instead of
being inferred at runtime using the API.
2017-09-15 12:53:44 -07:00
Paddy
755edf6d79 Fix make test.
Because we were instantiating a client outside of resource.TestCase, it
was being instantiated even for unit tests, which have no credentials,
causing the unit tests to fail. Sadly, this is the only way I could
figure out how to get a client inside resource.TestCase, which is very
sad making, but works.
2017-09-15 12:28:29 -07:00
Paddy
72114636da Deal with undeleatable bucket ACLs in storage.
When GCS buckets are created, they're created with a set of default
ACLs:

* `OWNER:project-owners-{project_number}`
* `OWNER:project-editors-{project_number}`
* `READER:project-viewers-{project_number}`

Normally, this would be fine, or a minor inconvenience. Terraform could
either delete them itself, or the first apply of a user would overwrite
them.

However, trying to remove the `OWNER:project-owners-{project_number}`
ACL yields an API error that the bucket owner must maintain OWNER access
to the bucket. This breaks things like `terraform destroy`, but also
means any config without that line in it will fail to apply, not just
overwrite the value.

To make matters worse, trying to *add* the
`OWNER:project-owners-{project_number}` ACL to any bucket that already
has it _also_ yields the same error about not being able to remove it.

To get around this, the storage_bucket_acl resource has been updated to
largely ignore _just this_ ACL. It will not try to add it if it already
exists, will not try to remove it at all. This does mean that Terraform
is incapable of removing this ACL from a bucket, but I'm not sure it's
possible to do that with the API, anyways.

Tests were also updated to keep the default ACLs as part of the config,
and to change the email addresses to addresses we actually own. I tried
changing to non-existant hashicorp.com email addresses, but was
rejected; only email addresses that are backed by actual Google accounts
can be used, sadly.
2017-09-15 12:03:03 -07:00
Jake Champlin
66029ac431
Transfer google provider 2017-06-06 11:58:51 -04:00