Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
mbund committed Feb 3, 2025
1 parent 0ffd430 commit 6f4d14d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 18 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Terraform
on:
- push
- pull_request
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3

- name: Init
run: terraform init -backend=false

- name: Validate
run: terraform validate

format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3

- name: Init
run: terraform init -backend=false

- name: Format
run: terraform fmt
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Least privileges
- Use IAM to scope permissions as tightly as possible.
- Allow only the ports you need through security groups.
- Avoid baking secrets.

## Infrastructure Diagram

Expand Down
2 changes: 1 addition & 1 deletion ctfd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ resource "aws_ecs_task_definition" "ctfd" {
retries = 3
command = [
"CMD-SHELL",
"true"
"healthcheck.sh --connect --innodb_initialized"
]
timeout = 3
interval = 10
Expand Down
17 changes: 0 additions & 17 deletions traefik.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ resource "aws_ecs_task_definition" "traefik" {
},
]

dockerLabels = {
"traefik.enable" = "true"
"traefik.http.middlewares.retry.retry.attempts" = "4"
"traefik.http.middlewares.retry.retry.initialInterval" = "100ms"
}

logConfiguration = {
logDriver = "awslogs"
options = {
Expand Down Expand Up @@ -226,17 +220,6 @@ data "aws_iam_policy_document" "assume_role_policy" {
}
}

# resource "aws_iam_policy_attachment" "traefik" {
# name = "iam-policy-attachment-traefik"
# roles = [aws_iam_role.task_role.name]
# policy_arn = aws_iam_policy.traefik.arn
# }

# resource "aws_iam_policy" "traefik" {
# name = "iam-policy-traefik"
# policy = data.aws_iam_policy_document.traefik.json
# }

resource "aws_iam_role_policy" "traefik" {
role = aws_iam_role.task_role.id
policy = data.aws_iam_policy_document.traefik.json
Expand Down

0 comments on commit 6f4d14d

Please sign in to comment.