This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* global configuration for gh_oidc_dev * scaffold storage module * initial storage module * add public access control to google_storage_bucket * add resume object to storage bucket definition
- Loading branch information
1 parent
445d702
commit a6f3da7
Showing
15 changed files
with
149 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
output "ids" { | ||
value = module.envs.ids | ||
} | ||
|
||
output "common_folder_id" { | ||
value = module.common.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
variable "org_id" { | ||
description = "The ID of the organization to create the project under" | ||
type = string | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module "folders" { | ||
source = "./folders" | ||
org_id = var.org_id | ||
} | ||
|
||
module "iam" { | ||
source = "./iam" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
locals { | ||
versioning = var.environment == "prod" ? true : false | ||
} | ||
|
||
resource "random_uuid" "storage_uuid" {} | ||
|
||
resource "google_storage_bucket" "default" { | ||
name = "${var.bucket_name}-${random_uuid.storage_uuid.result}" | ||
location = var.location | ||
project = var.project_id | ||
uniform_bucket_level_access = false | ||
|
||
versioning { | ||
enabled = local.versioning | ||
} | ||
} | ||
|
||
resource "google_storage_default_object_access_control" "public_access" { | ||
bucket = google_storage_bucket.default.name | ||
role = "READER" | ||
entity = "allUsers" | ||
} | ||
|
||
resource "google_storage_bucket_object" "resume_folder" { | ||
bucket = google_storage_bucket.default.name | ||
name = "resume/resume.md" | ||
source = var.resume_path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "storage_bucket_name" { | ||
value = google_storage_bucket.default.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
variable "bucket_name" { | ||
description = "The name of the S3 bucket to create" | ||
type = string | ||
} | ||
|
||
variable "location" { | ||
description = "The GCP region in which to create the bucket" | ||
type = string | ||
default = "US" | ||
} | ||
|
||
variable "project_id" { | ||
description = "The GCP project ID in which to create the bucket" | ||
type = string | ||
} | ||
|
||
variable "environment" { | ||
description = "The environment in which to create the bucket" | ||
type = string | ||
validation { | ||
condition = contains(["dev", "prod"], var.environment) | ||
error_message = "Environment must be one of [devel, prod]" | ||
} | ||
} | ||
|
||
variable "resume_path" { | ||
description = "The path to the resume to upload" | ||
type = string | ||
} |