Skip to content

Commit

Permalink
fixed race conditions and trivy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzzimmer committed Sep 19, 2024
1 parent fd30328 commit 1bc66ef
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
8 changes: 4 additions & 4 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.9 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.32 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.4 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.9 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.32 |
| <a name="provider_null"></a> [null](#provider\_null) | >= 3.2 |
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.4 |

Expand Down Expand Up @@ -59,5 +59,5 @@ Note that this example may create resources which cost money. Run `terraform des

| Name | Description |
|------|-------------|
| <a name="output_alb_dns_name"></a> [alb\_dns\_name](#output\_alb\_dns\_name) | n/a |
| <a name="output_endpoint"></a> [endpoint](#output\_endpoint) | n/a |
<!-- END_TF_DOCS -->
6 changes: 5 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ module "alb" {
}

module "service" {
source = "../../"
source = "../../"
depends_on = [module.vpc]

cpu = 256
cpu_architecture = "ARM64"
Expand Down Expand Up @@ -143,6 +144,9 @@ resource "aws_security_group" "egress_all" {
description = "Allow all outbound traffic"
vpc_id = module.vpc.vpc_id

# make sure to secure traffic in production environments
# see https://avd.aquasec.com/misconfig/aws/ec2/avd-aws-0104/#Terraform
#trivy:ignore:AVD-AWS-0104
egress {
from_port = 0
to_port = 0
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output "alb_dns_name" {
value = module.alb.dns_name
output "endpoint" {
value = "http://${module.alb.dns_name}/"
}
4 changes: 2 additions & 2 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
terraform {
required_version = ">= 1.0"
required_version = ">= 1.3"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.9"
version = ">= 5.32"
}
random = {
source = "hashicorp/random"
Expand Down
12 changes: 9 additions & 3 deletions examples/fixtures/context/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
FROM python:3.12-alpine

ADD index.html index.html
ADD server.py server.py
RUN addgroup -S app && adduser -S app -G app
WORKDIR /home/app

ADD index.html /home/app/index.html
ADD server.py /home/app/server.py

RUN chown -R app:app /home/app

USER app

#USER app
EXPOSE 8000

ENTRYPOINT ["python3", "server.py"]
3 changes: 2 additions & 1 deletion modules/deployment/iam_code_pipeline.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ data "aws_iam_policy_document" "code_pipepline_permissions" {
resources = [aws_codebuild_project.this.arn]
}

# cloudtrail reports that codepipeline actually requires access to `*`
#trivy:ignore:AVD-AWS-0057
statement {
actions = [
# cloudtrail reports that codepipeline actually requires access to `*`
"ecs:DescribeTaskDefinition",
"ecs:RegisterTaskDefinition",
"ecs:TagResource"
Expand Down

0 comments on commit 1bc66ef

Please sign in to comment.