Commit Graph

124 Commits

Author SHA1 Message Date
Wiktor Niesiobędzki
bcb8a6c637 Remove ignore_changes as 16804 is fixed, add secondary ranges for GKE 2024-03-11 11:05:33 +01:00
Ludovico Magnocavallo
6941313c7d Factories refactor (#1843)
* factories refactor doc

* Adds file schema and filesystem organization

* Update 20231106-factories.md

* move factories out of blueprints and create new factories  README

* align factory in billing-account module

* align factory in dataplex-datascan module

* align factory in billing-account module

* align factory in net-firewall-policy module

* align factory in dns-response-policy module

* align factory in net-vpc-firewall module

* align factory in net-vpc module

* align factory variable names in FAST

* remove decentralized firewall blueprint

* bump terraform version

* bump module versions

* update top-level READMEs

* move project factory to modules

* fix variable names and tests

* tfdoc

* remove changelog link

* add project factory to top-level README

* fix cludrun eventarc diff

* fix README

* fix cludrun eventarc diff

---------

Co-authored-by: Simone Ruffilli <sruffilli@google.com>
2024-02-26 10:16:52 +00:00
Wiktor Niesiobędzki
bee3072568 Add support for Cloud Run v2 jobs (#1954)
Add support for Cloud Run v2 jobs

* create a separate file for service creation (service.tf) and job
  (job.tf) - for easy comparison
* add E2E tests where possibile
* remove default value for input variable `region`
* fix subnet range VPC Access Connector example
* add creation of service account for audit logs call (trigger requires
  service account)
* use provided trigger service account email in
  `local.trigger_sa_email`, so explicitly provided SA is passed to
  trigger
* set default value for vpc_connector_create.throughput.max, to match
  what is set by GCP API, as provider uses wrong default of 300 which
  results in perma-diff
* create inventory fiels for all examples

Global changes
* (tests) add input variable `project_number`, to allow assigning IAM permissions to Service Accounts in fixtures
* (tests) fix not outputting the path, when object is not found in inventory
* (tests) fix `create_e2e_sandbox.sh` - now it properly finds root of the repo

Secret Manager
* added `version_versions` output, to allow specifying versions in other modules. `versions` is sensitive and it makes it unsuitable for `for_each` values

New test fixtures
* `pubsub.tf` - creating one topic
* `secret-credential.tf` - creating Secret Manager `credential` secret
* `shared-vpc.tf` - creating two projects (host and service), and vpc in host project
* `vpc-connector.tf` - creating VPC Access Connector instance
2024-02-18 14:57:34 +01:00
Wiktor Niesiobędzki
2c9eb5795b Bum terraform to version 1.7.0 2024-02-07 17:25:11 +01:00
Luca Prete
bc506795f2 compute-vm: add resource manager tags support for instance templates (#1982) 2024-01-16 17:40:15 +00:00
Wiktor Niesiobędzki
6e24898850 Add proxy networks to e2e harness 2024-01-06 12:05:53 +01:00
Julio Castillo
fde7b76036 Allow per-module terraform fixtures (#1914)
* Allow terraform fixtures for examples

* Allow defining multiple fixtures, and named fixtures under tests/fixtures/

* Enable e2e for wiktorn

* Fix prepare_files call for e2e

* Move fixture to separate file, fix test

* Revert shallow-copying symlinks, performane penalty - 20%

* Update tfdoc.py to list used fixtures

---------

Co-authored-by: Wiktor Niesiobędzki <wiktorn@google.com>
2023-12-29 09:43:44 +00:00
Luca Prete
c4123044b7 Use new resources in GCVE module, bump up provider versions (#1941) 2023-12-21 13:23:38 +00:00
Wiktor Niesiobędzki
c24d023c23 Sync tf version to version used by tests 2023-12-12 09:43:09 +01:00
Ludovico Magnocavallo
b65c57bcc2 bump tf version (#1920) 2023-12-12 09:19:46 +01:00
Wiktor Niesiobędzki
e36b4fcec8 Merge branch 'master' into wiktorn-e2e-setup-fixes 2023-11-30 19:51:03 +01:00
Wiktor Niesiobędzki
6d68b50bc8 Review fixes 2023-11-30 17:12:12 +00:00
Thangaraju Rajasekaran
224b98c786 removed prefix and updated net-vpc shared-vpc for e2e test 2023-11-30 14:03:49 +00:00
Thangaraju Rajasekaran
d9cd46d8a7 fixed e2e test for shared-vpc and subnet-iam 2023-11-30 14:03:49 +00:00
Thangaraju Rajasekaran
a259d2cbdb formatted the file 2023-11-30 14:03:49 +00:00
Thangaraju Rajasekaran
0af5e31ca3 E2E tests for net-vpc module 2023-11-30 14:03:49 +00:00
Wiktor Niesiobędzki
3557ed8a95 Pin provider version also for setup module to prevent test failures 2023-11-30 07:44:23 +00:00
Wiktor Niesiobędzki
c5c127b9df Use TFTEST_E2E_ instead of TF_VAR variables
Use of TF_VAR variables modified results of `tests/examples` and
required setting different environment to run `tests/examples` and
`tests/examples_e2e` tests. No both can be run using the same
environment.
2023-11-30 07:43:46 +00:00
Wiktor Niesiobędzki
7dd76c1003 Additional services for Cloud Run 2023-11-18 09:58:51 +00:00
Wiktor Niesiobędzki
6ca688d694 terraform fmt 2023-11-16 11:16:26 +00:00
Wiktor Niesiobędzki
1498696b6b JIT service account for storage 2023-11-15 09:33:03 +00:00
Wiktor Niesiobędzki
03bf0b15b3 Organization module end-to-end tests (#1860)
* added tag serial to mark tests to be run serially
* always run tests using loadgroup distribution to make use of serial tag
* added end-to-end tests for organization, not adding to custom constraints as the name has to be unique
* fixed granting custom roles created in the same module call
2023-11-14 18:54:59 +01:00
Wiktor Niesiobędzki
fe485414e6 Add end-to-end tests for project module (#1823)
* Add end-to-end tests for project module
* Add inventory to data tests
* Add files to end-to-end test cases
* Review fixes - use named groups

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
2023-11-03 18:04:19 +01:00
Wiktor Niesiobędzki
d07daf966a End-to-end tests for terraform modules (#1751)
Add end-to-end tests (apply, plan, destroy) for examples.

When run, `tests/examples_e2e`:
1. Create an environment for tests to run (folder, project vpc network) 
2. For each marked example (with `e2e` tftest directive), run apply, plan, destroy
3. Verify:
* no failure in apply
* empty plan after apply
* no failure during destroy
4. When all tests are done, destroy test environment

More details in `tests/examples_e2e/README.md`
2023-10-20 09:59:52 +02:00