JamesWoolfenden / terraform-gcp-cloudfunction

For your cloud functions to GCP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-gcp-cloudfunction

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

The working cloudfunction module and example.

Usage

Add module.cloudfunction.tf to your code:-

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

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

Requirements

No requirements.

Providers

Name Version
google n/a

Modules

No modules.

Resources

Name Type
google_cloudfunctions_function.lambda resource
google_cloudfunctions_function_iam_member.invoker resource
google_storage_bucket.bucket resource
google_storage_bucket_object.archive resource

Inputs

Name Description Type Default Required
common_tags This is to help you add tags to your cloud objects map(any) n/a yes
invoker Set who can invoke the lambda any n/a yes
lambda A map object that populates the majority of cloudfunction settings map(any) n/a yes
location n/a string "eu" no
project GCP project string n/a yes
region GCP region string n/a yes
sourcezippath Full path to source zip file string n/a yes

Outputs

Name Description
bucket n/a
function 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 = [
    "cloudfunctions.functions.create",
    "cloudfunctions.functions.delete",
    "cloudfunctions.functions.get",
    "cloudfunctions.functions.getIamPolicy",
    "cloudfunctions.functions.setIamPolicy",
    "cloudfunctions.functions.update",
    "cloudfunctions.operations.get",
    "iam.serviceAccounts.actAs",
    "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

For your cloud functions to GCP

License:Apache License 2.0


Languages

Language:HCL 64.9%Language:Makefile 27.6%Language:PowerShell 4.6%Language:Shell 2.9%