Skip to content

Template for creating Cloud Storage bucket on Google Cloud.

Notifications You must be signed in to change notification settings

CU-DBMI/gc-cloud-storage-bucket

Repository files navigation

Google Cloud - Cloud Storage Bucket - Cookiecutter Template

flowchart LR
    subgraph upload
      files[("file(s)")]
      data-provider["👤 Data Provider"]

    end
    subgraph download
      data-receiver["👤 Data Receiver"]
      files2[("file(s)")]
    end
    bucket[\"Cloud Storage\n Bucket"/]
    files --> |to| bucket
    data-provider --> |uploads| files
    bucket --> |provides\naccess to| files2
    files2 --> |received by| data-receiver

Loading

This project is a Cookiecutter template for creating a Cloud Storage bucket on Google Cloud with a service account and related key to enable data or file upload and use.

The template uses Terraform to maintain cloud resources. See Terraform readme's under the terraform directory for documentation on Terraform elements.

✍️ Using the template

Install the latest version of Cookiecutter:

pip install cookiecutter

Generate a Python package project from the template in this repository:

python -m cookiecutter https://github.com/CU-DBMI/gc-cloud-storage-bucket.git

🧑‍💻 Development

Development for this repository is assisted by the following technologies:

  • Poetry: Used to help configure pre-commit for local development work.
  • Pre-commit: Used for performing checks within local development environment and via Github Actions automated testing. The following sub-items are used as checks through pre-commit-terraform and require local installation when testing outside of Dagger:
    • terraform_docs: Used to automatically generate Terraform-specific documentation.
    • tflint: Used to perform static analysis (linting) on Terraform content.
    • tfsec: Used to perform security-focused static analysis (security linting) on Terraform content.
  • Dagger: Used to help orchestrate reproducible testing within local development environment and for automated testing.

Testing

Tests for this project help ensure projects implemented from the Cookiecutter template function as expected. These tests automatically will use the content found under the directory {{ cookiecutter.project_name }} to create a project and check the content.

Use dagger-cue to run the tests. These tests are also used by a Github Actions workflow to perform the same checks.

Example test command:

# update dagger project (only if needed)
dagger-cue project update
# run the tests
dagger-cue do test