Skip to content

osinfra-io/terraform-google-storage-bucket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Google Cloud Platform - Storage Bucket Terraform Module

GitHub Actions:

Terraform Tests Dependabot

Infracost:

infracost

πŸ’΅ Monthly estimates based on Infracost baseline costs.

Repository Description

Terraform example module for a Google Cloud Platform storage bucket.

Note

We do not recommend consuming this module like you might a public module. It is a baseline, something you can fork, potentially maintain, and modify to fit your organization's needs. Using public modules vs. writing your own has various drivers and trade-offs that your organization should evaluate.

πŸ”© Usage

Tip

You can check the tests/fixtures directory for example configurations. These fixtures set up the system for testing by providing all the necessary initial code, thus creating good examples on which to base your configurations.

Development

Our focus is on the core fundamental practice of platform engineering, Infrastructure as Code.

Open Source Infrastructure (as Code) is a development model for infrastructure that focuses on open collaboration and applying relative lessons learned from software development practices that organizations can use internally at scale. - Open Source Infrastructure (as Code)

To avoid slowing down stream-aligned teams, we want to open up the possibility for contributions. The Open Source Infrastructure (as Code) model allows team members external to the platform team to contribute with only a slight increase in cognitive load. This section is for developers who want to contribute to this repository, describing the tools used, the skills, and the knowledge required, along with Terraform documentation.

See the documentation for setting up a local development environment here.

πŸ› οΈ Tools

πŸ“‹ Skills and Knowledge

Links to documentation and other resources required to develop and iterate in this repository successfully.

πŸ” Tests

All tests are mocked allowing us to test the module without creating infrastructure or requiring credentials. The trade-offs are acceptable in favor of speed and simplicity. In a Terraform test, a mocked provider or resource will generate fake data for all computed attributes that would normally be provided by the underlying provider APIs.

cd fixtures/default
terraform init
terraform test

πŸ““ Terraform Documentation

A child module automatically inherits default (un-aliased) provider configurations from its parent. The provider versions below are informational only and do not need to align with the provider configurations from its parent.

Requirements

No requirements.

Providers

Name Version
google 6.2.0

Modules

No modules.

Resources

Name Type
google_storage_bucket.this resource

Inputs

Name Description Type Default Required
default_kms_key_name The name of the Cloud KMS key that will be used to encrypt objects inserted into this bucket string null no
force_destroy When deleting a bucket, this boolean option will delete all contained objects bool false no
labels A map of key/value pairs to assign to the resources being created map(string) {} no
location The location the storage bucket will be created in string n/a yes
name The name of the storage bucket any n/a yes
project The ID of the project in which the resource belongs string n/a yes
public_access_prevention The public access prevention configuration for the bucket string "enforced" no
storage_class The Storage Class of the new bucket. Supported values include: STANDARD, MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE string "STANDARD" no
versioning The bucket's Versioning configuration bool true no

Outputs

Name Description
name Bucket name
url Bucket URL