diff --git a/aws/hello-world/env0.yml b/aws/hello-world/env0.yml index f0ba9ae9..a6d3e4ef 100644 --- a/aws/hello-world/env0.yml +++ b/aws/hello-world/env0.yml @@ -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 + diff --git a/aws/hello-world/s3.tf b/aws/hello-world/s3.tf index c8cc479f..e00e6a91 100644 --- a/aws/hello-world/s3.tf +++ b/aws/hello-world/s3.tf @@ -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 diff --git a/misc/null-resource/main.tf b/misc/null-resource/main.tf index 61aef554..213c5d47 100644 --- a/misc/null-resource/main.tf +++ b/misc/null-resource/main.tf @@ -1,2 +1,5 @@ resource "null_resource" "null" { } + +resource "null_resource" "null3" { +}