Skip to content

Clean up a bit with helpful things for CTF #113

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

Merged
merged 5 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ The documentation below is auto-generated to give insight on what's created via
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.23"` | no |
| <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 |
| <a name="input_region"></a> [region](#input\_region) | The AWS region to use | `string` | `"eu-west-1"` | no |
| <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 |

## Outputs

Expand Down
14 changes: 7 additions & 7 deletions aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ terraform {
# Then uncomment and apply!
# backend "s3" {
# region = "eu-west-1" # Change if desired
# bucket = ""
# key = "wrongsecrets/terraform.tfstate"
# bucket = "" # Put your bucket name here
# key = "wrongsecrets/terraform.tfstate" # Change if desired
# }
}

Expand Down Expand Up @@ -83,11 +83,11 @@ module "eks" {

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

iam_role_additional_policies = [
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
Expand All @@ -102,11 +102,11 @@ module "eks" {
bottlerocket_default = {
create_launch_template = false
launch_template_name = ""
min_size = 1
min_size = 3
max_size = 50
desired_size = 1
desired_size = 3

capacity_type = "SPOT"
capacity_type = "ON_DEMAND"

ami_type = "BOTTLEROCKET_x86_64"
platform = "bottlerocket"
Expand Down
1 change: 1 addition & 0 deletions aws/shared-state/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ No modules.

| Name | Description |
|------|-------------|
| <a name="output_s3_bucket_arn"></a> [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | Name of the terraform state bucket |
| <a name="output_s3_bucket_name"></a> [s3\_bucket\_name](#output\_s3\_bucket\_name) | Name of the terraform state bucket |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4 changes: 3 additions & 1 deletion aws/shared-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ provider "aws" {
region = var.region
}

resource "aws_s3_bucket" "state" {}
resource "aws_s3_bucket" "state" {
force_destroy = true
}

resource "aws_s3_bucket_server_side_encryption_configuration" "encryption" {
bucket = aws_s3_bucket.state.id
Expand Down
5 changes: 5 additions & 0 deletions aws/shared-state/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "s3_bucket_name" {
description = "Name of the terraform state bucket"
value = aws_s3_bucket.state.id
}

output "s3_bucket_arn" {
description = "Name of the terraform state bucket"
value = aws_s3_bucket.state.id
}
1 change: 1 addition & 0 deletions aws/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cluster_version = "1.22"
region = "eu-west-1"
# state_bucket_arn = "...."
5 changes: 5 additions & 0 deletions aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ variable "extra_allowed_ip_ranges" {
type = list(string)
default = []
}

variable "state_bucket_arn" {
description = "ARN of the state bucket to grant access to the s3 user"
type = string
}