From b11d19c7b93191a654b758560d134444a52b55e0 Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 19:52:38 -0300 Subject: [PATCH 1/7] Add infra --- .github/PULL_REQUEST_TEMPLATE.md | 12 ++++ .github/workflows/Develop.yml | 87 ++++++++++++++++++++++++++++ .github/workflows/Production.yml | 87 ++++++++++++++++++++++++++++ .github/workflows/tfdocs.yml | 23 ++++++++ .gitignore | 6 +- .terraform-docs.yaml | 6 ++ README.md | 37 ++++++++++++ terraforrm/data.tf | 1 + terraforrm/env/dev/backend.tfvars | 4 ++ terraforrm/env/dev/terraform.tfvars | 3 + terraforrm/env/prod/backend.tfvars | 4 ++ terraforrm/env/prod/terraform.tfvars | 3 + terraforrm/output.tf | 53 +++++++++++++++++ terraforrm/providers.tf | 15 +++++ terraforrm/s3.tf | 18 ++++++ terraforrm/sqs.tf | 49 ++++++++++++++++ terraforrm/variables.tf | 17 ++++++ 17 files changed, 424 insertions(+), 1 deletion(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/Develop.yml create mode 100644 .github/workflows/Production.yml create mode 100644 .github/workflows/tfdocs.yml create mode 100644 .terraform-docs.yaml create mode 100644 terraforrm/data.tf create mode 100644 terraforrm/env/dev/backend.tfvars create mode 100644 terraforrm/env/dev/terraform.tfvars create mode 100644 terraforrm/env/prod/backend.tfvars create mode 100644 terraforrm/env/prod/terraform.tfvars create mode 100644 terraforrm/output.tf create mode 100644 terraforrm/providers.tf create mode 100644 terraforrm/s3.tf create mode 100644 terraforrm/sqs.tf create mode 100644 terraforrm/variables.tf diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..d50afea --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ +## Why + + +## Pull request type +- [ ] New resource +- [ ] Update resource +- [ ] Bugfix +- [ ] Other (please describe): + +## Rollback plan +- [ ] Revert this PR +- [ ] Other (please, specify): \ No newline at end of file diff --git a/.github/workflows/Develop.yml b/.github/workflows/Develop.yml new file mode 100644 index 0000000..bcc61c7 --- /dev/null +++ b/.github/workflows/Develop.yml @@ -0,0 +1,87 @@ +name: "Terraform Developer" + +on: + push: + branches: + - develop + paths: + - terraform/** + pull_request: + branches: + - develop + paths: + - terraform/** + +env: + WORKSPACE: "dev" + aws-region: "us-east-1" + destroy: false + +permissions: + contents: read + id-token: write + pull-requests: write + +jobs: + InfraDev: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.10.5 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-session-name: GitHub_AWS_OIDC + aws-region: ${{ env.aws-region }} + role-to-assume: ${{ vars.AWS_ASSUME_ROLE_ARN }} + + - name: Terraform fmt + id: fmt + run: terraform fmt -check + continue-on-error: true + + - name: Terraform Init + id: init + run: | + terraform init -backend-config="./envs/${{ env.WORKSPACE }}/backend.tfvars" -input=false + terraform workspace select -or-create ${{ env.WORKSPACE }} + continue-on-error: false + + - name: Terraform Validate + id: validate + run: terraform validate + continue-on-error: true + + - name: Terraform Destroy + if: ${{ env.destroy == true }} + id: destroy + run: terraform destroy -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" -auto-approve + + - name: Terraform Plan + if: ${{ env.destroy != true && github.event_name == 'pull_request'}} + id: plan + run: terraform plan -out plan.tf -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" -no-color + + - name: Terraform Resources List + uses: borchero/terraform-plan-comment@v2 + if: github.event_name == 'pull_request' + with: + token: ${{ github.token }} + planfile: plan.tf + working-directory: ./terraform + + - name: Terraform Apply + if: ${{ env.destroy != true && github.event_name == 'push'}} + id: apply + run: terraform apply -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" -auto-approve \ No newline at end of file diff --git a/.github/workflows/Production.yml b/.github/workflows/Production.yml new file mode 100644 index 0000000..1ffc99d --- /dev/null +++ b/.github/workflows/Production.yml @@ -0,0 +1,87 @@ +name: "Terraform Production" + +on: + push: + branches: + - main + paths: + - terraform/** + pull_request: + branches: + - main + paths: + - terraform/** + +env: + WORKSPACE: "prod" + aws-region: "us-east-1" + destroy: false + +permissions: + contents: read + id-token: write + pull-requests: write + +jobs: + InfraProd: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + working-directory: ./terraform + + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.9.5 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-session-name: GitHub_AWS_OIDC + aws-region: ${{ env.aws-region }} + role-to-assume: ${{ vars.AWS_ASSUME_ROLE_ARN }} + + - name: Terraform Init + id: init + run: | + terraform init -backend-config="./envs/${{ env.WORKSPACE }}/backend.tfvars" -input=false + terraform workspace select -or-create ${{ env.WORKSPACE }} + continue-on-error: false + + - name: Terraform fmt + id: fmt + run: terraform fmt -check + continue-on-error: true + + - name: Terraform Validate + id: validate + run: terraform validate + continue-on-error: true + + - name: Terraform Destroy + if: ${{ env.destroy == true }} + id: destroy + run: terraform plan -destroy -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" + + - name: Terraform Plan + if: ${{ env.destroy != true && github.event_name == 'pull_request'}} + id: plan + run: terraform plan -out plan.tf -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" -no-color + + - name: Terraform Resouces List + uses: borchero/terraform-plan-comment@v2 + if: github.event_name == 'pull_request' + with: + token: ${{ github.token }} + planfile: plan.tf + working-directory: ./terraform + + - name: Terraform Apply + if: ${{ env.destroy != true && github.event_name == 'push'}} + id: apply + run: terraform apply -var-file="./envs/${{ env.WORKSPACE }}/terraform.tfvars" -auto-approve \ No newline at end of file diff --git a/.github/workflows/tfdocs.yml b/.github/workflows/tfdocs.yml new file mode 100644 index 0000000..da0d53e --- /dev/null +++ b/.github/workflows/tfdocs.yml @@ -0,0 +1,23 @@ +name: Validate and Generate Terraform Docs +on: + - pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Render terraform docs and push changes back to PR + uses: terraform-docs/gh-actions@main + with: + working-dir: ./terraform + output-file: README.md + output-method: inject + git-push: "true" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2faf43d..62b2f9e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,10 @@ crash.*.log # password, private keys, and other secrets. These should not be part of version # control as they are data points which are potentially sensitive and subject # to change depending on the environment. -*.tfvars +# *.tfvars *.tfvars.json +*.lock.hcl +plan.out # Ignore override files as they are usually used to override resources locally and so # are not checked in @@ -35,3 +37,5 @@ override.tf.json # Ignore CLI configuration files .terraformrc terraform.rc +.idea/ +.vscode/ \ No newline at end of file diff --git a/.terraform-docs.yaml b/.terraform-docs.yaml new file mode 100644 index 0000000..9afb844 --- /dev/null +++ b/.terraform-docs.yaml @@ -0,0 +1,6 @@ +content: |- + {{ .Header }} + + {{ .Inputs }} + + {{ .Outputs }} \ No newline at end of file diff --git a/README.md b/README.md index c19fdc9..577ccea 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,39 @@ # thumb-processor-infra Infra do Projeto Hackaton + + +### Pre Requirements To Run This Pipeline. + +- Create a S3 Bucket in AWS Console (Unique Global Name) + - Enable Versioning Bucket +* Change the *Bucket Name and DynamoDB Table Name* in backend.conf files `(./terraform/envs/dev | ./terraform/envs/prod)` +- Create a DynamoDB Table in AWS Console + - Put In *Partition key* to *LockID* And Set *String* And *Crete Table* +- Create a Identity Provider (OIDC) in IAM Console and add ARN on github variables with Name: *AWS_ASSUME_ROLE_ARN* + - How To Create a OIDC Github + - https://aws.amazon.com/pt/blogs/security/use-iam-roles-to-connect-github-actions-to-actions-in-aws/ + + +This Pipeline Runs With a Pull Request: +- Branches: + - developer - Runs Developer Infra + - main - Runs Productions Infra + +### Runs Localy + +Get AWS Credentials And Runs: +```shell +aws configure # And Paste de SECRET_KEY_ID and SECRET_ACCESS_KEY and REGION + +# After aws configure go to de Path /terraform and Runs: Config Backend S3 +terraform init -backend-config=envs/dev/backend.tfvars + +# Set Dev Worspace +terraform workspace new dev + +# Runs Plan +terraform plan -out plan.out -var-file=envs/dev/terraform.tfvars + +# Aplly Plan +terraform apply plan.out +``` \ No newline at end of file diff --git a/terraforrm/data.tf b/terraforrm/data.tf new file mode 100644 index 0000000..d78fce4 --- /dev/null +++ b/terraforrm/data.tf @@ -0,0 +1 @@ +data "aws_caller_identity" "current" {} \ No newline at end of file diff --git a/terraforrm/env/dev/backend.tfvars b/terraforrm/env/dev/backend.tfvars new file mode 100644 index 0000000..fba9fb7 --- /dev/null +++ b/terraforrm/env/dev/backend.tfvars @@ -0,0 +1,4 @@ +bucket = "hackaton-challanger-fiap" +key = "terraform.tfstate" +region = "us-east-1" +dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraforrm/env/dev/terraform.tfvars b/terraforrm/env/dev/terraform.tfvars new file mode 100644 index 0000000..e5984af --- /dev/null +++ b/terraforrm/env/dev/terraform.tfvars @@ -0,0 +1,3 @@ +bucket_name = "dev-thumb-processor-hackaton" +env = "dev" +queue_name = "dev-thumb-processor-hackaton-queue" \ No newline at end of file diff --git a/terraforrm/env/prod/backend.tfvars b/terraforrm/env/prod/backend.tfvars new file mode 100644 index 0000000..5850625 --- /dev/null +++ b/terraforrm/env/prod/backend.tfvars @@ -0,0 +1,4 @@ +bucket = "hackaton-terraform-tfstate" +key = "terraform.tfstate" +region = "us-east-1" +dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraforrm/env/prod/terraform.tfvars b/terraforrm/env/prod/terraform.tfvars new file mode 100644 index 0000000..7588bfb --- /dev/null +++ b/terraforrm/env/prod/terraform.tfvars @@ -0,0 +1,3 @@ +bucket_name = "prod-thumb-processor-hackaton" +env = "prod" +queue_name = "prod-thumb-processor-hackaton-queue" \ No newline at end of file diff --git a/terraforrm/output.tf b/terraforrm/output.tf new file mode 100644 index 0000000..8e563fb --- /dev/null +++ b/terraforrm/output.tf @@ -0,0 +1,53 @@ +output "queue_arn" { + value = module.sqs.queue_arn +} + +output "queue_id" { + value = module.sqs.queue_id + +} + +output "queue_arn_static" { + value = module.sqs.queue_arn_static + +} + +output "queue_name" { + value = module.sqs.queue_name + +} + +output "queue_url" { + value = module.sqs.queue_url + +} + +output "s3_bucket_id" { + description = "The name of the bucket." + value = module.s3_bucket.s3_bucket_id +} + +output "s3_bucket_arn" { + description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." + value = module.s3_bucket.s3_bucket_arn +} + +output "s3_bucket_region" { + description = "The AWS region this bucket resides in." + value = module.s3_bucket.s3_bucket_region +} + +output "sqs_dlq_arn" { + description = "The ARN of the SQS queue" + value = module.sqs.dead_letter_queue_arn +} + +output "sqs_dlq_name" { + description = "The name of the SQS queue" + value = module.sqs.dead_letter_queue_name +} + +output "sqs_dlq_id" { + description = "The URL for the created Amazon SQS queue" + value = module.sqs.dead_letter_queue_id +} \ No newline at end of file diff --git a/terraforrm/providers.tf b/terraforrm/providers.tf new file mode 100644 index 0000000..20acdf0 --- /dev/null +++ b/terraforrm/providers.tf @@ -0,0 +1,15 @@ +terraform { + required_version = ">= 1.10.5" + required_providers { + aws = { + source = "hashicorp/aws" + version = "5.86.0" + } + } + backend "s3" {} +} + +provider "aws" { + region = "us-east-1" +} + diff --git a/terraforrm/s3.tf b/terraforrm/s3.tf new file mode 100644 index 0000000..0e77dcb --- /dev/null +++ b/terraforrm/s3.tf @@ -0,0 +1,18 @@ +module "s3_bucket" { + source = "terraform-aws-modules/s3-bucket/aws" + version = "4.5.0" + + bucket = var.bucket_name + acl = "private" + + control_object_ownership = true + object_ownership = "ObjectWriter" + + versioning = { + enabled = true + } + + tags = { + ManagedBy = "Terraform" + } +} \ No newline at end of file diff --git a/terraforrm/sqs.tf b/terraforrm/sqs.tf new file mode 100644 index 0000000..169db92 --- /dev/null +++ b/terraforrm/sqs.tf @@ -0,0 +1,49 @@ +module "sqs" { + source = "terraform-aws-modules/sqs/aws" + version = "4.2.1" + + name = var.queue_name + + fifo_queue = true + create_queue_policy = true + + queue_policy_statements = { + account = { + sid = "AccountReadWrite" + actions = [ + "sqs:SendMessage", + "sqs:ReceiveMessage", + ] + principals = [ + { + type = "AWS" + identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"] + } + ] + } + } + + create_dlq = true + create_dlq_queue_policy = true + dlq_queue_policy_statements = { + account = { + sid = "AccountReadWrite" + actions = [ + "sqs:SendMessage", + "sqs:ReceiveMessage", + ] + principals = [ + { + type = "AWS" + identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"] + } + ] + } + } + + tags = { + Environment = var.env + ManagedBy = "Terraform" + } + +} \ No newline at end of file diff --git a/terraforrm/variables.tf b/terraforrm/variables.tf new file mode 100644 index 0000000..05edcfe --- /dev/null +++ b/terraforrm/variables.tf @@ -0,0 +1,17 @@ +variable "queue_name" { + description = "The name of the SQS queue" + type = string + +} + +variable "bucket_name" { + description = "The name of the S3 bucket" + type = string + +} + +variable "env" { + description = "The environment" + type = string + +} \ No newline at end of file From 89f0fcb5ab9aa36cd1da209e2bc72d7c4925a829 Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 19:55:32 -0300 Subject: [PATCH 2/7] Fix path dir --- {terraforrm => terraform}/data.tf | 0 {terraforrm => terraform}/env/dev/backend.tfvars | 0 {terraforrm => terraform}/env/dev/terraform.tfvars | 0 {terraforrm => terraform}/env/prod/backend.tfvars | 0 {terraforrm => terraform}/env/prod/terraform.tfvars | 0 {terraforrm => terraform}/output.tf | 0 {terraforrm => terraform}/providers.tf | 0 {terraforrm => terraform}/s3.tf | 0 {terraforrm => terraform}/sqs.tf | 0 {terraforrm => terraform}/variables.tf | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename {terraforrm => terraform}/data.tf (100%) rename {terraforrm => terraform}/env/dev/backend.tfvars (100%) rename {terraforrm => terraform}/env/dev/terraform.tfvars (100%) rename {terraforrm => terraform}/env/prod/backend.tfvars (100%) rename {terraforrm => terraform}/env/prod/terraform.tfvars (100%) rename {terraforrm => terraform}/output.tf (100%) rename {terraforrm => terraform}/providers.tf (100%) rename {terraforrm => terraform}/s3.tf (100%) rename {terraforrm => terraform}/sqs.tf (100%) rename {terraforrm => terraform}/variables.tf (100%) diff --git a/terraforrm/data.tf b/terraform/data.tf similarity index 100% rename from terraforrm/data.tf rename to terraform/data.tf diff --git a/terraforrm/env/dev/backend.tfvars b/terraform/env/dev/backend.tfvars similarity index 100% rename from terraforrm/env/dev/backend.tfvars rename to terraform/env/dev/backend.tfvars diff --git a/terraforrm/env/dev/terraform.tfvars b/terraform/env/dev/terraform.tfvars similarity index 100% rename from terraforrm/env/dev/terraform.tfvars rename to terraform/env/dev/terraform.tfvars diff --git a/terraforrm/env/prod/backend.tfvars b/terraform/env/prod/backend.tfvars similarity index 100% rename from terraforrm/env/prod/backend.tfvars rename to terraform/env/prod/backend.tfvars diff --git a/terraforrm/env/prod/terraform.tfvars b/terraform/env/prod/terraform.tfvars similarity index 100% rename from terraforrm/env/prod/terraform.tfvars rename to terraform/env/prod/terraform.tfvars diff --git a/terraforrm/output.tf b/terraform/output.tf similarity index 100% rename from terraforrm/output.tf rename to terraform/output.tf diff --git a/terraforrm/providers.tf b/terraform/providers.tf similarity index 100% rename from terraforrm/providers.tf rename to terraform/providers.tf diff --git a/terraforrm/s3.tf b/terraform/s3.tf similarity index 100% rename from terraforrm/s3.tf rename to terraform/s3.tf diff --git a/terraforrm/sqs.tf b/terraform/sqs.tf similarity index 100% rename from terraforrm/sqs.tf rename to terraform/sqs.tf diff --git a/terraforrm/variables.tf b/terraform/variables.tf similarity index 100% rename from terraforrm/variables.tf rename to terraform/variables.tf From 1aea8bc515981ef0f45e1ca3258ce8d11c08aaa5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Feb 2025 22:55:47 +0000 Subject: [PATCH 3/7] terraform-docs: automated action --- terraform/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 terraform/README.md diff --git a/terraform/README.md b/terraform/README.md new file mode 100644 index 0000000..91366e5 --- /dev/null +++ b/terraform/README.md @@ -0,0 +1,27 @@ + + + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [bucket\_name](#input\_bucket\_name) | The name of the S3 bucket | `string` | n/a | yes | +| [env](#input\_env) | The environment | `string` | n/a | yes | +| [queue\_name](#input\_queue\_name) | The name of the SQS queue | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [queue\_arn](#output\_queue\_arn) | n/a | +| [queue\_arn\_static](#output\_queue\_arn\_static) | n/a | +| [queue\_id](#output\_queue\_id) | n/a | +| [queue\_name](#output\_queue\_name) | n/a | +| [queue\_url](#output\_queue\_url) | n/a | +| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | +| [s3\_bucket\_id](#output\_s3\_bucket\_id) | The name of the bucket. | +| [s3\_bucket\_region](#output\_s3\_bucket\_region) | The AWS region this bucket resides in. | +| [sqs\_dlq\_arn](#output\_sqs\_dlq\_arn) | The ARN of the SQS queue | +| [sqs\_dlq\_id](#output\_sqs\_dlq\_id) | The URL for the created Amazon SQS queue | +| [sqs\_dlq\_name](#output\_sqs\_dlq\_name) | The name of the SQS queue | + \ No newline at end of file From 24c600c8d8f347736ad4fcb01b683bb911062afb Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 19:58:11 -0300 Subject: [PATCH 4/7] Fix path --- terraform/envs/dev/backend.tfvars | 4 ++++ terraform/envs/dev/terraform.tfvars | 3 +++ terraform/envs/prod/backend.tfvars | 4 ++++ terraform/envs/prod/terraform.tfvars | 3 +++ 4 files changed, 14 insertions(+) create mode 100644 terraform/envs/dev/backend.tfvars create mode 100644 terraform/envs/dev/terraform.tfvars create mode 100644 terraform/envs/prod/backend.tfvars create mode 100644 terraform/envs/prod/terraform.tfvars diff --git a/terraform/envs/dev/backend.tfvars b/terraform/envs/dev/backend.tfvars new file mode 100644 index 0000000..fba9fb7 --- /dev/null +++ b/terraform/envs/dev/backend.tfvars @@ -0,0 +1,4 @@ +bucket = "hackaton-challanger-fiap" +key = "terraform.tfstate" +region = "us-east-1" +dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraform/envs/dev/terraform.tfvars b/terraform/envs/dev/terraform.tfvars new file mode 100644 index 0000000..e5984af --- /dev/null +++ b/terraform/envs/dev/terraform.tfvars @@ -0,0 +1,3 @@ +bucket_name = "dev-thumb-processor-hackaton" +env = "dev" +queue_name = "dev-thumb-processor-hackaton-queue" \ No newline at end of file diff --git a/terraform/envs/prod/backend.tfvars b/terraform/envs/prod/backend.tfvars new file mode 100644 index 0000000..5850625 --- /dev/null +++ b/terraform/envs/prod/backend.tfvars @@ -0,0 +1,4 @@ +bucket = "hackaton-terraform-tfstate" +key = "terraform.tfstate" +region = "us-east-1" +dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraform/envs/prod/terraform.tfvars b/terraform/envs/prod/terraform.tfvars new file mode 100644 index 0000000..7588bfb --- /dev/null +++ b/terraform/envs/prod/terraform.tfvars @@ -0,0 +1,3 @@ +bucket_name = "prod-thumb-processor-hackaton" +env = "prod" +queue_name = "prod-thumb-processor-hackaton-queue" \ No newline at end of file From 8aecf2daf120040b5d1a965158afee054067a93c Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 19:58:13 -0300 Subject: [PATCH 5/7] Fix path --- terraform/env/dev/backend.tfvars | 4 ---- terraform/env/dev/terraform.tfvars | 3 --- terraform/env/prod/backend.tfvars | 4 ---- terraform/env/prod/terraform.tfvars | 3 --- 4 files changed, 14 deletions(-) delete mode 100644 terraform/env/dev/backend.tfvars delete mode 100644 terraform/env/dev/terraform.tfvars delete mode 100644 terraform/env/prod/backend.tfvars delete mode 100644 terraform/env/prod/terraform.tfvars diff --git a/terraform/env/dev/backend.tfvars b/terraform/env/dev/backend.tfvars deleted file mode 100644 index fba9fb7..0000000 --- a/terraform/env/dev/backend.tfvars +++ /dev/null @@ -1,4 +0,0 @@ -bucket = "hackaton-challanger-fiap" -key = "terraform.tfstate" -region = "us-east-1" -dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraform/env/dev/terraform.tfvars b/terraform/env/dev/terraform.tfvars deleted file mode 100644 index e5984af..0000000 --- a/terraform/env/dev/terraform.tfvars +++ /dev/null @@ -1,3 +0,0 @@ -bucket_name = "dev-thumb-processor-hackaton" -env = "dev" -queue_name = "dev-thumb-processor-hackaton-queue" \ No newline at end of file diff --git a/terraform/env/prod/backend.tfvars b/terraform/env/prod/backend.tfvars deleted file mode 100644 index 5850625..0000000 --- a/terraform/env/prod/backend.tfvars +++ /dev/null @@ -1,4 +0,0 @@ -bucket = "hackaton-terraform-tfstate" -key = "terraform.tfstate" -region = "us-east-1" -dynamodb_table = "terraform-tfstate" \ No newline at end of file diff --git a/terraform/env/prod/terraform.tfvars b/terraform/env/prod/terraform.tfvars deleted file mode 100644 index 7588bfb..0000000 --- a/terraform/env/prod/terraform.tfvars +++ /dev/null @@ -1,3 +0,0 @@ -bucket_name = "prod-thumb-processor-hackaton" -env = "prod" -queue_name = "prod-thumb-processor-hackaton-queue" \ No newline at end of file From 7b8717c55629a33a5e69f2dcab3ee0c646da8aac Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 20:20:34 -0300 Subject: [PATCH 6/7] Ajuste backend name --- terraform/envs/prod/backend.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/envs/prod/backend.tfvars b/terraform/envs/prod/backend.tfvars index 5850625..fba9fb7 100644 --- a/terraform/envs/prod/backend.tfvars +++ b/terraform/envs/prod/backend.tfvars @@ -1,4 +1,4 @@ -bucket = "hackaton-terraform-tfstate" +bucket = "hackaton-challanger-fiap" key = "terraform.tfstate" region = "us-east-1" dynamodb_table = "terraform-tfstate" \ No newline at end of file From bd95639c8f14080357f64a3c208f363a77cf5903 Mon Sep 17 00:00:00 2001 From: Paulo Barreto Date: Mon, 10 Feb 2025 20:31:14 -0300 Subject: [PATCH 7/7] Fix version terraform --- .github/workflows/Production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Production.yml b/.github/workflows/Production.yml index 1ffc99d..becad94 100644 --- a/.github/workflows/Production.yml +++ b/.github/workflows/Production.yml @@ -37,7 +37,7 @@ jobs: - name: Setup Terraform uses: hashicorp/setup-terraform@v3 with: - terraform_version: 1.9.5 + terraform_version: 1.10.5 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4