Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planetfm/dsos 2408/use modified lb module #4320

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
fcc9547
create fake lb and change lb commit hash
robertsweetman Dec 12, 2023
f5c59be
formatting
robertsweetman Dec 12, 2023
bf4afbd
change default value for existing_bucket_name
robertsweetman Dec 13, 2023
ea8cac5
change variables back to fix one thing at a time
robertsweetman Dec 13, 2023
7b0a376
change lb module reference
robertsweetman Dec 13, 2023
90caf3a
change commit id
robertsweetman Dec 13, 2023
8fe9fa8
use different commit id
robertsweetman Dec 13, 2023
ad64274
remove all objects and remove lb
robertsweetman Dec 13, 2023
216c445
add log schedule and redeploy
robertsweetman Dec 13, 2023
a87b358
fix cron syntax
robertsweetman Dec 13, 2023
7275071
delete bucket and use new reference
robertsweetman Dec 13, 2023
8c79899
redeploy test ALB
robertsweetman Dec 13, 2023
21aa4a5
delete test ALB
robertsweetman Dec 13, 2023
5318491
rebuild test LB
robertsweetman Dec 13, 2023
9a5b55f
update lb module git commit ref
robertsweetman Dec 14, 2023
a3a5d7a
update lb module git commit ref
robertsweetman Dec 14, 2023
61e7d9b
update module commit ref
robertsweetman Dec 14, 2023
82a56ae
update lb module git commit ref
robertsweetman Dec 14, 2023
41f79e0
remove LB
robertsweetman Dec 14, 2023
ea6ea37
fix module reference
robertsweetman Dec 14, 2023
6c89c57
update module ref and add second LB
robertsweetman Dec 14, 2023
a351948
update module ref
robertsweetman Dec 14, 2023
c1a757f
update module ref
robertsweetman Dec 14, 2023
d56b22e
use new module ref and create s3 bucket for testing
robertsweetman Dec 15, 2023
a38d995
use correct lb module git ref
robertsweetman Dec 15, 2023
34e27c5
don't use custom key
robertsweetman Dec 15, 2023
17efcd1
use existing bucket
robertsweetman Dec 15, 2023
17a5104
add permissions for s3 LB logs bucket
robertsweetman Dec 15, 2023
25bd328
fix syntax
robertsweetman Dec 15, 2023
f0d3a40
add permissions
robertsweetman Dec 15, 2023
9111bc8
make value explicit
robertsweetman Dec 15, 2023
dac8e75
add permissions
robertsweetman Dec 15, 2023
b900459
hardcode resources for testing
robertsweetman Dec 18, 2023
181486e
add bucket permissions first
robertsweetman Dec 18, 2023
aae8171
add bucket to existing LB
robertsweetman Dec 18, 2023
20f4ba9
change policy
robertsweetman Dec 18, 2023
7c96d94
default to v2
robertsweetman Dec 18, 2023
eea157c
allow existing bucket
robertsweetman Dec 18, 2023
f09b76a
remove custom kms key
robertsweetman Dec 18, 2023
c0f556d
remove incorrect default value from s3 module
robertsweetman Dec 18, 2023
4cb225d
remove log_schedule variable
robertsweetman Dec 18, 2023
e8d1852
formatting
robertsweetman Dec 18, 2023
82edd1c
use existing bucket for logging
robertsweetman Dec 18, 2023
b71a880
add listeners for testing
robertsweetman Dec 18, 2023
36bf254
change reply code
robertsweetman Dec 18, 2023
cb6077e
change LB module hash
robertsweetman Dec 19, 2023
e4ebbb1
add new s3 bucket
robertsweetman Dec 19, 2023
b133782
change baseline commit ref
robertsweetman Dec 19, 2023
f7214c4
change baseline commit ref
robertsweetman Dec 19, 2023
0d4663e
change baseline commit ref
robertsweetman Dec 19, 2023
06e476d
change baseline commit ref
robertsweetman Dec 19, 2023
71b9b4f
change baseline commit ref
robertsweetman Dec 19, 2023
c202ad3
change baseline commit ref
robertsweetman Dec 19, 2023
18b885b
change baseline commit ref
robertsweetman Dec 19, 2023
9e39fce
change baseline commit ref with updated storage location template path
robertsweetman Dec 19, 2023
a6626e8
change baseline commit ref use new projection params
robertsweetman Dec 19, 2023
c5fdcff
change baseline commit ref trailing slash
robertsweetman Dec 19, 2023
f68023f
change baseline commit ref updated regex
robertsweetman Dec 19, 2023
e020a77
update bucket hash and add nlb for testing
robertsweetman Dec 19, 2023
3695396
fix nlb protocol
robertsweetman Dec 19, 2023
1630d10
deploy nlb access logs external bucket
robertsweetman Dec 19, 2023
4e896cd
fix variable name
robertsweetman Dec 19, 2023
9e71ec6
change bucket permissions and remove nlb log bucket connection
robertsweetman Dec 19, 2023
f4ee6f7
fix listener protocol
robertsweetman Dec 19, 2023
bd42cdb
create fake target group
robertsweetman Dec 19, 2023
057bebe
nlb attached to nothing
robertsweetman Dec 19, 2023
d0d038e
apply nlb bucket to nlb
robertsweetman Dec 19, 2023
7a6584f
remove external logging bucket from nlb
robertsweetman Dec 19, 2023
5db9181
use different reference
robertsweetman Dec 19, 2023
0307042
use modified lb
robertsweetman Dec 21, 2023
6acf720
create bucket
robertsweetman Dec 21, 2023
e225d13
change commit ref
robertsweetman Dec 21, 2023
b29935e
trick tf into re-running
robertsweetman Dec 21, 2023
ef82187
module test application lb bucket creation
robertsweetman Dec 21, 2023
64edad9
build network lb with s3 module enabled
robertsweetman Dec 21, 2023
741e9b5
delete network bucket
robertsweetman Dec 21, 2023
b446226
deploy network lb log s3 bucket
robertsweetman Dec 22, 2023
f741ee3
remove both nlb buckets
robertsweetman Jan 2, 2024
57eac88
change base s3 algorithm for module creation
robertsweetman Jan 2, 2024
e6f26a8
add sse_algorithm option to module s3 bucket creation
robertsweetman Jan 2, 2024
7d5f3be
set self created bucket sse_algorithm to s3 type
robertsweetman Jan 2, 2024
f28978a
reference sse_algorithm as optional in module
robertsweetman Jan 2, 2024
34d52f9
remove s3 type from lb module vars
robertsweetman Jan 2, 2024
ec45143
set network-lb-logs-bucket to AES256
robertsweetman Jan 2, 2024
f6850d4
use existing bucket for network lb
robertsweetman Jan 2, 2024
1ac2036
have module create s3 bucket
robertsweetman Jan 2, 2024
ec8ec8a
remove bucket
robertsweetman Jan 2, 2024
dd60bb8
comment out test alb
robertsweetman Jan 2, 2024
fca1a9a
enable networktwo lb with logs enabled
robertsweetman Jan 2, 2024
eec2a7f
fix naming to remove duplicate key issue
robertsweetman Jan 2, 2024
d9d7aba
destroy all bucket associations to logs
robertsweetman Jan 2, 2024
98f70fb
flip private alb access_logs to true
robertsweetman Jan 3, 2024
a8ea415
delete bucket and use new lb module ref
robertsweetman Jan 3, 2024
21dc2be
flip private lb access_logs to true to see if depends on will work
robertsweetman Jan 3, 2024
f8c1556
set network lb logs bucket to external and retest
robertsweetman Jan 3, 2024
29fd928
remove lb's from planetfm dev env
robertsweetman Jan 3, 2024
ab1114f
remove private lb s3 bucket
robertsweetman Jan 3, 2024
b9a5a99
remove private lb and access logs from network lb
robertsweetman Jan 3, 2024
2447e68
remove last items from dev env
robertsweetman Jan 3, 2024
d029e54
re-run plan
robertsweetman Jan 3, 2024
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: 1 addition & 1 deletion terraform/environments/planetfm/ec2-common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ resource "aws_ssm_document" "ami_build_automation" {
Name = "ami-build-automation"
},
)
}
}
101 changes: 101 additions & 0 deletions terraform/environments/planetfm/locals_development.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,106 @@ locals {
# baseline config
development_config = {

# baseline_s3_buckets = {
# public-lb-logs-bucket = {
# bucket_policy_v2 = [
# {
# effect = "Allow"
# actions = [
# "s3:PutObject",
# ]
# principals = {
# identifiers = ["arn:aws:iam::652711504416:root"]
# type = "AWS"
# }
# },
# {
# effect = "Allow"
# actions = [
# "s3:PutObject"
# ]
# principals = {
# identifiers = ["delivery.logs.amazonaws.com"]
# type = "Service"
# }

# conditions = [
# {
# test = "StringEquals"
# variable = "s3:x-amz-acl"
# values = ["bucket-owner-full-control"]
# }
# ]
# },
# {
# effect = "Allow"
# actions = [
# "s3:GetBucketAcl"
# ]
# principals = {
# identifiers = ["delivery.logs.amazonaws.com"]
# type = "Service"
# }
# }
# ]
# iam_policies = module.baseline_presets.s3_iam_policies
# }
# network-lb-logs-bucket = {
# sse_algorithm = "AES256"
# bucket_policy_v2 = [
# {
# effect = "Allow"
# actions = [
# "s3:PutObject"
# ]
# principals = {
# identifiers = ["delivery.logs.amazonaws.com"]
# type = "Service"
# }
# conditions = [
# {
# test = "StringEquals"
# variable = "s3:x-amz-acl"
# values = ["bucket-owner-full-control"]
# },
# {
# test = "StringEquals"
# variable = "aws:SourceAccount"
# values = [module.environment.account_id]
# },
# {
# test = "ArnLike"
# variable = "aws:SourceArn"
# values = ["arn:aws:logs:${module.environment.region}:${module.environment.account_id}:*"]
# }
# ]
# },
# {
# effect = "Allow"
# actions = [
# "s3:GetBucketAcl"
# ]
# principals = {
# identifiers = ["delivery.logs.amazonaws.com"]
# type = "Service"
# }
# conditions = [
# {
# test = "StringEquals"
# variable = "aws:SourceAccount"
# values = [module.environment.account_id]
# },
# {
# test = "ArnLike"
# variable = "aws:SourceArn"
# values = ["arn:aws:logs:${module.environment.region}:${module.environment.account_id}:*"]
# }
# ]
# }
# ]
# iam_policies = module.baseline_presets.s3_iam_policies
# }
# }
}
}

2 changes: 1 addition & 1 deletion terraform/environments/planetfm/locals_preproduction.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ locals {
private = {
internal_lb = true
enable_delete_protection = false
loadbalancer_type = "application"
load_balancer_type = "application"
idle_timeout = 3600
security_groups = ["loadbalancer"]
subnets = module.environment.subnets["private"].ids
Expand Down
6 changes: 5 additions & 1 deletion terraform/modules/baseline/lb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ module "lb" {

for_each = var.lbs

source = "git::https://github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer.git?ref=10b4dc871150e9fa94532be6c60c35b97f55c657"
# references my working fork of the module
# source = "git::https://github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer.git?ref=0d4f8e35ba3605fabbd233b592caaa656a8a03e8"

# experimental
source = "git::https://github.com/ministryofjustice/modernisation-platform-terraform-loadbalancer.git?ref=4b518d453bb9743d604ce47186e34edb07767a51"

providers = {
aws.bucket-replication = aws
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/baseline/s3_bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ module "s3_bucket" {
replication_region = coalesce(each.value.replication_region, var.environment.region)
bucket_policy = each.value.bucket_policy
bucket_policy_v2 = each.value.bucket_policy_v2
custom_kms_key = coalesce(each.value.custom_kms_key, var.environment.kms_keys["general"].arn)
custom_replication_kms_key = coalesce(each.value.custom_replication_kms_key, var.environment.kms_keys["general"].arn)
custom_kms_key = each.value.custom_kms_key
custom_replication_kms_key = each.value.custom_replication_kms_key
lifecycle_rule = each.value.lifecycle_rule
log_bucket = each.value.log_bucket
log_prefix = each.value.log_prefix
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/baseline/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ variable "lbs" {
load_balancer_type = optional(string, "application")
security_groups = list(string)
subnets = list(string)
existing_bucket_name = optional(string, "") # NOTE: module default value is empty string ""
enable_cross_zone_load_balancing = optional(bool, false) # network and gateway lb types only, application lb's this is always true
existing_bucket_name = optional(string, "") # NOTE: module default value is empty string
enable_cross_zone_load_balancing = optional(bool, false) # network and gateway lb types only, application lb's this is always true
dns_record_client_routing_policy = optional(string, "any_availability_zone") # network load-balancer types only
s3_versioning = optional(bool, true)
instance_target_groups = optional(map(object({
Expand Down
Loading