Skip to content

devoteamgcloud/es-tf-module-folder-structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devoteamgcloud/es-tf-module-folder-structure

This module helps create several folders under the same parent, enforcing consistent permissions, and with a common naming convention.

The resources/services/activations/deletions that this module will create/trigger are:

  • Create folders with the provided names
  • Assign the defined permissions to the provided list of users or groups.

Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue. If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is 2.0.2.

Usage

Basic usage of this module is as follows:

module "basic_folder_structure" {
  source = "devoteamgcloud/es-tf-module-folder-structure"
  
  parent_id = "organizations/123456789"
  
  folder_structure = {
  "ctl" : {
    "automation" : []
    "management" : []
    "billing" : []
    "security" : []
    "observability" : []
    "networking" : {
      "global" : []
      "emea" : []
      "latam" : []
    }
  },
    "dev" : []
  }
}

Functional examples are included in the examples directory.

Requirements

These sections describe requirements for using this module.

Software

The following dependencies must be available:

Service Account

A service account with the following roles must be used to provision the resources of this module:

  • Folder Creator: roles/resourcemanager.folderCreator

The Project Factory module and the IAM module may be used in combination to provision a service account with the necessary roles applied.

APIs

A project with the following APIs enabled must be used to host the resources of this module:

  • Cloud Resource Manager API: cloudresourcemanager.googleapis.com

The Project Factory module can be used to provision a project with the necessary APIs enabled.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Requirements

Name Version
terraform >= 0.13
google >= 4, < 6.0

Providers

No providers.

Modules

Name Source Version
folders terraform-google-modules/folders/google ~> 4.0
sub_folders1 terraform-google-modules/folders/google ~> 4.0
sub_folders2 terraform-google-modules/folders/google ~> 4.0
sub_folders3 terraform-google-modules/folders/google ~> 4.0
sub_folders4 terraform-google-modules/folders/google ~> 4.0

Resources

No resources.

Inputs

Name Description Type Default Required
deletion_protection Protection against deletion for level 3 and 4 folders bool false no
folder_structure Nested folder structure up to 4 levels of depth map(map(map(map(list(string))))) n/a yes
parent_id ID of the parent where the folders will be created (organizations/123456 or folders/123456) string n/a yes

Outputs

Name Description
folder_ids IDs of first level folders
subfolder1_ids IDs of second level folders
subfolder2_ids IDs of third level folders
subfolder3_ids IDs of fourth level folders
subfolder4_ids IDs of fifth level folders

About

Devoteam GCloud Terraform Module for project folder generator

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages