Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6f4e743
add legacy variable to tfstate service and create backends
juliareynolds-nava Apr 10, 2025
fa9ed38
add greenfield buckets
juliareynolds-nava Apr 14, 2025
3f6a9eb
remove dynamo table config
juliareynolds-nava Apr 14, 2025
4786972
remove dynamo table config
juliareynolds-nava Apr 14, 2025
787ec9b
remove dynamo table config
juliareynolds-nava Apr 14, 2025
ce06b3d
remove dynamo table config
juliareynolds-nava Apr 14, 2025
ac2f8d7
add use_lockfile to backend s3
juliareynolds-nava Apr 14, 2025
2ebbe71
add use_lockfile to backend s3. Upgrade to terraform 1.10 to support …
juliareynolds-nava Apr 14, 2025
ade7f0c
Upgrade to terraform 1.10 to support use_lockfile = true in tfstate/t…
juliareynolds-nava Apr 14, 2025
6e6030e
Remove mgmt env for services
juliareynolds-nava Apr 14, 2025
354264b
Remove mgmt env for services
juliareynolds-nava Apr 14, 2025
65ce333
Remove mgmt env for services
juliareynolds-nava Apr 14, 2025
2656185
Only delete dynamo table for greenfield
juliareynolds-nava Apr 15, 2025
7a64dfd
restore table for legacy
juliareynolds-nava Apr 15, 2025
40e8284
restore table for legacy mgmt
juliareynolds-nava Apr 15, 2025
a2d98e3
restore name for legacy non-prod access
juliareynolds-nava Apr 15, 2025
487a543
restore name for legacy non-prod access
juliareynolds-nava Apr 15, 2025
52b2c4d
revert legacy backend files
juliareynolds-nava Apr 15, 2025
5d581ce
legacy access logs
juliareynolds-nava Apr 15, 2025
dc9edc5
use lockfile for gf
juliareynolds-nava Apr 15, 2025
acce017
Revert "PLT-917: Changing runner machine type to m6a.xlarge for bette…
juliareynolds-nava Apr 15, 2025
db6903f
revert
juliareynolds-nava Apr 15, 2025
63f2af3
revert
juliareynolds-nava Apr 15, 2025
10d0b38
revert
juliareynolds-nava Apr 15, 2025
5c19de8
upgrade to tf 1.10.5
juliareynolds-nava Apr 15, 2025
0e22aa0
tf fmt
juliareynolds-nava Apr 15, 2025
596cd99
restore mgmt env
juliareynolds-nava Apr 15, 2025
0831711
legacy bucket name
juliareynolds-nava Apr 15, 2025
09e8c64
revert
juliareynolds-nava Apr 15, 2025
9a2cfbb
revert
juliareynolds-nava Apr 15, 2025
843d1fe
conditionally build dynamodb state table
juliareynolds-nava Apr 15, 2025
2296799
PLT-800: Update WAF README.md (#210)
gfreeman-navapbc Apr 10, 2025
37c885f
rollback
juliareynolds-nava Apr 15, 2025
d1d34ee
rollback
juliareynolds-nava Apr 15, 2025
5b85feb
pr feedback
juliareynolds-nava Apr 15, 2025
fbedc4a
pr feedback
juliareynolds-nava Apr 15, 2025
bf62750
update sbx to sandbox
juliareynolds-nava Apr 16, 2025
56cf0c7
update sbx to sandbox
juliareynolds-nava Apr 16, 2025
4e8ee0c
Revert "update sbx to sandbox"
juliareynolds-nava Apr 16, 2025
09f23c7
Drop changes that should not be in this PR
gsf Apr 16, 2025
2dd016a
Fix newline at end of file
gsf Apr 16, 2025
93db60c
Merge branch 'main' into jreynolds_plt_890_bucket_changes
gsf Apr 16, 2025
87b3761
Add sandbox env as an option for tfstate
gsf Apr 16, 2025
f839348
added "sandbox" to environment options for services and modules.
juliareynolds-nava Apr 16, 2025
933835b
correct terraform format
juliareynolds-nava Apr 16, 2025
e0b88e2
correct terraform format
juliareynolds-nava Apr 16, 2025
729b8f5
add mgmt for legacy backends
juliareynolds-nava Apr 16, 2025
c55e86d
tf fmt
juliareynolds-nava Apr 16, 2025
5be22e1
creating sandbox backends in non-prod
juliareynolds-nava Apr 16, 2025
417ce68
revert
juliareynolds-nava Apr 16, 2025
efd2d82
Revert "added "sandbox" to environment options for services and modul…
juliareynolds-nava Apr 16, 2025
7fb6293
Format gf backends
gsf Apr 16, 2025
11a3b4f
created prod backends
juliareynolds-nava Apr 16, 2025
f7b6c26
created prod backends
juliareynolds-nava Apr 16, 2025
79ed1c6
move dynamodb table
juliareynolds-nava Apr 16, 2025
641930e
update ab2d dev
juliareynolds-nava Apr 17, 2025
afc5a72
Fix references in bucket module
gsf Apr 17, 2025
87af94c
Drop extra comment hash
gsf Apr 17, 2025
4118497
Fix ordering in variable error message
gsf Apr 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions terraform/backends/ab2d-dev-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "ab2d-dev-tfstate"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have a suffix on the bucket name? Also, please run terraform fmt over these files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

dynamodb_table = "ab2d-dev-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/ab2d-mgmt-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "ab2d-mgmt-tfstate-20250409210420915900000001"
dynamodb_table = "ab2d-mgmt-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/ab2d-prod-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "ab2d-prod-tfstate-20250409213006186000000001"
dynamodb_table = "ab2d-prod-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/ab2d-sbx-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "ab2d-sbx-tfstate-20250410133938105200000001"
dynamodb_table = "ab2d-sbx-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/ab2d-test-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "ab2d-test-tfstate-20250410134820763500000001"
dynamodb_table = "ab2d-test-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/bcda-dev-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "bcda-dev-tfstate-20250409202710600700000001"
dynamodb_table = "bcda-dev-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/bcda-mgmt-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "bcda-mgmt-tfstate-20250410135348899400000001"
dynamodb_table = "bcda-mgmt-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/bcda-prod-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "bcda-prod-tfstate-20250410135924284000000001"
dynamodb_table = "bcda-prod-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/bcda-sbx-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "bcda-sbx-tfstate-20250410142904110700000001"
dynamodb_table = "bcda-sbx-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/bcda-test-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "bcda-test-tfstate-20250409171646342600000001"
dynamodb_table = "bcda-test-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/dpc-dev-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "dpc-dev-tfstate-20250409165915907400000001"
dynamodb_table = "dpc-dev-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/dpc-mgmt-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "dpc-mgmt-tfstate-20250410143603238400000001"
dynamodb_table = "dpc-mgmt-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/dpc-prod-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "dpc-prod-tfstate-20250410144446474100000001"
dynamodb_table = "dpc-prod-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/dpc-sbx-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "dpc-sbx-tfstate-20250410145025265200000001"
dynamodb_table = "dpc-sbx-tfstate"
2 changes: 2 additions & 0 deletions terraform/backends/dpc-test-gf.s3.tfbackend
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bucket = "dpc-test-tfstate-20250410145524530000000001"
dynamodb_table = "dpc-test-tfstate"
10 changes: 8 additions & 2 deletions terraform/modules/bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module "bucket_key" {

resource "aws_s3_bucket" "this" {
bucket = var.legacy == true ? var.name : null
bucket_prefix = var.legacy == false ? var.name : null
bucket_prefix = var.legacy == false ? "${var.name}-" : null
force_destroy = true
}

Expand Down Expand Up @@ -88,9 +88,15 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "this" {
}
}
}

data "aws_iam_account_alias" "current" {}

data "aws_s3_bucket" "bucket_access_logs" {
bucket = "${data.aws_caller_identity.current.account_id}-bucket-access-logs"
bucket = (var.legacy == true ? "${data.aws_caller_identity.current.account_id}-bucket-access-logs" :
data.aws_iam_account_alias.current.account_alias == "aws-cms-oeda-bcda-non-prod" ? "bucket-access-logs-20250409172631068600000001" :
"bucket-access-logs-tbd")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "tbd" can be replaced with the suffix for the access logs bucket created in the prod account.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

}

resource "aws_s3_bucket_logging" "this" {
bucket = aws_s3_bucket.this.id

Expand Down
3 changes: 2 additions & 1 deletion terraform/services/bucket-access-logs/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
data "aws_caller_identity" "current" {}

resource "aws_s3_bucket" "bucket_access_logs" {
bucket = "${data.aws_caller_identity.current.account_id}-bucket-access-logs"
bucket = var.legacy == true ? "${data.aws_caller_identity.current.account_id}-bucket-access-logs" : null
bucket_prefix = var.legacy == false ? "bucket-access-logs-" : null
force_destroy = true
}

Expand Down
5 changes: 5 additions & 0 deletions terraform/services/bucket-access-logs/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
variable "legacy" {
description = "Is this deployment in the greenfield environment (false)?"
type = bool
default = true
}
24 changes: 0 additions & 24 deletions terraform/services/tfstate/.terraform.lock.hcl

This file was deleted.

Loading