Skip to content

Commit b7e0d23

Browse files
authored
Merge pull request #113 from OWASP/live/ctf
Clean up a bit with helpful things for CTF
2 parents b4b4e83 + bef1a5f commit b7e0d23

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

aws/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ The documentation below is auto-generated to give insight on what's created via
188188
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.23"` | no |
189189
| <a name="input_extra_allowed_ip_ranges"></a> [extra\_allowed\_ip\_ranges](#input\_extra\_allowed\_ip\_ranges) | Allowed IP ranges in addition to creator IP | `list(string)` | `[]` | no |
190190
| <a name="input_region"></a> [region](#input\_region) | The AWS region to use | `string` | `"eu-west-1"` | no |
191+
| <a name="input_state_bucket_arn"></a> [state\_bucket\_arn](#input\_state\_bucket\_arn) | ARN of the state bucket to grant access to the s3 user | `string` | n/a | yes |
191192

192193
## Outputs
193194

aws/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ terraform {
33
# Then uncomment and apply!
44
# backend "s3" {
55
# region = "eu-west-1" # Change if desired
6-
# bucket = ""
7-
# key = "wrongsecrets/terraform.tfstate"
6+
# bucket = "" # Put your bucket name here
7+
# key = "wrongsecrets/terraform.tfstate" # Change if desired
88
# }
99
}
1010

@@ -83,11 +83,11 @@ module "eks" {
8383

8484
# apply when available: iam_role_permissions_boundary = "arn:aws:iam::${local.account_id}:policy/service-user-creation-permission-boundary"
8585
eks_managed_node_group_defaults = {
86-
disk_size = 50
86+
disk_size = 256
8787
disk_type = "gp3"
8888
disk_throughput = 150
8989
disk_iops = 3000
90-
instance_types = ["t3a.large"]
90+
instance_types = ["t3a.medium"]
9191

9292
iam_role_additional_policies = [
9393
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
@@ -102,11 +102,11 @@ module "eks" {
102102
bottlerocket_default = {
103103
create_launch_template = false
104104
launch_template_name = ""
105-
min_size = 1
105+
min_size = 3
106106
max_size = 50
107-
desired_size = 1
107+
desired_size = 3
108108

109-
capacity_type = "SPOT"
109+
capacity_type = "ON_DEMAND"
110110

111111
ami_type = "BOTTLEROCKET_x86_64"
112112
platform = "bottlerocket"

aws/shared-state/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ No modules.
3636

3737
| Name | Description |
3838
|------|-------------|
39+
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | Name of the terraform state bucket |
3940
| <a name="output_s3_bucket_name"></a> [s3\_bucket\_name](#output\_s3\_bucket\_name) | Name of the terraform state bucket |
4041
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

aws/shared-state/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ provider "aws" {
1111
region = var.region
1212
}
1313

14-
resource "aws_s3_bucket" "state" {}
14+
resource "aws_s3_bucket" "state" {
15+
force_destroy = true
16+
}
1517

1618
resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
1719
bucket = aws_s3_bucket.state.id

aws/shared-state/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ output "s3_bucket_name" {
22
description = "Name of the terraform state bucket"
33
value = aws_s3_bucket.state.id
44
}
5+
6+
output "s3_bucket_arn" {
7+
description = "Name of the terraform state bucket"
8+
value = aws_s3_bucket.state.id
9+
}

aws/terraform.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
cluster_version = "1.22"
22
region = "eu-west-1"
3+
# state_bucket_arn = "...."

aws/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ variable "extra_allowed_ip_ranges" {
2121
type = list(string)
2222
default = []
2323
}
24+
25+
variable "state_bucket_arn" {
26+
description = "ARN of the state bucket to grant access to the s3 user"
27+
type = string
28+
}

0 commit comments

Comments
 (0)