-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: create module for s3 buckets --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4998c33
commit 1a7d3df
Showing
8 changed files
with
81 additions
and
23 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,26 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "4.55.0" | ||
} | ||
} | ||
} | ||
|
||
|
||
provider "aws" { | ||
alias = "primaryregion" | ||
region = var.primary_region | ||
assume_role { | ||
role_arn = "arn:aws:iam::${var.company_account_id}:role/OrganizationAccountAccessRole" | ||
} | ||
} | ||
|
||
provider "aws" { | ||
alias = "replicaregion" | ||
region = var.backup_region | ||
assume_role { | ||
role_arn = "arn:aws:iam::${var.company_account_id}:role/OrganizationAccountAccessRole" | ||
} | ||
} | ||
|
6 changes: 5 additions & 1 deletion
6
s3-backup-bucket.tf → ...multy-s3-bucket/0.1.0/s3-backup-bucket.tf
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
5 changes: 4 additions & 1 deletion
5
s3-primary-bucket.tf → ...ulty-s3-bucket/0.1.0/s3-primary-bucket.tf
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
File renamed without changes.
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,32 @@ | ||
variable "bucket_name" { | ||
description = "The root name of the s3 bucket to be created, will be suffixed with '-primary' and '-replica'" | ||
type = string | ||
nullable = false | ||
default = false | ||
} | ||
|
||
variable "this_is_development" { | ||
description = "The development cluster environment and data/resources can be destroyed!" | ||
type = string | ||
nullable = false | ||
default = false | ||
} | ||
|
||
variable "company_account_id" { | ||
description = "The company AWS account id" | ||
type = string | ||
nullable = false | ||
} | ||
|
||
variable "primary_region" { | ||
description = "The primary S3 region to create S3 bucket in used for backups. This should be the same region as the one where the cluster is being deployed." | ||
type = string | ||
nullable = false | ||
} | ||
|
||
variable "backup_region" { | ||
description = "The secondary S3 region to create S3 bucket in used for backups. This should be different than the primary region and will have the data from the primary region replicated to it." | ||
type = string | ||
nullable = false | ||
} | ||
|
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 "common_s3" { | ||
source = "./modules/multy-s3-bucket/0.1.0" | ||
|
||
bucket_name = local.bucket_name | ||
this_is_development = var.this_is_development | ||
company_account_id = var.company_account_id | ||
primary_region = var.primary_region | ||
backup_region = var.backup_region | ||
} |