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

added tfsec #10

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
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
21 changes: 17 additions & 4 deletions aws/hello-world/env0.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
version: 1

version: 2
deploy:
steps:
terraformInit:
before:
- echo Replacing !!!USER!!! with $USER in index.html
- sed 's/!!!USER!!!/'"$USER"'/g' index.template.html > index.html
# - name: index.html update
# run: |
# echo Replacing !!!USER!!! with $USER in index.html
# sed 's/!!!USER!!!/'"$USER"'/g' index.template.html > index.html
- name: Run TfSec # The name that will be presented in the UI for this step
use: https://github.com/env0/env0-tfsec-plugin
inputs:
version: v1.28.0
directory: .
flags: --force-all-dirs --tfvars-file=env0.auto.tfvars -O output.json --soft-fail --format=json
- name: Add env0 info to output.json
run: |
jq '. + { orgId: env.ENV0_ORGANIZATION_ID, templateRepository: env.ENV0_TEMPLATE_REPOSITORY, commitHash: env.ENV0_COMMIT_HASH }' output.json > output2.json
- name: Upload json file to s3
run: aws s3 cp output2.json s3://hack2024-tfsec-outputs/${ENV0_ENVIRONMENT_ID}/${ENV0_DEPLOYMENT_LOG_ID}.json

5 changes: 5 additions & 0 deletions aws/hello-world/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ resource "aws_s3_bucket" "website_bucket" {
force_destroy = true
}

resource "aws_s3_bucket" "website_bucket2" {
bucket = "hello-env0-${random_string.random.result}-another"
force_destroy = true
}

resource "aws_s3_bucket_website_configuration" "website_config" {
bucket = aws_s3_bucket.website_bucket.id

Expand Down
3 changes: 3 additions & 0 deletions misc/null-resource/main.tf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
resource "null_resource" "null" {
}

resource "null_resource" "null3" {
}