Skip to content

JamesWoolfenden/terraform-gcp-bigtable-backups

Repository files navigation

terraform-gcp-bigtable-backups

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

Usage

This module requires a precursor, a prebuilt cloud build container in artifact repository. Follow the readme build instructions in gcloud-container folder FIRST.

Add module.bigtable-backups.tf to your code:-

module "bigtable-backups" {
  source             = "JamesWoolfenden/bigtable-backups/gcp"
  version            = "0.0.1"
  image              = "us-central1-docker.pkg.dev/pike-gcp/pike/backup:latest"
  job_name           = "backup"
  schedule           = "0 9 * * 1"
  labels={
    pike="permissions"
  }
  region            = "us-central1"
  project_id        = "pike-gcp"
}

Auth

gcloud auth application-default login --project yourproj
gcloud builds submit --region=us-central1 --config cloudbuild.yaml --project yourproj

Requirements

No requirements.

Providers

Name Version
google n/a

Modules

No modules.

Resources

Name Type
google_cloud_run_v2_job.default resource
google_cloud_scheduler_job.backup resource
google_project.project data source

Inputs

Name Description Type Default Required
image container image string n/a yes
job_name n/a string n/a yes
labels The labels map(any) n/a yes
project_id Project ID where the resource is to be setup string n/a yes
region region where the resource is to be created string n/a yes
schedule n/a string n/a yes

Outputs

No outputs.

Information

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 = [
    "cloudscheduler.jobs.create",
    "cloudscheduler.jobs.delete",
    "cloudscheduler.jobs.enable",
    "cloudscheduler.jobs.get",
    "cloudscheduler.jobs.update",
    "resourcemanager.projects.get",
    "run.jobs.create",
    "run.jobs.delete",
    "run.jobs.get",
    "run.jobs.update",
    "run.operations.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 � 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