JamesWoolfenden / terraform-gcp-cloudfunction2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-gcp-cloudfunction2

Build Status Latest Release GitHub tag (latest SemVer) Terraform Version Infrastructure Tests pre-commit checkov Infrastructure Tests Infrastructure Tests

The working cloudfunction2 module and example.

Usage

Add module.cloudfunction2.tf to your code:-

module cloudfunction2 {
    source        ="jameswoolfenden/cloudfunction2/gcp"
    version       = "0.0.4"
    common_tags   = var.common_tags
    lambda        = var.lambda
    project       = var.project
    region        = var.region
    source_zip_path = var.source_zip_path
}

See examplea.auto.tfvars for the data to drive the module.

Requirements

No requirements.

Providers

Name Version
google 5.16.0
random 3.6.0

Modules

No modules.

Resources

Name Type
google_cloud_run_service_iam_member.invoker resource
google_cloud_scheduler_job.invoke_cloud_function resource
google_cloudfunctions2_function.function resource
google_cloudfunctions2_function_iam_member.invoker resource
google_kms_crypto_key_iam_member.crypto_key resource
google_service_account.account resource
google_storage_bucket.bucket resource
google_storage_bucket_object.archive resource
random_string.name resource
google_project.project data source

Inputs

Name Description Type Default Required
body n/a string n/a yes
entry_point n/a string n/a yes
env_vars n/a map(any) n/a yes
function_name n/a string n/a yes
job_name n/a string "invoke-btdelete" no
key_id n/a string n/a yes
location n/a string n/a yes
project n/a string n/a yes
retry_config n/a
object({
max_backoff_duration = string
max_doublings = number
max_retry_duration = string
min_backoff_duration = string
retry_count = number
})
{
"max_backoff_duration": "3600s",
"max_doublings": 5,
"max_retry_duration": "0s",
"min_backoff_duration": "5s",
"retry_count": 0
}
no
schedule n/a string "0 0 * * *" no
source_zip_path n/a string n/a yes
time_zone n/a string "America/Los_Angeles" no

Outputs

Name Description
account n/a
auth n/a
bucket n/a
files n/a
function n/a
job n/a

Role and Permissions

The Terraform resource required is:

resource "google_project_iam_custom_role" "terraform_pike" {
  project     = "pike"
  role_id     = "terraform_pike"
  title       = "terraform_pike"
  description = "A user with least privileges"
  permissions = [
    "cloudkms.cryptoKeys.getIamPolicy",
    "cloudkms.cryptoKeys.setIamPolicy",
    "cloudscheduler.jobs.create",
    "cloudscheduler.jobs.delete",
    "cloudscheduler.jobs.enable",
    "cloudscheduler.jobs.get",
    "cloudscheduler.jobs.update",
    "iam.serviceAccounts.create",
    "iam.serviceAccounts.delete",
    "iam.serviceAccounts.get",
    "iam.serviceAccounts.update",
    "resourcemanager.projects.get",
    "storage.buckets.create",
    "storage.buckets.delete",
    "storage.buckets.get",
    "storage.buckets.update",
    "storage.objects.create",
    "storage.objects.delete",
    "storage.objects.get"
  ]
}

Related Projects

Check out these related projects.

Help

Got a question?

File a GitHub issue.

Contributing

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Copyrights

Copyright © 2019-2023 James Woolfenden

License

License

See LICENSE for full details.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

Contributors

James Woolfenden
James Woolfenden

About

License:Apache License 2.0


Languages

Language:HCL 63.0%Language:Go 16.6%Language:Makefile 15.7%Language:PowerShell 2.9%Language:Shell 1.8%