Merge branch 'master' into fix/audit_exclusions

This commit is contained in:
Julio Castillo 2021-11-23 12:25:46 +01:00 committed by GitHub
commit dc533718e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 3732 additions and 771 deletions

4
.github/workflows/fake-key.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"type": "service_account",
"project_id": "test-only"
}

57
.github/workflows/linting.yml vendored Normal file
View File

@ -0,0 +1,57 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'Linting'
on:
pull_request:
branches:
- master
tags:
- ci
- lint
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
- name: Install dependencies
run: |
pip install -r tools/REQUIREMENTS.txt
- name: Boilerplate
id: boilerplate
run: |
python3 tools/check_boilerplate.py $GITHUB_WORKSPACE
- name: Terraform Linting Check
id: fmt
run: |
terraform fmt -recursive -check -diff $GITHUB_WORKSPACE
- name: Check documentation
id: documentation
run: |
python3 tools/check_documentation.py cloud-operations/ data-solutions/ data-solutions/data-platform-foundations/ factories/ factories/firewall-vpc-rules/ foundations/ modules/ networking/

115
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,115 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'Tests'
on:
schedule:
- cron: '45 2 * * *'
pull_request:
branches:
- master
tags:
- ci
- test
env:
PYTEST_ADDOPTS: "--color=yes"
jobs:
tests-environment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_wrapper: false
- name: Set environment
run: |
echo "GOOGLE_APPLICATION_CREDENTIALS=${GITHUB_WORKSPACE}/.github/workflows/fake-key.json" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install -r tests/requirements.txt
- name: Run tests environments
id: test-environments
run: |
pytest -vv tests/cloud_operations tests/data_solutions tests/factories tests/foundations tests/networking
tests-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_wrapper: false
- name: Set environment
run: |
echo "GOOGLE_APPLICATION_CREDENTIALS=${GITHUB_WORKSPACE}/.github/workflows/fake-key.json" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install -r tests/requirements.txt
- name: Run tests examples
id: test-examples
run: |
pytest -vv tests/examples
tests-modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.9
terraform_wrapper: false
- name: Set environment
run: |
echo "GOOGLE_APPLICATION_CREDENTIALS=${GITHUB_WORKSPACE}/.github/workflows/fake-key.json" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip install -r tests/requirements.txt
- name: Run tests modules
id: test-modules
run: |
pytest -vv tests/modules

View File

@ -3,8 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
- new `cloud-run` module
- added gVNIC support to `compute-vm` module
## [8.0.0] - 2021-10-21
- added support for GCS notifications in `gcs` module - added support for GCS notifications in `gcs` module
- added new `skip_delete` variable to `compute-vm` module
- **incompatible change** all modules and examples now require Terraform >= 1.0.0 and Google provider >= 4.0.0
## [7.0.0] - 2021-10-21 ## [7.0.0] - 2021-10-21
@ -370,7 +376,9 @@ All notable changes to this project will be documented in this file.
- merge development branch with suite of new modules and end-to-end examples - merge development branch with suite of new modules and end-to-end examples
[Unreleased]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v6.0.0...HEAD [Unreleased]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v8.0.0...HEAD
[8.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v7.0.0...v8.0.0
[7.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v6.0.0...v7.0.0
[6.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v5.1.0...v6.0.0 [6.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v5.1.0...v6.0.0
[5.1.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v5.0.0...v5.1.0 [5.1.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v5.0.0...v5.1.0
[5.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v4.9.0...v5.0.0 [5.0.0]: https://github.com/terraform-google-modules/cloud-foundation-fabric/compare/v4.9.0...v5.0.0

View File

@ -1,3 +1,7 @@
<p align="center">
<img src="assets/logos/fabric-logo-colors-800.png?raw=true" alt="Cloud Foundation Fabric">
</p>
# Terraform Examples and Modules for Google Cloud # Terraform Examples and Modules for Google Cloud
This repository provides **end-to-end examples** and a **suite of Terraform modules** for Google Cloud, which support different use cases: This repository provides **end-to-end examples** and a **suite of Terraform modules** for Google Cloud, which support different use cases:
@ -41,6 +45,6 @@ Currently available modules:
- **data** - [GCS](./modules/gcs), [BigQuery dataset](./modules/bigquery-dataset), [Pub/Sub](./modules/pubsub), [Datafusion](./modules/datafusion), [Bigtable instance](./modules/bigtable-instance), [Cloud SQL instance](./modules/cloudsql-instance) - **data** - [GCS](./modules/gcs), [BigQuery dataset](./modules/bigquery-dataset), [Pub/Sub](./modules/pubsub), [Datafusion](./modules/datafusion), [Bigtable instance](./modules/bigtable-instance), [Cloud SQL instance](./modules/cloudsql-instance)
- **development** - [Cloud Source Repository](./modules/source-repository), [Container Registry](./modules/container-registry), [Artifact Registry](./modules/artifact-registry), [Apigee Organization](./modules/apigee-organization), [Apigee X Instance](./modules/apigee-x-instance) - **development** - [Cloud Source Repository](./modules/source-repository), [Container Registry](./modules/container-registry), [Artifact Registry](./modules/artifact-registry), [Apigee Organization](./modules/apigee-organization), [Apigee X Instance](./modules/apigee-x-instance)
- **security** - [KMS](./modules/kms), [SecretManager](./modules/secret-manager), [VPC Service Control](./modules/vpc-sc) - **security** - [KMS](./modules/kms), [SecretManager](./modules/secret-manager), [VPC Service Control](./modules/vpc-sc)
- **serverless** - [Cloud Function](./modules/cloud-function) - **serverless** - [Cloud Function](./modules/cloud-function), [Cloud Run](./modules/cloud-run)
For more information and usage examples see each module's README file. For more information and usage examples see each module's README file.

3
assets/logos/README.md Normal file
View File

@ -0,0 +1,3 @@
# Logo Specifications
- [font used](https://fonts.google.com/specimen/Encode+Sans+Condensed?category=Sans+Serif,Display&query=condensed&preview.text=fabric&preview.text_type=custom&preview.size=72)

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -0,0 +1,224 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="269.54245mm"
height="90.242683mm"
viewBox="0 0 269.54245 90.242683"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (c3084ef, 2021-09-22)"
sodipodi:docname="fabric6.svg"
inkscape:export-filename="/Users/taneli/Downloads/fabric-v5-colors.png"
inkscape:export-xdpi="959.14001"
inkscape:export-ydpi="959.14001"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="1.0532937"
inkscape:cx="371.2165"
inkscape:cy="160.92378"
inkscape:window-width="1912"
inkscape:window-height="1031"
inkscape:window-x="730"
inkscape:window-y="1073"
inkscape:window-maximized="0"
inkscape:current-layer="g69"
width="327mm"
inkscape:snap-text-baseline="false"
fit-margin-top="3"
fit-margin-left="3"
fit-margin-right="3"
fit-margin-bottom="3">
<sodipodi:guide
position="-126.64334,3.7372968"
orientation="0,-1"
id="guide3222" />
<sodipodi:guide
position="103.8518,49.175409"
orientation="1,0"
id="guide4846" />
<sodipodi:guide
position="268.25514,233.40629"
orientation="1,0"
id="guide6498" />
<sodipodi:guide
position="-44.85474,109.89724"
orientation="0,-1"
id="guide6500" />
<sodipodi:guide
position="-78.726787,57.84995"
orientation="0,-1"
id="guide6504" />
<sodipodi:guide
position="150.46983,86.8631"
orientation="0,-1"
id="guide5083" />
<sodipodi:guide
position="283.53887,-170.16673"
orientation="1,0"
id="guide8087" />
<sodipodi:guide
position="109.89313,98.096141"
orientation="1,0"
id="guide185" />
<sodipodi:guide
position="268.25514,43.084189"
orientation="1,0"
id="guide187" />
</sodipodi:namedview>
<defs
id="defs2">
<rect
x="518.32623"
y="359.08142"
width="621.36694"
height="204.52026"
id="rect4797" />
<rect
x="530.81598"
y="227.93863"
width="505.8364"
height="110.84687"
id="rect3842" />
<rect
x="507.39764"
y="334.10184"
width="766.56073"
height="380.93854"
id="rect1006" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath73">
<path
d="M 0,0 H 4500 V 4046.2 H 0 Z"
id="path71" />
</clipPath>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-33.288676,-62.614224)">
<g
id="g69"
clip-path="url(#clipPath73)"
transform="matrix(0.02052161,0,0,-0.02052161,36.288676,149.02833)"
inkscape:label="logo">
<path
d="M 544.949,1039.82 V 119.012 C 544.949,53.5508 597.98,0 661.305,0 726.109,0 779.133,53.5508 779.133,119.012 v 867.25 c -50.074,35.698 -114.879,53.558 -210.613,53.558 -7.368,0 -16.2,0 -23.571,0"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path75" />
<path
d="M 544.949,3439.27 V 1506.91 c 7.371,1.49 16.203,1.49 23.571,1.49 75.113,0 144.335,-5.95 210.613,-19.33 v 1896.65 c -50.074,35.7 -114.879,53.55 -210.613,53.55 -7.368,0 -16.2,0 -23.571,0"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path77" />
<path
d="M 3693.85,1517.33 V 119.012 C 3693.85,53.5508 3746.87,0 3811.67,0 c 63.34,0 116.36,53.5508 116.36,119.012 V 1499.48 c -8.84,0 -16.2,0 -25.04,0 -73.64,0 -142.86,5.94 -209.14,17.85"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path79" />
<path
d="m 3928.03,1968.06 v 1960.62 c 0,65.46 -53.02,117.52 -116.36,117.52 -64.8,0 -117.82,-52.06 -117.82,-117.52 V 2021.62 c 50.08,-35.72 113.41,-55.05 209.14,-55.05 8.84,0 16.2,0 25.04,1.49"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path81" />
<path
d="M 1595.07,1502.45 V 119.012 C 1595.07,53.5508 1646.63,0 1711.43,0 c 64.8,0 116.35,53.5508 116.35,119.012 V 1508.4 c -47.13,-5.95 -95.73,-8.92 -147.28,-8.92 -29.46,0 -57.44,0 -85.43,2.97"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path83" />
<path
d="m 1827.78,1988.88 v 1939.8 c 0,65.46 -51.55,117.52 -116.35,117.52 -64.8,0 -116.36,-52.06 -116.36,-117.52 V 1972.52 c 25.04,-2.97 53.03,-5.95 85.43,-5.95 60.38,0 108.99,7.44 147.28,22.31"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path85" />
<path
d="M 2645.2,1018.99 V 119.012 C 2645.2,53.5508 2696.75,0 2761.55,0 c 63.33,0 116.35,53.5508 116.35,119.012 v 914.848 c -25.03,4.46 -54.49,5.96 -85.42,5.96 -60.39,0 -108.99,-7.44 -147.28,-20.83"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path87" />
<path
d="M 2645.2,3418.44 V 1499.48 c 47.13,5.94 95.73,8.92 147.28,8.92 29.45,0 57.44,-1.49 85.42,-2.98 v 1927.9 c -25.03,4.46 -54.49,5.95 -85.42,5.95 -60.39,0 -108.99,-7.44 -147.28,-20.83"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path89" />
<path
d="m 2877.9,3904.88 v 23.8 c 0,65.46 -53.02,117.52 -116.35,117.52 -64.8,0 -116.35,-52.06 -116.35,-117.52 v -29.75 c 47.13,5.95 95.73,8.93 147.28,8.93 29.45,0 57.44,-1.49 85.42,-2.98"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path91" />
<path
d="m 223.879,2204.58 c 22.09,22.32 47.129,43.14 75.109,60.99 27.985,17.85 58.91,32.73 91.321,44.63 67.75,25.29 103.093,101.15 78.054,169.58 -23.562,68.43 -98.675,104.13 -166.429,78.85 -50.075,-17.85 -98.676,-41.65 -142.864,-69.92 -44.183,-28.27 -85.4216,-62.48 -122.238,-98.18 -50.0781,-52.07 -48.6093,-135.37 1.4649,-187.43 51.5508,-50.59 134.0311,-50.59 185.5821,1.48"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path93" />
<path
d="m 223.879,3405.05 c 41.238,41.65 92.785,75.87 151.695,99.67 58.914,23.8 123.723,37.19 192.946,37.19 278.367,0 360.835,-151.73 441.85,-301.97 76.58,-139.84 151.7,-281.16 328.43,-367.44 63.33,-32.72 142.87,-5.94 173.8,59.51 32.4,65.45 5.89,144.29 -58.91,177.02 -101.63,50.58 -157.6,153.22 -215.04,257.35 -117.82,220.16 -237.13,438.83 -670.13,438.83 -100.157,0 -198.832,-19.33 -288.676,-55.04 -92.789,-37.19 -175.27,-92.22 -243.012,-160.65 -50.0781,-52.07 -48.6093,-135.38 1.4649,-185.95 51.5508,-52.06 134.0311,-50.58 185.5821,1.48"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path95" />
<path
d="m 2369.78,2485.74 c -122.25,-87.77 -185.57,-203.8 -247.44,-319.84 -82.47,-150.24 -163.48,-300.49 -441.84,-300.49 -278.37,0 -359.37,150.25 -441.85,300.49 -47.13,87.78 -94.26,174.06 -167.9,251.4 -50.08,52.07 -132.551,53.56 -184.102,2.99 -51.55,-52.07 -53.027,-135.37 -2.949,-187.44 50.078,-52.06 88.375,-121.99 126.671,-191.9 119.29,-220.16 238.59,-440.32 670.13,-440.32 433.01,0 550.83,220.16 670.13,440.32 48.6,87.77 97.21,177.02 170.85,230.58 58.92,41.65 72.17,124.95 30.93,184.45 -42.71,58.02 -123.71,72.89 -182.63,29.76"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path97" />
<path
d="m 4269.73,2024.58 c -39.78,-49.09 -94.27,-87.76 -156.13,-116.02 -63.34,-28.26 -134.03,-43.15 -210.61,-43.15 -276.89,0 -359.37,150.25 -440.37,300.49 -76.59,141.32 -151.7,281.15 -328.44,368.93 -64.8,31.23 -142.87,4.46 -173.8,-59.51 -32.4,-65.45 -5.89,-144.29 58.92,-177.02 101.62,-50.58 157.58,-154.7 213.55,-257.35 119.31,-220.16 238.61,-440.32 670.14,-440.32 111.93,0 217.98,23.8 313.71,66.94 98.68,43.14 185.58,107.1 253.33,187.43 45.65,55.04 38.29,138.35 -16.2,185.95 -55.97,46.11 -136.98,38.67 -184.1,-16.37"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path99" />
<path
d="m 3462.62,966.93 c -119.31,220.15 -238.61,438.83 -670.14,438.83 -433.01,0 -552.31,-218.68 -670.14,-438.83 -48.59,-89.258 -97.2,-178.52 -170.84,-232.071 -58.92,-41.648 -72.17,-123.468 -30.93,-182.968 42.71,-59.5 123.71,-72.891 182.63,-31.243 122.24,89.262 185.57,203.801 247.43,319.832 81.01,150.25 163.49,301.98 441.85,301.98 278.36,0 359.37,-151.73 440.37,-301.98 47.13,-86.281 94.27,-174.05 169.38,-249.91 50.07,-52.07 132.56,-53.55 184.1,-2.98 51.55,50.582 53.03,133.89 2.95,185.949 -50.08,52.063 -88.37,121.981 -126.66,193.391"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path101" />
<path
d="m 2103.2,2920.1 c 122.24,89.26 185.57,203.8 247.43,319.84 81.01,150.24 163.49,301.97 441.85,301.97 278.36,0 359.37,-151.73 440.37,-301.97 47.13,-86.28 94.27,-174.06 169.38,-249.92 50.07,-52.07 132.56,-53.55 184.1,-2.97 51.55,50.57 53.03,133.88 2.95,185.94 -50.08,52.07 -88.37,121.99 -126.66,193.39 -119.31,220.16 -238.61,438.83 -670.14,438.83 -433.01,0 -552.31,-218.67 -670.14,-438.83 -48.59,-89.25 -97.2,-178.52 -170.84,-232.07 -58.92,-41.65 -72.17,-123.47 -30.93,-182.97 42.71,-59.5 123.71,-72.89 182.63,-31.24"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path103" />
<path
d="m 1453.69,709.57 c -101.63,50.578 -157.6,153.231 -215.04,257.36 -117.82,220.15 -237.13,438.83 -670.13,438.83 -100.157,0 -198.832,-19.34 -288.676,-55.04 -92.789,-37.19 -175.27,-92.24 -243.012,-160.66 -50.0781,-52.07 -48.6093,-135.37 1.4649,-185.95 51.5508,-52.059 134.0311,-50.579 185.5821,1.49 41.238,41.65 92.785,75.87 151.695,99.67 58.914,23.8 123.723,37.19 192.946,37.19 278.367,0 360.835,-151.73 441.85,-301.98 76.58,-139.832 151.7,-281.152 328.43,-367.429 63.33,-32.731 142.87,-5.949 173.8,59.5 32.4,65.449 5.89,144.289 -58.91,177.019"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path105" />
<path
d="m 4269.73,824.121 c -22.1,-26.781 -50.08,-52.07 -82.49,-72.902 -30.93,-22.309 -67.75,-41.649 -104.56,-55.028 -67.76,-25.3 -103.11,-99.671 -78.07,-168.101 23.56,-68.43 98.68,-104.129 166.43,-78.84 58.91,20.82 114.88,49.082 163.49,83.301 50.07,34.211 95.72,75.867 135.5,121.988 45.65,56.52 38.29,139.832 -16.2,185.941 -55.97,46.122 -136.98,40.161 -184.1,-16.359"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path107" />
<path
d="m 4171.04,2848.71 c 58.91,20.82 114.88,49.09 163.49,83.3 50.07,34.21 95.72,75.87 135.5,121.98 45.65,56.52 38.29,139.83 -16.2,185.95 -55.97,46.11 -136.98,40.16 -184.1,-16.37 -22.1,-26.78 -50.08,-52.06 -82.49,-72.89 -30.93,-22.32 -67.75,-41.65 -104.56,-55.04 -67.76,-25.29 -103.11,-99.67 -78.07,-168.1 23.56,-68.42 98.68,-104.13 166.43,-78.83"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path109" />
<path
d="m 779.133,3888.52 v 40.16 c 0,65.46 -53.024,117.52 -117.828,117.52 -63.325,0 -116.356,-52.06 -116.356,-117.52 v -22.31 c 7.371,1.49 16.203,1.49 23.571,1.49 75.113,0 144.335,-5.96 210.613,-19.34"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path111" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:21.8722px;line-height:1.25;font-family:sans-serif;letter-spacing:1.50812px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="142.11089"
y="83.505684"
id="text4002"
inkscape:label="cloud foundation"><tspan
sodipodi:role="line"
id="tspan4000"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:condensed;font-size:21.8722px;font-family:'Encode Sans Condensed';-inkscape-font-specification:'Encode Sans Condensed, Light Condensed';stroke-width:0.264583"
x="142.11089"
y="83.505684">cloud foundation</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:70.5556px;line-height:1.25;font-family:sans-serif;letter-spacing:1.98438px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="136.81929"
y="149.15135"
id="text14979"
inkscape:label="fabric"
sodipodi:insensitive="true"><tspan
sodipodi:role="line"
id="tspan14977"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:condensed;font-size:70.5556px;font-family:'Encode Sans Condensed';-inkscape-font-specification:'Encode Sans Condensed, Medium Condensed';stroke-width:0.264583"
x="136.81929"
y="149.15135">fabric</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View File

@ -0,0 +1,224 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="269.54251mm"
height="90.242683mm"
viewBox="0 0 269.54251 90.242683"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (c3084ef, 2021-09-22)"
sodipodi:docname="fabric6-colors.svg"
inkscape:export-filename="/Users/taneli/Downloads/fabric-v5.png"
inkscape:export-xdpi="959.14001"
inkscape:export-ydpi="959.14001"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="1.0532937"
inkscape:cx="370.2671"
inkscape:cy="160.92378"
inkscape:window-width="1912"
inkscape:window-height="1031"
inkscape:window-x="730"
inkscape:window-y="1073"
inkscape:window-maximized="0"
inkscape:current-layer="g69"
width="327mm"
inkscape:snap-text-baseline="false"
fit-margin-top="3"
fit-margin-left="3"
fit-margin-right="3"
fit-margin-bottom="3">
<sodipodi:guide
position="-126.64334,3.7372965"
orientation="0,-1"
id="guide3222" />
<sodipodi:guide
position="103.85181,49.175409"
orientation="1,0"
id="guide4846" />
<sodipodi:guide
position="268.25514,233.40628"
orientation="1,0"
id="guide6498" />
<sodipodi:guide
position="-44.85474,109.89724"
orientation="0,-1"
id="guide6500" />
<sodipodi:guide
position="-78.726787,57.849949"
orientation="0,-1"
id="guide6504" />
<sodipodi:guide
position="150.46984,86.8631"
orientation="0,-1"
id="guide5083" />
<sodipodi:guide
position="283.53887,-170.16673"
orientation="1,0"
id="guide8087" />
<sodipodi:guide
position="109.89314,98.09614"
orientation="1,0"
id="guide185" />
<sodipodi:guide
position="268.25514,43.084189"
orientation="1,0"
id="guide187" />
</sodipodi:namedview>
<defs
id="defs2">
<rect
x="518.32623"
y="359.08142"
width="621.36694"
height="204.52026"
id="rect4797" />
<rect
x="530.81598"
y="227.93863"
width="505.8364"
height="110.84687"
id="rect3842" />
<rect
x="507.39764"
y="334.10184"
width="766.56073"
height="380.93854"
id="rect1006" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath73">
<path
d="M 0,0 H 4500 V 4046.2 H 0 Z"
id="path71" />
</clipPath>
</defs>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-33.288676,-62.614224)">
<g
id="g69"
clip-path="url(#clipPath73)"
transform="matrix(0.02052161,0,0,-0.02052161,36.288676,149.02833)"
inkscape:label="logo">
<path
d="M 544.949,1039.82 V 119.012 C 544.949,53.5508 597.98,0 661.305,0 726.109,0 779.133,53.5508 779.133,119.012 v 867.25 c -50.074,35.698 -114.879,53.558 -210.613,53.558 -7.368,0 -16.2,0 -23.571,0"
style="fill:#4285f4;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path75" />
<path
d="M 544.949,3439.27 V 1506.91 c 7.371,1.49 16.203,1.49 23.571,1.49 75.113,0 144.335,-5.95 210.613,-19.33 v 1896.65 c -50.074,35.7 -114.879,53.55 -210.613,53.55 -7.368,0 -16.2,0 -23.571,0"
style="fill:#4285f4;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path77" />
<path
d="M 3693.85,1517.33 V 119.012 C 3693.85,53.5508 3746.87,0 3811.67,0 c 63.34,0 116.36,53.5508 116.36,119.012 V 1499.48 c -8.84,0 -16.2,0 -25.04,0 -73.64,0 -142.86,5.94 -209.14,17.85"
style="fill:#34a853;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path79" />
<path
d="m 3928.03,1968.06 v 1960.62 c 0,65.46 -53.02,117.52 -116.36,117.52 -64.8,0 -117.82,-52.06 -117.82,-117.52 V 2021.62 c 50.08,-35.72 113.41,-55.05 209.14,-55.05 8.84,0 16.2,0 25.04,1.49"
style="fill:#34a853;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path81" />
<path
d="M 1595.07,1502.45 V 119.012 C 1595.07,53.5508 1646.63,0 1711.43,0 c 64.8,0 116.35,53.5508 116.35,119.012 V 1508.4 c -47.13,-5.95 -95.73,-8.92 -147.28,-8.92 -29.46,0 -57.44,0 -85.43,2.97"
style="fill:#ea4335;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path83" />
<path
d="m 1827.78,1988.88 v 1939.8 c 0,65.46 -51.55,117.52 -116.35,117.52 -64.8,0 -116.36,-52.06 -116.36,-117.52 V 1972.52 c 25.04,-2.97 53.03,-5.95 85.43,-5.95 60.38,0 108.99,7.44 147.28,22.31"
style="fill:#ea4335;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path85" />
<path
d="M 2645.2,1018.99 V 119.012 C 2645.2,53.5508 2696.75,0 2761.55,0 c 63.33,0 116.35,53.5508 116.35,119.012 v 914.848 c -25.03,4.46 -54.49,5.96 -85.42,5.96 -60.39,0 -108.99,-7.44 -147.28,-20.83"
style="fill:#fbbc05;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path87" />
<path
d="M 2645.2,3418.44 V 1499.48 c 47.13,5.94 95.73,8.92 147.28,8.92 29.45,0 57.44,-1.49 85.42,-2.98 v 1927.9 c -25.03,4.46 -54.49,5.95 -85.42,5.95 -60.39,0 -108.99,-7.44 -147.28,-20.83"
style="fill:#fbbc05;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path89" />
<path
d="m 2877.9,3904.88 v 23.8 c 0,65.46 -53.02,117.52 -116.35,117.52 -64.8,0 -116.35,-52.06 -116.35,-117.52 v -29.75 c 47.13,5.95 95.73,8.93 147.28,8.93 29.45,0 57.44,-1.49 85.42,-2.98"
style="fill:#fbbc05;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path91" />
<path
d="m 223.879,2204.58 c 22.09,22.32 47.129,43.14 75.109,60.99 27.985,17.85 58.91,32.73 91.321,44.63 67.75,25.29 103.093,101.15 78.054,169.58 -23.562,68.43 -98.675,104.13 -166.429,78.85 -50.075,-17.85 -98.676,-41.65 -142.864,-69.92 -44.183,-28.27 -85.4216,-62.48 -122.238,-98.18 -50.0781,-52.07 -48.6093,-135.37 1.4649,-187.43 51.5508,-50.59 134.0311,-50.59 185.5821,1.48"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path93" />
<path
d="m 223.879,3405.05 c 41.238,41.65 92.785,75.87 151.695,99.67 58.914,23.8 123.723,37.19 192.946,37.19 278.367,0 360.835,-151.73 441.85,-301.97 76.58,-139.84 151.7,-281.16 328.43,-367.44 63.33,-32.72 142.87,-5.94 173.8,59.51 32.4,65.45 5.89,144.29 -58.91,177.02 -101.63,50.58 -157.6,153.22 -215.04,257.35 -117.82,220.16 -237.13,438.83 -670.13,438.83 -100.157,0 -198.832,-19.33 -288.676,-55.04 -92.789,-37.19 -175.27,-92.22 -243.012,-160.65 -50.0781,-52.07 -48.6093,-135.38 1.4649,-185.95 51.5508,-52.06 134.0311,-50.58 185.5821,1.48"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path95" />
<path
d="m 2369.78,2485.74 c -122.25,-87.77 -185.57,-203.8 -247.44,-319.84 -82.47,-150.24 -163.48,-300.49 -441.84,-300.49 -278.37,0 -359.37,150.25 -441.85,300.49 -47.13,87.78 -94.26,174.06 -167.9,251.4 -50.08,52.07 -132.551,53.56 -184.102,2.99 -51.55,-52.07 -53.027,-135.37 -2.949,-187.44 50.078,-52.06 88.375,-121.99 126.671,-191.9 119.29,-220.16 238.59,-440.32 670.13,-440.32 433.01,0 550.83,220.16 670.13,440.32 48.6,87.77 97.21,177.02 170.85,230.58 58.92,41.65 72.17,124.95 30.93,184.45 -42.71,58.02 -123.71,72.89 -182.63,29.76"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path97" />
<path
d="m 4269.73,2024.58 c -39.78,-49.09 -94.27,-87.76 -156.13,-116.02 -63.34,-28.26 -134.03,-43.15 -210.61,-43.15 -276.89,0 -359.37,150.25 -440.37,300.49 -76.59,141.32 -151.7,281.15 -328.44,368.93 -64.8,31.23 -142.87,4.46 -173.8,-59.51 -32.4,-65.45 -5.89,-144.29 58.92,-177.02 101.62,-50.58 157.58,-154.7 213.55,-257.35 119.31,-220.16 238.61,-440.32 670.14,-440.32 111.93,0 217.98,23.8 313.71,66.94 98.68,43.14 185.58,107.1 253.33,187.43 45.65,55.04 38.29,138.35 -16.2,185.95 -55.97,46.11 -136.98,38.67 -184.1,-16.37"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path99" />
<path
d="m 3462.62,966.93 c -119.31,220.15 -238.61,438.83 -670.14,438.83 -433.01,0 -552.31,-218.68 -670.14,-438.83 -48.59,-89.258 -97.2,-178.52 -170.84,-232.071 -58.92,-41.648 -72.17,-123.468 -30.93,-182.968 42.71,-59.5 123.71,-72.891 182.63,-31.243 122.24,89.262 185.57,203.801 247.43,319.832 81.01,150.25 163.49,301.98 441.85,301.98 278.36,0 359.37,-151.73 440.37,-301.98 47.13,-86.281 94.27,-174.05 169.38,-249.91 50.07,-52.07 132.56,-53.55 184.1,-2.98 51.55,50.582 53.03,133.89 2.95,185.949 -50.08,52.063 -88.37,121.981 -126.66,193.391"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path101" />
<path
d="m 2103.2,2920.1 c 122.24,89.26 185.57,203.8 247.43,319.84 81.01,150.24 163.49,301.97 441.85,301.97 278.36,0 359.37,-151.73 440.37,-301.97 47.13,-86.28 94.27,-174.06 169.38,-249.92 50.07,-52.07 132.56,-53.55 184.1,-2.97 51.55,50.57 53.03,133.88 2.95,185.94 -50.08,52.07 -88.37,121.99 -126.66,193.39 -119.31,220.16 -238.61,438.83 -670.14,438.83 -433.01,0 -552.31,-218.67 -670.14,-438.83 -48.59,-89.25 -97.2,-178.52 -170.84,-232.07 -58.92,-41.65 -72.17,-123.47 -30.93,-182.97 42.71,-59.5 123.71,-72.89 182.63,-31.24"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path103" />
<path
d="m 1453.69,709.57 c -101.63,50.578 -157.6,153.231 -215.04,257.36 -117.82,220.15 -237.13,438.83 -670.13,438.83 -100.157,0 -198.832,-19.34 -288.676,-55.04 -92.789,-37.19 -175.27,-92.24 -243.012,-160.66 -50.0781,-52.07 -48.6093,-135.37 1.4649,-185.95 51.5508,-52.059 134.0311,-50.579 185.5821,1.49 41.238,41.65 92.785,75.87 151.695,99.67 58.914,23.8 123.723,37.19 192.946,37.19 278.367,0 360.835,-151.73 441.85,-301.98 76.58,-139.832 151.7,-281.152 328.43,-367.429 63.33,-32.731 142.87,-5.949 173.8,59.5 32.4,65.449 5.89,144.289 -58.91,177.019"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path105" />
<path
d="m 4269.73,824.121 c -22.1,-26.781 -50.08,-52.07 -82.49,-72.902 -30.93,-22.309 -67.75,-41.649 -104.56,-55.028 -67.76,-25.3 -103.11,-99.671 -78.07,-168.101 23.56,-68.43 98.68,-104.129 166.43,-78.84 58.91,20.82 114.88,49.082 163.49,83.301 50.07,34.211 95.72,75.867 135.5,121.988 45.65,56.52 38.29,139.832 -16.2,185.941 -55.97,46.122 -136.98,40.161 -184.1,-16.359"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path107" />
<path
d="m 4171.04,2848.71 c 58.91,20.82 114.88,49.09 163.49,83.3 50.07,34.21 95.72,75.87 135.5,121.98 45.65,56.52 38.29,139.83 -16.2,185.95 -55.97,46.11 -136.98,40.16 -184.1,-16.37 -22.1,-26.78 -50.08,-52.06 -82.49,-72.89 -30.93,-22.32 -67.75,-41.65 -104.56,-55.04 -67.76,-25.29 -103.11,-99.67 -78.07,-168.1 23.56,-68.42 98.68,-104.13 166.43,-78.83"
style="fill:#191817;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path109" />
<path
d="m 779.133,3888.52 v 40.16 c 0,65.46 -53.024,117.52 -117.828,117.52 -63.325,0 -116.356,-52.06 -116.356,-117.52 v -22.31 c 7.371,1.49 16.203,1.49 23.571,1.49 75.113,0 144.335,-5.96 210.613,-19.34"
style="fill:#4285f4;fill-opacity:1;fill-rule:evenodd;stroke:none"
id="path111" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:21.8722px;line-height:1.25;font-family:sans-serif;letter-spacing:1.50812px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="142.11089"
y="83.505684"
id="text4002"
inkscape:label="cloud foundation"><tspan
sodipodi:role="line"
id="tspan4000"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:condensed;font-size:21.8722px;font-family:'Encode Sans Condensed';-inkscape-font-specification:'Encode Sans Condensed, Light Condensed';stroke-width:0.264583"
x="142.11089"
y="83.505684">cloud foundation</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:70.5556px;line-height:1.25;font-family:sans-serif;letter-spacing:1.98438px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264583"
x="136.81929"
y="149.15135"
id="text14979"
inkscape:label="fabric"
sodipodi:insensitive="true"><tspan
sodipodi:role="line"
id="tspan14977"
style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:condensed;font-size:70.5556px;font-family:'Encode Sans Condensed';-inkscape-font-specification:'Encode Sans Condensed, Medium Condensed';stroke-width:0.264583"
x="136.81929"
y="149.15135">fabric</tspan></text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -90,6 +90,7 @@ module "cf" {
bundle_config = { bundle_config = {
source_dir = "cf" source_dir = "cf"
output_path = var.bundle_path output_path = var.bundle_path
excludes = null
} }
service_account = module.service-account.email service_account = module.service-account.email
trigger_config = { trigger_config = {
@ -109,7 +110,6 @@ module "simple-vm-example" {
subnetwork = try(module.vpc.subnet_self_links["${var.region}/${var.name}-default"], "") subnetwork = try(module.vpc.subnet_self_links["${var.region}/${var.name}-default"], "")
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
tags = ["${var.project_id}-test-feed", "shared-test-feed"] tags = ["${var.project_id}-test-feed", "shared-test-feed"]
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -111,7 +111,6 @@ module "vm-ns-editor" {
subnetwork = module.vpc.subnet_self_links["${var.region}/${var.name}-default"] subnetwork = module.vpc.subnet_self_links["${var.region}/${var.name}-default"]
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
metadata = { startup-script = local.startup-script } metadata = { startup-script = local.startup-script }
service_account_create = true service_account_create = true
@ -128,7 +127,6 @@ module "vm-svc-editor" {
subnetwork = module.vpc.subnet_self_links["${var.region}/${var.name}-default"] subnetwork = module.vpc.subnet_self_links["${var.region}/${var.name}-default"]
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
metadata = { startup-script = local.startup-script } metadata = { startup-script = local.startup-script }
service_account_create = true service_account_create = true

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -27,7 +27,6 @@ module "vm1" {
subnetwork = module.shared-vpc.subnet_self_links["${var.region}/subnet-01"] subnetwork = module.shared-vpc.subnet_self_links["${var.region}/subnet-01"]
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
tags = ["test-dns"] tags = ["test-dns"]
} }
@ -42,7 +41,6 @@ module "vm2" {
subnetwork = module.shared-vpc.subnet_self_links["${var.region}/subnet-01"] subnetwork = module.shared-vpc.subnet_self_links["${var.region}/subnet-01"]
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
tags = ["test-dns"] tags = ["test-dns"]
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -62,6 +62,7 @@ module "cf" {
bundle_config = { bundle_config = {
source_dir = "cf" source_dir = "cf"
output_path = var.bundle_path output_path = var.bundle_path
excludes = null
} }
# https://github.com/hashicorp/terraform-provider-archive/issues/40 # https://github.com/hashicorp/terraform-provider-archive/issues/40
# https://issuetracker.google.com/issues/155215191 # https://issuetracker.google.com/issues/155215191

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -82,6 +82,7 @@ module "cf" {
bundle_config = { bundle_config = {
source_dir = "cf" source_dir = "cf"
output_path = var.bundle_path output_path = var.bundle_path
excludes = null
} }
service_account = module.service-account.email service_account = module.service-account.email
trigger_config = { trigger_config = {

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -106,7 +106,6 @@ module "vm_example" {
subnetwork = module.vpc.subnet_self_links["${var.region}/subnet"], subnetwork = module.vpc.subnet_self_links["${var.region}/subnet"],
nat = false, nat = false,
addresses = null addresses = null
alias_ips = null
}] }]
attached_disks = [ attached_disks = [
{ {
@ -127,7 +126,7 @@ module "vm_example" {
encryption = { encryption = {
encrypt_boot = true encrypt_boot = true
disk_encryption_key_raw = null disk_encryption_key_raw = null
kms_key_self_link = module.kms.key_self_links.key-gce kms_key_self_link = module.kms.key_ids.key-gce
} }
} }
@ -140,5 +139,5 @@ module "kms-gcs" {
project_id = module.project-service.project_id project_id = module.project-service.project_id
prefix = "my-bucket-001" prefix = "my-bucket-001"
name = "kms-gcs" name = "kms-gcs"
encryption_key = module.kms.keys.key-gcs.self_link encryption_key = module.kms.keys.key-gcs.id
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,4 +1,4 @@
# Copyright 2020 Google LLC # Copyright 2021 Google LLC
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,5 +13,17 @@
# limitations under the License. # limitations under the License.
terraform { terraform {
required_version = ">= 0.13" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,20 +1,23 @@
# Copyright 2020 Google LLC /**
# * Copyright 2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License"); *
# you may not use this file except in compliance with the License. * Licensed under the Apache License, Version 2.0 (the "License");
# You may obtain a copy of the License at * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# https://www.apache.org/licenses/LICENSE-2.0 *
# * http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software *
# distributed under the License is distributed on an "AS IS" BASIS, * Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * distributed under the License is distributed on an "AS IS" BASIS,
# See the License for the specific language governing permissions and * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# limitations under the License. * See the License for the specific language governing permissions and
* limitations under the License.
*/
provider "google" { provider "google" {
impersonate_service_account = "data-platform-main@${var.project_ids.services}.iam.gserviceaccount.com" impersonate_service_account = "data-platform-main@${var.project_ids.services}.iam.gserviceaccount.com"
} }
provider "google-beta" { provider "google-beta" {
impersonate_service_account = "data-platform-main@${var.project_ids.services}.iam.gserviceaccount.com" impersonate_service_account = "data-platform-main@${var.project_ids.services}.iam.gserviceaccount.com"
} }

View File

@ -1,4 +1,4 @@
# Copyright 2020 Google LLC # Copyright 2021 Google LLC
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -13,5 +13,17 @@
# limitations under the License. # limitations under the License.
terraform { terraform {
required_version = ">= 0.13" required_version = ">= 1.0.0"
} required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -206,7 +206,6 @@ module "vm_example" {
subnetwork = module.vpc.subnet_self_links["${var.region}/${var.vpc_subnet_name}"], subnetwork = module.vpc.subnet_self_links["${var.region}/${var.vpc_subnet_name}"],
nat = false, nat = false,
addresses = null addresses = null
alias_ips = null
}] }]
attached_disks = [ attached_disks = [
{ {
@ -226,7 +225,7 @@ module "vm_example" {
encryption = { encryption = {
encrypt_boot = true encrypt_boot = true
disk_encryption_key_raw = null disk_encryption_key_raw = null
kms_key_self_link = module.kms.key_self_links.key-gce kms_key_self_link = module.kms.key_ids.key-gce
} }
metadata = { metadata = {
startup-script = local.vm-startup-script startup-script = local.vm-startup-script
@ -266,7 +265,7 @@ module "kms-gcs" {
prefix = module.project-service.project_id prefix = module.project-service.project_id
name = each.key name = each.key
iam = each.value.members iam = each.value.members
encryption_key = module.kms.keys.key-gcs.self_link encryption_key = module.kms.keys.key-gcs.id
force_destroy = true force_destroy = true
} }
@ -286,7 +285,7 @@ module "bigquery-dataset" {
reader-group = module.service-account-bq.email reader-group = module.service-account-bq.email
owner = module.service-account-bq.email owner = module.service-account-bq.email
} }
encryption_key = module.kms.keys.key-bq.self_link encryption_key = module.kms.keys.key-bq.id
tables = { tables = {
bq_import = { bq_import = {
friendly_name = "BQ import" friendly_name = "BQ import"
@ -301,7 +300,7 @@ module "bigquery-dataset" {
options = { options = {
clustering = null clustering = null
expiration_time = null expiration_time = null
encryption_key = module.kms.keys.key-bq.self_link encryption_key = module.kms.keys.key-bq.id
} }
deletion_protection = true deletion_protection = true
}, },
@ -318,7 +317,7 @@ module "bigquery-dataset" {
options = { options = {
clustering = null clustering = null
expiration_time = null expiration_time = null
encryption_key = module.kms.keys.key-bq.self_link encryption_key = module.kms.keys.key-bq.id
} }
deletion_protection = true deletion_protection = true
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

29
default-versions.tf Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,20 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.3" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -68,3 +68,4 @@ Specific modules also offer support for non-authoritative bindings (e.g. `google
## Serverless ## Serverless
- [Cloud Functions](./cloud-function) - [Cloud Functions](./cloud-function)
- [Cloud Run](./cloud-run)

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -181,7 +181,7 @@ module "bigquery-dataset" {
|---|---|:---: |:---:|:---:| |---|---|:---: |:---:|:---:|
| id | Dataset id. | <code title="">string</code> | ✓ | | | id | Dataset id. | <code title="">string</code> | ✓ | |
| project_id | Id of the project where datasets will be created. | <code title="">string</code> | ✓ | | | project_id | Id of the project where datasets will be created. | <code title="">string</code> | ✓ | |
| *access* | Map of access rules with role and identity type. Keys are arbitrary and must match those in the `access_identities` variable, types are `domain`, `group`, `special_group`, `user`, `view`. | <code title="map&#40;object&#40;&#123;&#10;role &#61; string&#10;type &#61; string&#10;&#125;&#41;&#41;">map(object({...}))</code> | | <code title="&#123;&#125;&#10;validation &#123;&#10;condition &#61; can&#40;&#91;&#10;for k, v in var.access :&#10;index&#40;&#91;&#34;OWNER&#34;, &#34;READER&#34;, &#34;WRITER&#34;&#93;, v.role&#41;&#10;&#93;&#41;&#10;error_message &#61; &#34;Access role must be one of &#39;OWNER&#39;, &#39;READER&#39;, &#39;WRITER&#39;.&#34;&#10;&#125;&#10;validation &#123;&#10;condition &#61; can&#40;&#91;&#10;for k, v in var.access :&#10;index&#40;&#91;&#34;domain&#34;, &#34;group&#34;, &#34;special_group&#34;, &#34;user&#34;, &#34;view&#34;&#93;, v.type&#41;&#10;&#93;&#41;&#10;error_message &#61; &#34;Access type must be one of &#39;domain&#39;, &#39;group&#39;, &#39;special_group&#39;, &#39;user&#39;, &#39;view&#39;.&#34;&#10;&#125;">...</code> | | *access* | Map of access rules with role and identity type. Keys are arbitrary and must match those in the `access_identities` variable, types are `domain`, `group`, `special_group`, `user`, `view`. | <code title="map&#40;object&#40;&#123;&#10;role &#61; string&#10;type &#61; string&#10;&#125;&#41;&#41;">map(object({...}))</code> | | <code title="&#123;&#125;&#10;validation &#123;&#10;condition &#61; can&#40;&#91;&#10;for k, v in var.access :&#10;index&#40;&#91;&#34;domain&#34;, &#34;group&#34;, &#34;special_group&#34;, &#34;user&#34;, &#34;view&#34;&#93;, v.type&#41;&#10;&#93;&#41;&#10;error_message &#61; &#34;Access type must be one of &#39;domain&#39;, &#39;group&#39;, &#39;special_group&#39;, &#39;user&#39;, &#39;view&#39;.&#34;&#10;&#125;">...</code> |
| *access_identities* | Map of access identities used for basic access roles. View identities have the format 'project_id|dataset_id|table_id'. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> | | *access_identities* | Map of access identities used for basic access roles. View identities have the format 'project_id|dataset_id|table_id'. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> |
| *dataset_access* | Set access in the dataset resource instead of using separate resources. | <code title="">bool</code> | | <code title="">false</code> | | *dataset_access* | Set access in the dataset resource instead of using separate resources. | <code title="">bool</code> | | <code title="">false</code> |
| *description* | Optional description. | <code title="">string</code> | | <code title="">Terraform managed.</code> | | *description* | Optional description. | <code title="">string</code> | | <code title="">Terraform managed.</code> |

View File

@ -209,5 +209,4 @@ resource "google_bigquery_table" "views" {
query = each.value.query query = each.value.query
use_legacy_sql = each.value.use_legacy_sql use_legacy_sql = each.value.use_legacy_sql
} }
} }

View File

@ -21,13 +21,6 @@ variable "access" {
type = string type = string
})) }))
default = {} default = {}
validation {
condition = can([
for k, v in var.access :
index(["OWNER", "READER", "WRITER"], v.role)
])
error_message = "Access role must be one of 'OWNER', 'READER', 'WRITER'."
}
validation { validation {
condition = can([ condition = can([
for k, v in var.access : for k, v in var.access :

View File

@ -1,23 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers { required_providers {
google = ">= 3.58" google = {
google-beta = ">= 3.58" source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,23 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.0" required_version = ">= 1.0.0"
required_providers { required_providers {
google = ">= 3.79.0" google = {
google-beta = ">= 3.79.0" source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -21,8 +21,9 @@ module "cf-http" {
name = "test-cf-http" name = "test-cf-http"
bucket_name = "test-cf-bundles" bucket_name = "test-cf-bundles"
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
} }
# tftest:skip # tftest:skip
@ -39,8 +40,9 @@ module "cf-http" {
name = "test-cf-http" name = "test-cf-http"
bucket_name = "test-cf-bundles" bucket_name = "test-cf-bundles"
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
trigger_config = { trigger_config = {
event = "google.pubsub.topic.publish" event = "google.pubsub.topic.publish"
@ -62,8 +64,9 @@ module "cf-http" {
name = "test-cf-http" name = "test-cf-http"
bucket_name = "test-cf-bundles" bucket_name = "test-cf-bundles"
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
iam = { iam = {
"roles/cloudfunctions.invoker" = ["allUsers"] "roles/cloudfunctions.invoker" = ["allUsers"]
@ -87,8 +90,9 @@ module "cf-http" {
lifecycle_delete_age = 1 lifecycle_delete_age = 1
} }
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
} }
# tftest:skip # tftest:skip
@ -105,8 +109,9 @@ module "cf-http" {
name = "test-cf-http" name = "test-cf-http"
bucket_name = "test-cf-bundles" bucket_name = "test-cf-bundles"
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
service_account_create = true service_account_create = true
} }
@ -122,21 +127,41 @@ module "cf-http" {
name = "test-cf-http" name = "test-cf-http"
bucket_name = "test-cf-bundles" bucket_name = "test-cf-bundles"
bundle_config = { bundle_config = {
source_dir = "my-cf-source-folder" source_dir = "my-cf-source-folder"
output_path = "bundle.zip" output_path = "bundle.zip"
excludes = null
} }
service_account = local.service_account_email service_account = local.service_account_email
} }
# tftest:skip # tftest:skip
``` ```
### Custom bundle config
In order to help prevent `archive_zip.output_md5` from changing cross platform (e.g. Cloud Build vs your local development environment), you'll have to make sure that the files included in the zip are always the same.
```hcl
module "cf-http" {
source = "./modules/cloud-function"
project_id = "my-project"
name = "test-cf-http"
bucket_name = "test-cf-bundles"
bundle_config = {
source_dir = "my-cf-source-folder"
output_path = "bundle.zip"
excludes = ["__pycache__"]
}
}
# tftest:skip
```
<!-- BEGIN TFDOC --> <!-- BEGIN TFDOC -->
## Variables ## Variables
| name | description | type | required | default | | name | description | type | required | default |
|---|---|:---: |:---:|:---:| |---|---|:---: |:---:|:---:|
| bucket_name | Name of the bucket that will be used for the function code. It will be created with prefix prepended if bucket_config is not null. | <code title="">string</code> | ✓ | | | bucket_name | Name of the bucket that will be used for the function code. It will be created with prefix prepended if bucket_config is not null. | <code title="">string</code> | ✓ | |
| bundle_config | Cloud function source folder and generated zip bundle paths. Output path defaults to '/tmp/bundle.zip' if null. | <code title="object&#40;&#123;&#10;source_dir &#61; string&#10;output_path &#61; string&#10;&#125;&#41;">object({...})</code> | ✓ | | | bundle_config | Cloud function source folder and generated zip bundle paths. Output path defaults to '/tmp/bundle.zip' if null. | <code title="object&#40;&#123;&#10;source_dir &#61; string&#10;output_path &#61; string&#10;excludes &#61; list&#40;string&#41;&#10;&#125;&#41;">object({...})</code> | ✓ | |
| name | Name used for cloud function and associated resources. | <code title="">string</code> | ✓ | | | name | Name used for cloud function and associated resources. | <code title="">string</code> | ✓ | |
| project_id | Project id used for all resources. | <code title="">string</code> | ✓ | | | project_id | Project id used for all resources. | <code title="">string</code> | ✓ | |
| *bucket_config* | Enable and configure auto-created bucket. Set fields to null to use defaults. | <code title="object&#40;&#123;&#10;location &#61; string&#10;lifecycle_delete_age &#61; number&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> | | *bucket_config* | Enable and configure auto-created bucket. Set fields to null to use defaults. | <code title="object&#40;&#123;&#10;location &#61; string&#10;lifecycle_delete_age &#61; number&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |

View File

@ -137,6 +137,8 @@ data "archive_file" "bundle" {
? "/tmp/bundle.zip" ? "/tmp/bundle.zip"
: var.bundle_config.output_path : var.bundle_config.output_path
) )
output_file_mode = "0666"
excludes = var.bundle_config.excludes
} }
resource "google_service_account" "service_account" { resource "google_service_account" "service_account" {

View File

@ -33,6 +33,7 @@ variable "bundle_config" {
type = object({ type = object({
source_dir = string source_dir = string
output_path = string output_path = string
excludes = list(string)
}) })
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,22 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.0" required_version = ">= 1.0.0"
required_providers { required_providers {
google = ">= 3.49" google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

243
modules/cloud-run/README.md Normal file
View File

@ -0,0 +1,243 @@
# Cloud Run Module
Cloud Run management, with support for IAM roles and optional Eventarc trigger creation.
## Examples
### Environment variables
This deploys a Cloud Run service and sets some environment variables.
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = {
command = null
args = null
env = {
"VAR1": "VALUE1",
"VAR2": "VALUE2",
}
env_from = null
}
ports = null
resources = null
volume_mounts = null
}]
}
# tftest:modules=1:resources=1
```
### Environment variables (value read from secret)
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = {
command = null
args = null
env = null
env_from = {
"CREDENTIALS": {
name = "credentials"
key = "1"
}
}
}
ports = null
resources = null
volume_mounts = null
}]
}
# tftest:modules=1:resources=1
```
### Secret mounted as volume
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = var.project_id
name = "hello"
region = var.region
revision_name = "green"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = {
"credentials": "/credentials"
}
}]
volumes = [
{
name = "credentials"
secret_name = "credentials"
items = [{
key = "1"
path = "v1.txt"
}]
}
]
}
# tftest:modules=1:resources=1
```
### Traffic split
This deploys a Cloud Run service with traffic split between two revisions.
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
revision_name = "green"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = null
}]
traffic = {
"blue" = 25
"green" = 75
}
}
# tftest:modules=1:resources=1
```
### Eventarc trigger (Pub/Sub)
This deploys a Cloud Run service that will be triggered when messages are published to Pub/Sub topics.
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = null
}]
pubsub_triggers = [
"topic1",
"topic2"
]
}
# tftest:modules=1:resources=3
```
### Eventarc trigger (Audit logs)
This deploys a Cloud Run service that will be triggered when specific log events are written to Google Cloud audit logs.
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = null
}]
audit_log_triggers = [
{
service_name = "cloudresourcemanager.googleapis.com"
method_name = "SetIamPolicy"
}
]
}
# tftest:modules=1:resources=2
```
### Service account management
To use a custom service account managed by the module, set `service_account_create` to `true` and leave `service_account` set to `null` value (default).
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = null
}]
service_account_create = true
}
# tftest:modules=1:resources=2
```
To use an externally managed service account, pass its email in `service_account` and leave `service_account_create` to `false` (the default).
```hcl
module "cloud_run" {
source = "./modules/cloud-run"
project_id = "my-project"
name = "hello"
containers = [{
image = "us-docker.pkg.dev/cloudrun/container/hello"
options = null
ports = null
resources = null
volume_mounts = null
}]
service_account = "cloud-run@my-project.iam.gserviceaccount.com"
}
# tftest:modules=1:resources=1
```
<!-- BEGIN TFDOC -->
## Variables
| name | description | type | required | default |
|---|---|:---: |:---:|:---:|
| containers | Containers | <code title="list&#40;object&#40;&#123;&#10;image &#61; string&#10;options &#61; object&#40;&#123;&#10;command &#61; list&#40;string&#41;&#10;args &#61; list&#40;string&#41;&#10;env &#61; map&#40;string&#41;&#10;env_from &#61; map&#40;object&#40;&#123;&#10;key &#61; string&#10;name &#61; string&#10;&#125;&#41;&#41;&#10;&#125;&#41;&#10;resources &#61; object&#40;&#123;&#10;limits &#61; object&#40;&#123;&#10;cpu &#61; string&#10;memory &#61; string&#10;&#125;&#41;&#10;requests &#61; object&#40;&#123;&#10;cpu &#61; string&#10;memory &#61; string&#10;&#125;&#41;&#10;&#125;&#41;&#10;ports &#61; list&#40;object&#40;&#123;&#10;name &#61; string&#10;protocol &#61; string&#10;container_port &#61; string&#10;&#125;&#41;&#41;&#10;volume_mounts &#61; map&#40;string&#41;&#10;&#125;&#41;&#41;">list(object({...}))</code> | ✓ | |
| name | Name used for cloud run service | <code title="">string</code> | ✓ | |
| project_id | Project id used for all resources. | <code title="">string</code> | ✓ | |
| *audit_log_triggers* | Event arc triggers (Audit log) | <code title="list&#40;object&#40;&#123;&#10;service_name &#61; string&#10;method_name &#61; string&#10;&#125;&#41;&#41;">list(object({...}))</code> | | <code title="">null</code> |
| *iam* | IAM bindings for Cloud Run service in {ROLE => [MEMBERS]} format. | <code title="map&#40;list&#40;string&#41;&#41;">map(list(string))</code> | | <code title="">{}</code> |
| *ingress_settings* | Ingress settings | <code title="">string</code> | | <code title="">null</code> |
| *labels* | Resource labels | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> |
| *prefix* | Optional prefix used for resource names. | <code title="">string</code> | | <code title="">null</code> |
| *pubsub_triggers* | Eventarc triggers (Pub/Sub) | <code title="list&#40;string&#41;">list(string)</code> | | <code title="">null</code> |
| *region* | Region used for all resources. | <code title="">string</code> | | <code title="">europe-west1</code> |
| *revision_name* | Revision name | <code title="">string</code> | | <code title="">null</code> |
| *service_account* | Service account email. Unused if service account is auto-created. | <code title="">string</code> | | <code title="">null</code> |
| *service_account_create* | Auto-create service account. | <code title="">bool</code> | | <code title="">false</code> |
| *traffic* | Traffic | <code title="map&#40;number&#41;">map(number)</code> | | <code title="">null</code> |
| *volumes* | Volumes | <code title="list&#40;object&#40;&#123;&#10;name &#61; string&#10;secret_name &#61; string&#10;items &#61; list&#40;object&#40;&#123;&#10;key &#61; string&#10;path &#61; string&#10;&#125;&#41;&#41;&#10;&#125;&#41;&#41;">list(object({...}))</code> | | <code title="">null</code> |
| *vpc_connector* | VPC connector configuration. Set create to 'true' if a new connecto needs to be created | <code title="object&#40;&#123;&#10;create &#61; bool&#10;name &#61; string&#10;egress_settings &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |
| *vpc_connector_config* | VPC connector network configuration. Must be provided if new VPC connector is being created | <code title="object&#40;&#123;&#10;ip_cidr_range &#61; string&#10;network &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="">null</code> |
## Outputs
| name | description | sensitive |
|---|---|:---:|
| service | Cloud Run service | |
| service_account | Service account resource. | |
| service_account_email | Service account email. | |
| service_account_iam_email | Service account email. | |
| service_name | Cloud Run service name | |
| vpc_connector | VPC connector resource if created. | |
<!-- END TFDOC -->

212
modules/cloud-run/main.tf Normal file
View File

@ -0,0 +1,212 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
locals {
prefix = var.prefix == null ? "" : "${var.prefix}-"
service_account_email = (
var.service_account_create
? (
length(google_service_account.service_account) > 0
? google_service_account.service_account[0].email
: null
)
: var.service_account
)
annotations = merge(var.ingress_settings == null ? {} : { "run.googleapis.com/ingress" = var.ingress_settings },
var.vpc_connector == null
? {}
: try(var.vpc_connector.create, false)
? { "run.googleapis.com/vpc-access-connector" = var.vpc_connector.name }
: { "run.googleapis.com/vpc-access-connector" = google_vpc_access_connector.connector.0.id }
,
try(var.vpc_connector.egress_settings, null) == null
? {}
: { "run.googleapis.com/vpc-access-egress" = var.vpc_connector.egress_settings })
}
resource "google_vpc_access_connector" "connector" {
count = try(var.vpc_connector.create, false) == false ? 0 : 1
project = var.project_id
name = var.vpc_connector.name
region = var.region
ip_cidr_range = var.vpc_connector_config.ip_cidr_range
network = var.vpc_connector_config.network
}
resource "google_cloud_run_service" "service" {
provider = google-beta
project = var.project_id
location = var.region
name = "${local.prefix}${var.name}"
template {
spec {
dynamic "containers" {
for_each = var.containers == null ? {} : { for i, container in var.containers : i => container }
content {
image = containers.value["image"]
command = try(containers.value["options"]["command"], null)
args = try(containers.value["options"]["args"], null)
dynamic "env" {
for_each = try(containers.value["options"]["env"], null) == null ? {} : containers.value["options"]["env"]
content {
name = env.key
value = env.value
}
}
dynamic "env" {
for_each = try(containers.value["options"]["env_from"], null) == null ? {} : containers.value["options"]["env_from"]
content {
name = env.key
value_from {
secret_key_ref {
name = env.value["name"]
key = env.value["key"]
}
}
}
}
dynamic "ports" {
for_each = containers.value["ports"] == null ? {} : { for port in containers.value["ports"] : "${port.name}-${port.container_port}" => port }
content {
name = ports.value["name"]
protocol = ports.value["protocol"]
container_port = ports.value["container_port"]
}
}
dynamic "resources" {
for_each = containers.value["resources"] == null ? [] : [""]
content {
limits = containers.value["resources"]["limits"]
requests = containers.value["resources"]["requests"]
}
}
dynamic "volume_mounts" {
for_each = containers.value["volume_mounts"] == null ? {} : containers.value["volume_mounts"]
content {
name = volume_mounts.key
mount_path = volume_mounts.value
}
}
}
}
service_account_name = local.service_account_email
dynamic "volumes" {
for_each = var.volumes == null ? [] : var.volumes
content {
name = volumes.value["name"]
secret {
secret_name = volumes.value["secret_name"]
dynamic "items" {
for_each = volumes.value["items"] == null ? [] : volumes.value["items"]
content {
key = items.value["key"]
path = items.value["path"]
}
}
}
}
}
}
dynamic "metadata" {
for_each = var.revision_name == null ? [] : [""]
content {
name = "${var.name}-${var.revision_name}"
}
}
}
metadata {
annotations = local.annotations
}
dynamic "traffic" {
for_each = var.traffic == null ? {} : var.traffic
content {
percent = traffic.value
revision_name = "${var.name}-${traffic.key}"
}
}
}
resource "google_cloud_run_service_iam_binding" "binding" {
for_each = var.iam
project = google_cloud_run_service.service.project
location = google_cloud_run_service.service.location
service = google_cloud_run_service.service.name
role = each.key
members = each.value
}
resource "google_service_account" "service_account" {
count = var.service_account_create ? 1 : 0
project = var.project_id
account_id = "tf-cr-${var.name}"
display_name = "Terraform Cloud Run ${var.name}."
}
resource "google_eventarc_trigger" "audit_log_triggers" {
for_each = var.audit_log_triggers == null ? {} : { for trigger in var.audit_log_triggers : "${trigger.service_name}-${trigger.method_name}" => trigger }
name = "${local.prefix}${each.key}-audit-log-trigger"
location = google_cloud_run_service.service.location
project = google_cloud_run_service.service.project
matching_criteria {
attribute = "type"
value = "google.cloud.audit.log.v1.written"
}
matching_criteria {
attribute = "serviceName"
value = each.value["service_name"]
}
matching_criteria {
attribute = "methodName"
value = each.value["method_name"]
}
destination {
cloud_run_service {
service = google_cloud_run_service.service.name
region = google_cloud_run_service.service.location
}
}
}
resource "google_eventarc_trigger" "pubsub_triggers" {
for_each = var.pubsub_triggers == null ? [] : toset(var.pubsub_triggers)
name = each.value == "" ? "${local.prefix}default-pubsub-trigger" : "${local.prefix}${each.value}-pubsub-trigger"
location = google_cloud_run_service.service.location
project = google_cloud_run_service.service.project
matching_criteria {
attribute = "type"
value = "google.cloud.pubsub.topic.v1.messagePublished"
}
dynamic "transport" {
for_each = each.value == null ? [] : [""]
content {
pubsub {
topic = each.value
}
}
}
destination {
cloud_run_service {
service = google_cloud_run_service.service.name
region = google_cloud_run_service.service.location
}
}
}

View File

@ -0,0 +1,50 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
output "service" {
description = "Cloud Run service"
value = google_cloud_run_service.service
}
output "service_account" {
description = "Service account resource."
value = try(google_service_account.service_account[0], null)
}
output "service_account_email" {
description = "Service account email."
value = local.service_account_email
}
output "service_account_iam_email" {
description = "Service account email."
value = join("", [
"serviceAccount:",
local.service_account_email == null ? "" : local.service_account_email
])
}
output "service_name" {
description = "Cloud Run service name"
value = google_cloud_run_service.service.name
}
output "vpc_connector" {
description = "VPC connector resource if created."
value = try(google_vpc_access_connector.connector.0.id, null)
}

View File

@ -0,0 +1,159 @@
/**
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
variable "audit_log_triggers" {
description = "Event arc triggers (Audit log)"
type = list(object({
service_name = string
method_name = string
}))
default = null
}
variable "containers" {
description = "Containers"
type = list(object({
image = string
options = object({
command = list(string)
args = list(string)
env = map(string)
env_from = map(object({
key = string
name = string
}))
})
resources = object({
limits = object({
cpu = string
memory = string
})
requests = object({
cpu = string
memory = string
})
})
ports = list(object({
name = string
protocol = string
container_port = string
}))
volume_mounts = map(string)
}))
}
variable "iam" {
description = "IAM bindings for Cloud Run service in {ROLE => [MEMBERS]} format."
type = map(list(string))
default = {}
}
variable "ingress_settings" {
description = "Ingress settings"
type = string
default = null
}
variable "labels" {
description = "Resource labels"
type = map(string)
default = {}
}
variable "name" {
description = "Name used for cloud run service"
type = string
}
variable "prefix" {
description = "Optional prefix used for resource names."
type = string
default = null
}
variable "project_id" {
description = "Project id used for all resources."
type = string
}
variable "pubsub_triggers" {
description = "Eventarc triggers (Pub/Sub)"
type = list(string)
default = null
}
variable "region" {
description = "Region used for all resources."
type = string
default = "europe-west1"
}
variable "revision_name" {
description = "Revision name"
type = string
default = null
}
variable "service_account" {
description = "Service account email. Unused if service account is auto-created."
type = string
default = null
}
variable "service_account_create" {
description = "Auto-create service account."
type = bool
default = false
}
variable "traffic" {
description = "Traffic"
type = map(number)
default = null
}
variable "volumes" {
description = "Volumes"
type = list(object({
name = string
secret_name = string
items = list(object({
key = string
path = string
}))
}))
default = null
}
variable "vpc_connector" {
description = "VPC connector configuration. Set create to 'true' if a new connecto needs to be created"
type = object({
create = bool
name = string
egress_settings = string
})
default = null
}
variable "vpc_connector_config" {
description = "VPC connector network configuration. Must be provided if new VPC connector is being created"
type = object({
ip_cidr_range = string
network = string
})
default = null
}

View File

@ -1,3 +1,4 @@
/** /**
* Copyright 2021 Google LLC * Copyright 2021 Google LLC
* *
@ -14,4 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
provider "google" {} terraform {
required_version = ">= 0.12.6"
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -24,7 +24,6 @@ module "nginx-template" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -71,7 +70,6 @@ module "nginx-template" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -125,7 +123,6 @@ module "nginx-template" {
subnetwork = var.subnet.self_link, subnetwork = var.subnet.self_link,
nat = false, nat = false,
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -182,7 +179,6 @@ module "nginx-template" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -235,7 +231,6 @@ module "nginx-template" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"

View File

@ -1,22 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers { required_providers {
google-beta = ">= 3.54.0" google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -24,7 +24,6 @@ module "simple-vm-example" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
service_account_create = true service_account_create = true
} }
@ -54,7 +53,6 @@ module "simple-vm-example" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
attached_disks = [{ attached_disks = [{
name = "repd-1" name = "repd-1"
@ -85,7 +83,6 @@ module "simple-vm-example" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
attached_disks = [{ attached_disks = [{
name = "repd" name = "repd"
@ -119,7 +116,6 @@ module "kms-vm-example" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
attached_disks = [ attached_disks = [
{ {
@ -147,23 +143,80 @@ module "kms-vm-example" {
### Using Alias IPs ### Using Alias IPs
This example shows how add additional [Alias IPs](https://cloud.google.com/vpc/docs/alias-ip) to your VM. This example shows how to add additional [Alias IPs](https://cloud.google.com/vpc/docs/alias-ip) to your VM.
```hcl ```hcl
module "vm-with-alias-ips" { module "vm-with-alias-ips" {
source = "./modules/compute-vm" source = "./modules/compute-vm"
project_id = "my-project" project_id = "my-project"
zone = "europe-west1-b" zone = "europe-west1-b"
name = "test" name = "test"
network_interfaces = [{ network_interfaces = [{
network = var.vpc.self_link network = var.vpc.self_link
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = {
alias1 = "10.16.0.10/32"
}
}] }]
network_interface_options = {
0 = {
alias_ips = {
alias1 = "10.16.0.10/32"
}
nic_type = null
}
}
service_account_create = true
}
# tftest:modules=1:resources=2
```
### Using gVNIC
This example shows how to enable [gVNIC](https://cloud.google.com/compute/docs/networking/using-gvnic) on your VM by customizing a `cos` image. Given that gVNIC needs to be enabled as an instance configuration and as a guest os configuration, you'll need to supply a bootable disk with `guest_os_features=GVNIC`. `SEV_CAPABLE`, `UEFI_COMPATIBLE` and `VIRTIO_SCSI_MULTIQUEUE` are enabled implicitly in the `cos`, `rhel`, `centos` and other images.
```hcl
resource "google_compute_image" "cos-gvnic" {
project = "my-project"
name = "my-image"
source_image = "https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-89-16108-534-18"
guest_os_features {
type = "GVNIC"
}
guest_os_features {
type = "SEV_CAPABLE"
}
guest_os_features {
type = "UEFI_COMPATIBLE"
}
guest_os_features {
type = "VIRTIO_SCSI_MULTIQUEUE"
}
}
module "vm-with-gvnic" {
source = "./modules/compute-vm"
project_id = "my-project"
zone = "europe-west1-b"
name = "test"
boot_disk = {
image = google_compute_image.cos-gvnic.self_link
type = "pd-ssd"
size = 10
}
network_interfaces = [{
network = var.vpc.self_link
subnetwork = var.subnet.self_link
nat = false
addresses = null
}]
network_interface_options = {
0 = {
alias_ips = null
nic_type = "GVNIC"
}
}
service_account_create = true service_account_create = true
} }
# tftest:modules=1:resources=2 # tftest:modules=1:resources=2
@ -184,7 +237,6 @@ module "cos-test" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -225,7 +277,6 @@ module "instance-group" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"
@ -248,7 +299,7 @@ module "instance-group" {
| name | description | type | required | default | | name | description | type | required | default |
|---|---|:---: |:---:|:---:| |---|---|:---: |:---:|:---:|
| name | Instance name. | <code title="">string</code> | ✓ | | | name | Instance name. | <code title="">string</code> | ✓ | |
| network_interfaces | Network interfaces configuration. Use self links for Shared VPC, set addresses and alias_ips to null if not needed. | <code title="list&#40;object&#40;&#123;&#10;nat &#61; bool&#10;network &#61; string&#10;subnetwork &#61; string&#10;addresses &#61; object&#40;&#123;&#10;internal &#61; string&#10;external &#61; string&#10;&#125;&#41;&#10;alias_ips &#61; map&#40;string&#41;&#10;&#125;&#41;&#41;">list(object({...}))</code> | ✓ | | | network_interfaces | Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed. | <code title="list&#40;object&#40;&#123;&#10;nat &#61; bool&#10;network &#61; string&#10;subnetwork &#61; string&#10;addresses &#61; object&#40;&#123;&#10;internal &#61; string&#10;external &#61; string&#10;&#125;&#41;&#10;&#125;&#41;&#41;">list(object({...}))</code> | ✓ | |
| project_id | Project id. | <code title="">string</code> | ✓ | | | project_id | Project id. | <code title="">string</code> | ✓ | |
| zone | Compute zone. | <code title="">string</code> | ✓ | | | zone | Compute zone. | <code title="">string</code> | ✓ | |
| *attached_disk_defaults* | Defaults for attached disks options. | <code title="object&#40;&#123;&#10;mode &#61; string&#10;replica_zone &#61; string&#10;type &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;auto_delete &#61; true&#10;mode &#61; &#34;READ_WRITE&#34;&#10;replica_zone &#61; null&#10;type &#61; &#34;pd-balanced&#34;&#10;&#125;">...</code> | | *attached_disk_defaults* | Defaults for attached disks options. | <code title="object&#40;&#123;&#10;mode &#61; string&#10;replica_zone &#61; string&#10;type &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;auto_delete &#61; true&#10;mode &#61; &#34;READ_WRITE&#34;&#10;replica_zone &#61; null&#10;type &#61; &#34;pd-balanced&#34;&#10;&#125;">...</code> |
@ -268,6 +319,7 @@ module "instance-group" {
| *labels* | Instance labels. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> | | *labels* | Instance labels. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> |
| *metadata* | Instance metadata. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> | | *metadata* | Instance metadata. | <code title="map&#40;string&#41;">map(string)</code> | | <code title="">{}</code> |
| *min_cpu_platform* | Minimum CPU platform. | <code title="">string</code> | | <code title="">null</code> | | *min_cpu_platform* | Minimum CPU platform. | <code title="">string</code> | | <code title="">null</code> |
| *network_interface_options* | Network interfaces extended options. The key is the index of the inteface to configure. The value is an object with alias_ips and nic_type. Set alias_ips or nic_type to null if you need only one of them. | <code title="map&#40;object&#40;&#123;&#10;alias_ips &#61; map&#40;string&#41;&#10;nic_type &#61; string&#10;&#125;&#41;&#41;">map(object({...}))</code> | | <code title="">{}</code> |
| *options* | Instance options. | <code title="object&#40;&#123;&#10;allow_stopping_for_update &#61; bool&#10;deletion_protection &#61; bool&#10;preemptible &#61; bool&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;allow_stopping_for_update &#61; true&#10;deletion_protection &#61; false&#10;preemptible &#61; false&#10;&#125;">...</code> | | *options* | Instance options. | <code title="object&#40;&#123;&#10;allow_stopping_for_update &#61; bool&#10;deletion_protection &#61; bool&#10;preemptible &#61; bool&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;allow_stopping_for_update &#61; true&#10;deletion_protection &#61; false&#10;preemptible &#61; false&#10;&#125;">...</code> |
| *scratch_disks* | Scratch disks configuration. | <code title="object&#40;&#123;&#10;count &#61; number&#10;interface &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;count &#61; 0&#10;interface &#61; &#34;NVME&#34;&#10;&#125;">...</code> | | *scratch_disks* | Scratch disks configuration. | <code title="object&#40;&#123;&#10;count &#61; number&#10;interface &#61; string&#10;&#125;&#41;">object({...})</code> | | <code title="&#123;&#10;count &#61; 0&#10;interface &#61; &#34;NVME&#34;&#10;&#125;">...</code> |
| *service_account* | Service account email. Unused if service account is auto-created. | <code title="">string</code> | | <code title="">null</code> | | *service_account* | Service account email. Unused if service account is auto-created. | <code title="">string</code> | | <code title="">null</code> |

View File

@ -60,6 +60,13 @@ locals {
] ]
) )
) )
network_interface_options = {
for i, v in var.network_interfaces : i => lookup(var.network_interface_options, i, {
alias_ips = null,
nic_type = null
})
}
} }
resource "google_compute_disk" "disks" { resource "google_compute_disk" "disks" {
@ -193,13 +200,14 @@ resource "google_compute_instance" "default" {
} }
} }
dynamic "alias_ip_range" { dynamic "alias_ip_range" {
for_each = config.value.alias_ips != null ? config.value.alias_ips : {} for_each = local.network_interface_options[config.key].alias_ips != null ? local.network_interface_options[config.key].alias_ips : {}
iterator = config_alias iterator = config_alias
content { content {
subnetwork_range_name = config_alias.key subnetwork_range_name = config_alias.key
ip_cidr_range = config_alias.value ip_cidr_range = config_alias.value
} }
} }
nic_type = local.network_interface_options[config.key].nic_type
} }
} }
@ -318,13 +326,14 @@ resource "google_compute_instance_template" "default" {
} }
} }
dynamic "alias_ip_range" { dynamic "alias_ip_range" {
for_each = config.value.alias_ips != null ? config.value.alias_ips : {} for_each = local.network_interface_options[config.key].alias_ips != null ? local.network_interface_options[config.key].alias_ips : {}
iterator = config_alias iterator = config_alias
content { content {
subnetwork_range_name = config_alias.key subnetwork_range_name = config_alias.key
ip_cidr_range = config_alias.value ip_cidr_range = config_alias.value
} }
} }
nic_type = local.network_interface_options[config.key].nic_type
} }
} }

View File

@ -162,8 +162,17 @@ variable "name" {
type = string type = string
} }
variable "network_interface_options" {
description = "Network interfaces extended options. The key is the index of the inteface to configure. The value is an object with alias_ips and nic_type. Set alias_ips or nic_type to null if you need only one of them."
type = map(object({
alias_ips = map(string)
nic_type = string
}))
default = {}
}
variable "network_interfaces" { variable "network_interfaces" {
description = "Network interfaces configuration. Use self links for Shared VPC, set addresses and alias_ips to null if not needed." description = "Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed."
type = list(object({ type = list(object({
nat = bool nat = bool
network = string network = string
@ -172,7 +181,6 @@ variable "network_interfaces" {
internal = string internal = string
external = string external = string
}) })
alias_ips = map(string)
})) }))
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,6 +1,6 @@
# Google Cloud Data Fusion Module # Google Cloud Data Fusion Module
This module allows simple management of ['Google Data Fusion'](https://cloud.google.com/data-fusion) instances. It supports creating Basic or Enterprise, public or private instances. This module allows simple management of ['Google Data Fusion'](https://cloud.google.com/data-fusion) instances. It supports creating Basic or Enterprise, public or private instances.
## Examples ## Examples
@ -8,13 +8,15 @@ This module allows simple management of ['Google Data Fusion'](https://cloud.goo
```hcl ```hcl
module "datafusion" { module "datafusion" {
source = "./modules/datafusion" source = "./modules/datafusion"
name = "my-datafusion" name = "my-datafusion"
region = "europe-west1" region = "europe-west1"
project_id = "my-project" project_id = "my-project"
network = "my-network-name" network = "my-network-name"
# TODO: remove the following line
firewall_create = false
} }
# tftest:modules=1:resources=4 # tftest:modules=1:resources=3
``` ```
### Externally managed IP allocation ### Externally managed IP allocation

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,23 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.0" required_version = ">= 1.0.0"
required_providers { required_providers {
google = ">= 3.10" google = {
google-beta = ">= 3.20" source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,22 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.0" required_version = ">= 1.0.0"
required_providers { required_providers {
google = ">= 3.57" google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -114,6 +114,9 @@ resource "google_storage_notification" "notification" {
topic = google_pubsub_topic.topic[0].id topic = google_pubsub_topic.topic[0].id
event_types = var.notification_config.event_types event_types = var.notification_config.event_types
custom_attributes = var.notification_config.custom_attributes custom_attributes = var.notification_config.custom_attributes
depends_on = [google_pubsub_topic_iam_binding.binding]
} }
resource "google_pubsub_topic_iam_binding" "binding" { resource "google_pubsub_topic_iam_binding" "binding" {
count = local.notification ? 1 : 0 count = local.notification ? 1 : 0

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.13.0" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -59,8 +59,11 @@ resource "google_container_cluster" "cluster" {
# TODO(ludomagno): compute addons map in locals and use a single dynamic block # TODO(ludomagno): compute addons map in locals and use a single dynamic block
addons_config { addons_config {
dns_cache_config { dynamic "dns_cache_config" {
enabled = var.addons.dns_cache_config for_each = var.enable_autopilot ? [] : [""]
content {
enabled = var.addons.dns_cache_config
}
} }
http_load_balancing { http_load_balancing {
disabled = !var.addons.http_load_balancing disabled = !var.addons.http_load_balancing
@ -247,7 +250,7 @@ resource "google_container_cluster" "cluster" {
dynamic "workload_identity_config" { dynamic "workload_identity_config" {
for_each = var.workload_identity && !var.enable_autopilot ? [""] : [] for_each = var.workload_identity && !var.enable_autopilot ? [""] : []
content { content {
identity_namespace = "${var.project_id}.svc.id.goog" workload_pool = "${var.project_id}.svc.id.goog"
} }
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -59,7 +59,7 @@ locals {
prefix = var.prefix != null ? "${var.prefix}-" : "" prefix = var.prefix != null ? "${var.prefix}-" : ""
resource_email_static = "${local.prefix}${var.name}@${var.project_id}.iam.gserviceaccount.com" resource_email_static = "${local.prefix}${var.name}@${var.project_id}.iam.gserviceaccount.com"
resource_iam_email_static = "serviceAccount:${local.resource_email_static}" resource_iam_email_static = "serviceAccount:${local.resource_email_static}"
resource_iam_email = "serviceAccount:${local.service_account.email}" resource_iam_email = local.service_account != null ? "serviceAccount:${local.service_account.email}" : local.resource_iam_email_static
service_account = ( service_account = (
var.service_account_create var.service_account_create
? try(google_service_account.service_account.0, null) ? try(google_service_account.service_account.0, null)

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -86,10 +86,10 @@ module "kms" {
| name | description | sensitive | | name | description | sensitive |
|---|---|:---:| |---|---|:---:|
| key_self_links | Key self links. | | | id | Keyring self link. | |
| key_ids | Key self links. | |
| keyring | Keyring resource. | | | keyring | Keyring resource. | |
| keys | Key resources. | | | keys | Key resources. | |
| location | Keyring location. | | | location | Keyring location. | |
| name | Keyring name. | | | name | Keyring name. | |
| self_link | Keyring self link. | |
<!-- END TFDOC --> <!-- END TFDOC -->

View File

@ -52,14 +52,14 @@ resource "google_kms_key_ring" "default" {
resource "google_kms_key_ring_iam_binding" "default" { resource "google_kms_key_ring_iam_binding" "default" {
for_each = var.iam for_each = var.iam
key_ring_id = local.keyring.self_link key_ring_id = local.keyring.id
role = each.key role = each.key
members = each.value members = each.value
} }
resource "google_kms_crypto_key" "default" { resource "google_kms_crypto_key" "default" {
for_each = var.keys for_each = var.keys
key_ring = local.keyring.self_link key_ring = local.keyring.id
name = each.key name = each.key
rotation_period = try(each.value.rotation_period, null) rotation_period = try(each.value.rotation_period, null)
labels = try(each.value.labels, null) labels = try(each.value.labels, null)
@ -79,6 +79,6 @@ resource "google_kms_crypto_key_iam_binding" "default" {
"${binding.key}.${binding.role}" => binding "${binding.key}.${binding.role}" => binding
} }
role = each.value.role role = each.value.role
crypto_key_id = google_kms_crypto_key.default[each.value.key].self_link crypto_key_id = google_kms_crypto_key.default[each.value.key].id
members = each.value.members members = each.value.members
} }

View File

@ -14,12 +14,19 @@
* limitations under the License. * limitations under the License.
*/ */
output "id" {
description = "Keyring self link."
value = local.keyring.id
depends_on = [
google_kms_key_ring_iam_binding.default
]
}
output "key_self_links" { output "key_ids" {
description = "Key self links." description = "Key self links."
value = { value = {
for name, resource in google_kms_crypto_key.default : for name, resource in google_kms_crypto_key.default :
name => resource.self_link name => resource.id
} }
depends_on = [ depends_on = [
google_kms_crypto_key_iam_binding.default google_kms_crypto_key_iam_binding.default
@ -57,11 +64,3 @@ output "name" {
google_kms_key_ring_iam_binding.default google_kms_key_ring_iam_binding.default
] ]
} }
output "self_link" {
description = "Keyring self link."
value = local.keyring.self_link
depends_on = [
google_kms_key_ring_iam_binding.default
]
}

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,22 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers { required_providers {
google-beta = ">= 3.40.0" google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
} }
} }

View File

@ -1,19 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
} }

View File

@ -72,7 +72,6 @@ module "instance-group" {
subnetwork = var.subnet.self_link subnetwork = var.subnet.self_link
nat = false nat = false
addresses = null addresses = null
alias_ips = null
}] }]
boot_disk = { boot_disk = {
image = "projects/cos-cloud/global/images/family/cos-stable" image = "projects/cos-cloud/global/images/family/cos-stable"

View File

@ -0,0 +1,29 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
terraform {
required_version = ">= 1.0.0"
required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

View File

@ -1,18 +1,29 @@
/** # Copyright 2021 Google LLC
* Copyright 2021 Google LLC #
* # Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License. # You may obtain a copy of the License at
* You may obtain a copy of the License at #
* # https://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0 #
* # Unless required by applicable law or agreed to in writing, software
* Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and # limitations under the License.
* limitations under the License.
*/
terraform { terraform {
required_version = ">= 0.12.6" required_version = ">= 1.0.0"
} required_providers {
google = {
source = "hashicorp/google"
version = ">= 4.0.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.0.0"
}
}
}

Some files were not shown because too many files have changed in this diff Show More