From b4f88eeea761a8fb8f7fc94b2a91d0cfc9a50734 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Thu, 8 Aug 2024 17:10:07 -0300 Subject: [PATCH 01/13] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 37 +++++++++++++++++++++++++++++++++++++ main.tf | 8 ++++---- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2a632a1..24b54f1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,39 @@ # terraform-aws-Victor-Borges-Silva_iac Repositório destinado ao projeto final. + + +## Requirements + +| Name | Version | +|------|---------| +| [aws](#requirement\_aws) | 5.58.0 | + +## Providers + +No providers. + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.1 | +| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.1 | +| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.2 | +| [instancias](#module\_instancias) | git@github.com:Victor-Borges-Silva/Modulo-instancias.git | v1.0.3 | +| [lambda\_desliga](#module\_lambda\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git | v1.0.3 | +| [lambda\_inicia](#module\_lambda\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git | v1.0.4 | + +## Resources + +No resources. + +## Inputs + +No inputs. + +## Outputs + +| Name | Description | +|------|-------------| +| [ARN\_iam\_role](#output\_ARN\_iam\_role) | n/a | + \ No newline at end of file diff --git a/main.tf b/main.tf index 5fbca54..80d6cc2 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ module "instancias" { - source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.2" + source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" numero_de_ec2 = 3 tags = { @@ -11,7 +11,7 @@ module "instancias" { module "iam_policy_role" { - source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.1" + source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.2" #Criação da politica policy_name = "Inicia_Desliga_EC2" @@ -25,7 +25,7 @@ module "iam_policy_role" { module "lambda_inicia" { #source = "../../../Modulo-lambda-inicia" - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.2" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" nome_funcao_inicia = "IniciaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn @@ -33,7 +33,7 @@ module "lambda_inicia" { module "lambda_desliga" { #source = "../../../Modulo-lambda-desliga" - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.2" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" nome_funcao_desliga = "DesligaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn From 09975b0c5cfa6fe9141414fceaba7e8933a7b9d1 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Mon, 30 Sep 2024 21:52:29 -0300 Subject: [PATCH 02/13] =?UTF-8?q?Inclus=C3=A3o=20do=20source=20local=20e?= =?UTF-8?q?=20ajuste=20do=20modulo=20de=20backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 51 +++++++++++++++++++++++++++++++++++---------------- outputs.tf | 6 +++--- plano | Bin 15251 -> 19115 bytes 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/main.tf b/main.tf index 80d6cc2..16dd7b7 100644 --- a/main.tf +++ b/main.tf @@ -1,48 +1,55 @@ module "instancias" { - source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" - numero_de_ec2 = 3 + source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" + #source = "../Modulo-instancias/" + + numero_de_ec2 = 1 tags = { Name = "Teste" Terraform = "Sim" Environment = "Dev" + Backup = "true" } } module "iam_policy_role" { - source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.2" + source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.4" + #source = "../Modulo-iam/" - #Criação da politica + #Criação da politica para EC2 policy_name = "Inicia_Desliga_EC2" policy_description = "Policy que permite o Lambda a desligar e ligar as instâncias EC2" - #Criação da Role + #Criação da role para EC2 role_name = "Inicia_Desliga_EC2" role_description = "Função que permite o Lambda a desligar e ligar as instâncias EC2" + #Criação de role para AWSBackup + nome_role_backup = "role_backup" + description_role_backup = "Função que permite o cofre gerenciar os backups" } module "lambda_inicia" { - #source = "../../../Modulo-lambda-inicia" - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" + #source = "../Modulo-lambda-inicia/" nome_funcao_inicia = "IniciaEC2" instancia_id = module.instancias.instance_id - role = module.iam_policy_role.iam_role_arn + role = module.iam_policy_role.iam_role_arn_ec2 } module "lambda_desliga" { - #source = "../../../Modulo-lambda-desliga" - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" + #source = "../Modulo-lambda-desliga/" nome_funcao_desliga = "DesligaEC2" instancia_id = module.instancias.instance_id - role = module.iam_policy_role.iam_role_arn + role = module.iam_policy_role.iam_role_arn_ec2 } module "cloudwatch_inicia" { - #source = "../../../Modulo-cloudwatch-inicia" - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.1" + source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.2" + #source = "../Modulo-cloudwatch-inicia/" cloudwatch_inicia_name = "Horario_de_inicio" cloudwatch_inicio_description = "Agendamento para desligar as instancias" aws_region_inicia = "us-west-1" @@ -52,12 +59,24 @@ module "cloudwatch_inicia" { } module "cloudwatch_desliga" { - #source = "../../../Modulo-cloudwatch-desliga" - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.1" + source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.2" + #source = "../Modulo-cloudwatch-desliga/" cloudwatch_desliga_name = "Horario_de_desligamento" cloudwatch_desliga_description = "Agendamento para desligar as instancias" aws_region_desliga = "us-west-1" statement_id = "permite_EventBridge_executar_lambda_desliga" lambda_function_arn_desliga = module.lambda_desliga.lambda_function_arn lambda_function_name_desliga = module.lambda_desliga.lambda_function_name_desliga -} \ No newline at end of file +} + +module "Backup" { + source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.3" + #source = "../Modulo-bakcup/" + nome_cofre = "cofre_backup_tag" + nome_plano_backup = "plano_backup_tag" + nome_regra = "backup_tag_diario" + agendamento_backup = "cron(0 15 * * ? *)" # agendametno é feito conforme horário UTC +00 + quantidade_dias_para_delecao = 7 + nome_selecao_alvo_tag = "selecao_alvo_tag" + iam_role_arn_backup = module.iam_policy_role.iam_role_arn_backup +} diff --git a/outputs.tf b/outputs.tf index d0f9f20..4d32bc2 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,3 +1,3 @@ -output "ARN_iam_role" { - value = module.iam_policy_role.iam_role_arn -} +#output "ARN_iam_role" { +# value = module.iam_policy_role.iam_role_arn +#} diff --git a/plano b/plano index 7b86b17c11f8b997df442db4fef4b7c30110acea..3c477a8df0a1abc582b7124b3cbf1cc5d10f04ab 100644 GIT binary patch delta 14306 zcmajGbzD?i_dh-~0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h!NISTgDf)9`A&sG1Hj2Y3iAcvsI zwR_4eTnEV8Df=Uk7yfS`9|C^@xi7eo?=K)%{|;o_n>TSkfh=`UbwYSOrd<$aR?dcl z5uYXt<_{LiCQlKz+L-?$@4qq1gf>N(+18VyC!p+JEdux>khy*W*;B1-{Ql-Ajs?2d zvQL=u`G3Q4#3g#~b7-I-|Hd(RN0jv;Sj`{}m3}U0F>s4txZ~Ow#2!Vn(mx$Rl+2TD zHyvI=3-+w6?6ryB>qO%{gKRTv?lfCuwO1(v{|PfrB>} zPnHd-&d4#0qU-@OuH-P}fo{5&ULx1XBYW#y;z;7fH=G{s;v60-*fU)&Kx6pnn|jvGew^^s)V?q4~FTu`9Hrg~}vB z5A@%pZJ}ei|46fYc-i_wRRI5LivF$R*I5SMZ#oE|gFGKQYj-z0M|)0JcFupdSO3<; z6V_KK3$;WMdJz7m35x)#34A6^g7>p6`h9mK3KFOw zrP%+sQ@_^T%)cq%B!?>C;{KDLzm|72zX|D50Kk)MOn;O*>)TvcftvU8_}$hgR6nK2 zz=)iffAsR%aLsdGXg(l=<^zV`e(#bBTrbc5$6$rak-|mO{H3^E4(E@Gf317|~5|Gpe)tds< z`@6>z3}9?UvY++X9|eCc0jPg7XonFh$n-~pR1`^J2bdr9)(Bw!@fJfRQdoZ$=q>nQ zcOfLOn#i9c_3LBycLp%C{v&)R@@LzBP5V^8*)GfWA7Q*dI{j-RB=}8`f&6VB9 From 8fbd45f2e93796558b4ca8306b1e0a5d3ea49508 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Mon, 30 Sep 2024 21:58:59 -0300 Subject: [PATCH 03/13] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 24b54f1..09bfc7b 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,10 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.1 | -| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.1 | -| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.2 | +| [Backup](#module\_Backup) | git@github.com:Victor-Borges-Silva/Modulo-bakcup.git | v1.0.3 | +| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.2 | +| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.2 | +| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.4 | | [instancias](#module\_instancias) | git@github.com:Victor-Borges-Silva/Modulo-instancias.git | v1.0.3 | | [lambda\_desliga](#module\_lambda\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git | v1.0.3 | | [lambda\_inicia](#module\_lambda\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git | v1.0.4 | @@ -33,7 +34,5 @@ No inputs. ## Outputs -| Name | Description | -|------|-------------| -| [ARN\_iam\_role](#output\_ARN\_iam\_role) | n/a | +No outputs. \ No newline at end of file From 7ffee99cde52bbd99c523779f7dcfb59085116ae Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Tue, 8 Oct 2024 10:14:14 -0300 Subject: [PATCH 04/13] Adicionando pipeline de prod --- .github/workflows/tf_apply.yaml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/tf_apply.yaml diff --git a/.github/workflows/tf_apply.yaml b/.github/workflows/tf_apply.yaml new file mode 100644 index 0000000..98e0127 --- /dev/null +++ b/.github/workflows/tf_apply.yaml @@ -0,0 +1,39 @@ +name: Terraform Apply +on: + push: + branches: + - main + + +jobs: + terraform-apply: + runs-on: ubuntu-latest + + environment: prd + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + + - name: Terraform Init + run: terraform init + + - name: Terraform Plan + id: plan + run: terraform plan -out=plano + + - name: Terraform Apply + run: terraform apply -auto-approve plano + + - name: Clean up plan file + run: rm -f plano \ No newline at end of file From c684349b01154fc9147915ced8d38a9ef29025b9 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Tue, 8 Oct 2024 10:37:17 -0300 Subject: [PATCH 05/13] =?UTF-8?q?Inclus=C3=A3o=20da=20chave=20SSH=20para?= =?UTF-8?q?=20clonar=20dos=20reposit=C3=B3rios=20remotos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tf_apply.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tf_apply.yaml b/.github/workflows/tf_apply.yaml index 98e0127..e9720a1 100644 --- a/.github/workflows/tf_apply.yaml +++ b/.github/workflows/tf_apply.yaml @@ -24,6 +24,10 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 + + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: "${{ secrets.SSH_PRIVATE_KEY }}" - name: Terraform Init run: terraform init From 673bec7f0b014ffbab5e90010d41bf69d0d560e3 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Tue, 8 Oct 2024 11:25:48 -0300 Subject: [PATCH 06/13] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20nome=20da=20?= =?UTF-8?q?instancia=20e=20armazenamento=20do=20state=20no=20s3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tf_apply.yaml | 2 +- main.tf | 2 +- outputs.tf | 6 +++++- provider.tf | 10 +++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tf_apply.yaml b/.github/workflows/tf_apply.yaml index e9720a1..6073268 100644 --- a/.github/workflows/tf_apply.yaml +++ b/.github/workflows/tf_apply.yaml @@ -23,7 +23,7 @@ jobs: with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-1 + aws-region: us-west-1 - uses: webfactory/ssh-agent@v0.9.0 with: diff --git a/main.tf b/main.tf index 16dd7b7..f7eb154 100644 --- a/main.tf +++ b/main.tf @@ -5,7 +5,7 @@ module "instancias" { numero_de_ec2 = 1 tags = { - Name = "Teste" + Name = "Projeto_Final" Terraform = "Sim" Environment = "Dev" Backup = "true" diff --git a/outputs.tf b/outputs.tf index 4d32bc2..7857ac9 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,3 +1,7 @@ #output "ARN_iam_role" { -# value = module.iam_policy_role.iam_role_arn +# value = module.iam_policy_role.Inicia_Desliga_EC2.arn +#} + +#output "instance_id" { +# value = module.instancias.web.id #} diff --git a/provider.tf b/provider.tf index 53af7ac..5f45926 100644 --- a/provider.tf +++ b/provider.tf @@ -1,9 +1,9 @@ terraform { - # backend "s3" { - # bucket = "descomplicando-terraform-turma-2024" #nome do bucket - # key = "aula_backend" - # region = "us-east-1" - # } + backend "s3" { + bucket = "descomplicando-terraform-turma-2024-vborges" #nome do bucket + key = "projeto_final" + region = "us-west-1" + } required_providers { aws = { From d71bb5bcd33e3dff47b6f0b710789062dc52ca3d Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Sun, 20 Oct 2024 15:31:51 -0300 Subject: [PATCH 07/13] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20componente.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 68 ++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/main.tf b/main.tf index f7eb154..5d9abcb 100644 --- a/main.tf +++ b/main.tf @@ -1,8 +1,9 @@ module "instancias" { - source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" - #source = "../Modulo-instancias/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" + source = "../Modulo-instancias/" - numero_de_ec2 = 1 + numero_de_ec2 = 1 + tipo_instancia = "t3.micro" tags = { Name = "Projeto_Final" @@ -14,8 +15,8 @@ module "instancias" { module "iam_policy_role" { - source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.4" - #source = "../Modulo-iam/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.4" + source = "../Modulo-iam/" #Criação da politica para EC2 policy_name = "Inicia_Desliga_EC2" @@ -31,52 +32,73 @@ module "iam_policy_role" { } module "lambda_inicia" { - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" - #source = "../Modulo-lambda-inicia/" - nome_funcao_inicia = "IniciaEC2" - instancia_id = module.instancias.instance_id - role = module.iam_policy_role.iam_role_arn_ec2 + #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" + source = "../Modulo-lambda-inicia/" + nome_funcao_inicia = "IniciaEC2" + instancia_id = module.instancias.instance_id + role = module.iam_policy_role.iam_role_arn_ec2 + tamanho_memoria = 128 + timeout = 3 + armazenamento_temporario = 512 + rastreio_log = "Active" + } module "lambda_desliga" { - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" - #source = "../Modulo-lambda-desliga/" - nome_funcao_desliga = "DesligaEC2" - instancia_id = module.instancias.instance_id - role = module.iam_policy_role.iam_role_arn_ec2 + #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" + source = "../Modulo-lambda-desliga/" + nome_funcao_desliga = "DesligaEC2" + instancia_id = module.instancias.instance_id + role = module.iam_policy_role.iam_role_arn_ec2 + tamanho_memoria = 128 + timeout = 3 + armazenamento_temporario = 512 + rastreio_log = "Active" } module "cloudwatch_inicia" { - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.2" - #source = "../Modulo-cloudwatch-inicia/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.2" + source = "../Modulo-cloudwatch-inicia/" cloudwatch_inicia_name = "Horario_de_inicio" + agendamento_cron = "cron(0 8 ? * MON-FRI *)" + estado = "ENABLED" + evento_cloudwatch = "default" cloudwatch_inicio_description = "Agendamento para desligar as instancias" - aws_region_inicia = "us-west-1" statement_id = "permite_EventBridge_executar_lambda_inicia" + nome_alvo = "Funcao_Lambda_IniciaEC2" lambda_function_arn_inicia = module.lambda_inicia.lambda_function_arn lambda_function_name_inicia = module.lambda_inicia.lambda_function_name_inicia } module "cloudwatch_desliga" { - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.2" - #source = "../Modulo-cloudwatch-desliga/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.2" + source = "../Modulo-cloudwatch-desliga/" cloudwatch_desliga_name = "Horario_de_desligamento" + agendamento_cron = "cron(0 22 ? * MON-FRI *)" + estado = "ENABLED" + evento_cloudwatch = "default" cloudwatch_desliga_description = "Agendamento para desligar as instancias" - aws_region_desliga = "us-west-1" statement_id = "permite_EventBridge_executar_lambda_desliga" + nome_alvo = "Funcao_Lambda_DesligaEC2" lambda_function_arn_desliga = module.lambda_desliga.lambda_function_arn lambda_function_name_desliga = module.lambda_desliga.lambda_function_name_desliga } module "Backup" { - source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.3" - #source = "../Modulo-bakcup/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.3" + source = "../Modulo-bakcup/" nome_cofre = "cofre_backup_tag" + force_destruir = true nome_plano_backup = "plano_backup_tag" nome_regra = "backup_tag_diario" agendamento_backup = "cron(0 15 * * ? *)" # agendametno é feito conforme horário UTC +00 + inicio_manutencao = 60 #Especifique(em minutos) o período em que o plano de backup será iniciado, caso não comece no horário especificado. + janela_manutencao = 180 #Defina(em minutos) o período durante o qual o backup deve ser concluído antes de retornar qualquer erro por timeout. quantidade_dias_para_delecao = 7 nome_selecao_alvo_tag = "selecao_alvo_tag" iam_role_arn_backup = module.iam_policy_role.iam_role_arn_backup + selecao_recurso_tag_type = "STRINGEQUALS" + selecao_recurso_tag_key = "Backup" + selecao_recurso_tag_value = "true" } From 4d9d08b4a1a916f2cf53bac029fff7f41f7c8228 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Sun, 20 Oct 2024 15:47:01 -0300 Subject: [PATCH 08/13] Atualizando README --- README.md | 14 +++++++------- main.tf | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 09bfc7b..0f6b851 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,13 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [Backup](#module\_Backup) | git@github.com:Victor-Borges-Silva/Modulo-bakcup.git | v1.0.3 | -| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.2 | -| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.2 | -| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.4 | -| [instancias](#module\_instancias) | git@github.com:Victor-Borges-Silva/Modulo-instancias.git | v1.0.3 | -| [lambda\_desliga](#module\_lambda\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git | v1.0.3 | -| [lambda\_inicia](#module\_lambda\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git | v1.0.4 | +| [Backup](#module\_Backup) | git@github.com:Victor-Borges-Silva/Modulo-bakcup.git | v1.0.4 | +| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.3 | +| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.3 | +| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.5 | +| [instancias](#module\_instancias) | git@github.com:Victor-Borges-Silva/Modulo-instancias.git | v1.0.4 | +| [lambda\_desliga](#module\_lambda\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git | v1.0.4 | +| [lambda\_inicia](#module\_lambda\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git | v1.0.5 | ## Resources diff --git a/main.tf b/main.tf index 5d9abcb..760f037 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ module "instancias" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.3" - source = "../Modulo-instancias/" + source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.4" + #source = "../Modulo-instancias/" numero_de_ec2 = 1 tipo_instancia = "t3.micro" @@ -15,8 +15,8 @@ module "instancias" { module "iam_policy_role" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.4" - source = "../Modulo-iam/" + source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.5" + #source = "../Modulo-iam/" #Criação da politica para EC2 policy_name = "Inicia_Desliga_EC2" @@ -32,8 +32,8 @@ module "iam_policy_role" { } module "lambda_inicia" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.4" - source = "../Modulo-lambda-inicia/" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.5" + #source = "../Modulo-lambda-inicia/" nome_funcao_inicia = "IniciaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn_ec2 @@ -45,8 +45,8 @@ module "lambda_inicia" { } module "lambda_desliga" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.3" - source = "../Modulo-lambda-desliga/" + source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.4" + #source = "../Modulo-lambda-desliga/" nome_funcao_desliga = "DesligaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn_ec2 @@ -58,8 +58,8 @@ module "lambda_desliga" { } module "cloudwatch_inicia" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.2" - source = "../Modulo-cloudwatch-inicia/" + source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.3" + #source = "../Modulo-cloudwatch-inicia/" cloudwatch_inicia_name = "Horario_de_inicio" agendamento_cron = "cron(0 8 ? * MON-FRI *)" estado = "ENABLED" @@ -72,8 +72,8 @@ module "cloudwatch_inicia" { } module "cloudwatch_desliga" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.2" - source = "../Modulo-cloudwatch-desliga/" + source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.3" + #source = "../Modulo-cloudwatch-desliga/" cloudwatch_desliga_name = "Horario_de_desligamento" agendamento_cron = "cron(0 22 ? * MON-FRI *)" estado = "ENABLED" @@ -86,8 +86,8 @@ module "cloudwatch_desliga" { } module "Backup" { - #source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.3" - source = "../Modulo-bakcup/" + source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.4" + #source = "../Modulo-bakcup/" nome_cofre = "cofre_backup_tag" force_destruir = true nome_plano_backup = "plano_backup_tag" From fd2584bb15de4b29bf53645f62c3f6d2f9fd2632 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Sun, 24 Nov 2024 22:52:45 -0300 Subject: [PATCH 09/13] Atualizacao --- .github/workflows/tf_apply.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tf_apply.yaml b/.github/workflows/tf_apply.yaml index 6073268..17db4d9 100644 --- a/.github/workflows/tf_apply.yaml +++ b/.github/workflows/tf_apply.yaml @@ -4,7 +4,6 @@ on: branches: - main - jobs: terraform-apply: runs-on: ubuntu-latest From 1c57494bfbe5c6628c281584781f4b10022176e6 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Wed, 8 Jan 2025 17:51:30 -0300 Subject: [PATCH 10/13] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20das=20refer=C3=AA?= =?UTF-8?q?ncias=20de=20m=C3=B3dulos=20para=20caminhos=20locais=20e=20adi?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20vari=C3=A1veis=20para=20configura=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20pol=C3=ADticas=20e=20roles=20IAM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 57 ++++++++++++++++++++++++++++++++++------------------ provider.tf | 10 +++++---- variables.tf | 43 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 24 deletions(-) diff --git a/main.tf b/main.tf index 760f037..ff99b00 100644 --- a/main.tf +++ b/main.tf @@ -1,6 +1,6 @@ module "instancias" { - source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.4" - #source = "../Modulo-instancias/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.4" + source = "../Modulo-instancias/" numero_de_ec2 = 1 tipo_instancia = "t3.micro" @@ -15,25 +15,38 @@ module "instancias" { module "iam_policy_role" { - source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.5" - #source = "../Modulo-iam/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.5" + source = "../Modulo-iam/" + # for_each = { for atributo in var.modulo_iam_policy_role : null => atributo } + # + # #Criação da politica para EC2 + # policy_name = each.value.policy_name + # policy_description = each.value.policy_description + # + # #Criação da role para EC2 + # role_name = each.value.role_name + # role_description = each.value.role_description + # + # #Criação de role para AWSBackup + # nome_role_backup = each.value.nome_role_backup + # description_role_backup = each.value.description_role_backup #Criação da politica para EC2 - policy_name = "Inicia_Desliga_EC2" - policy_description = "Policy que permite o Lambda a desligar e ligar as instâncias EC2" + policy_name = var.policy_name + policy_description = var.policy_description #Criação da role para EC2 - role_name = "Inicia_Desliga_EC2" - role_description = "Função que permite o Lambda a desligar e ligar as instâncias EC2" + role_name = var.role_name + role_description = var.role_description #Criação de role para AWSBackup - nome_role_backup = "role_backup" - description_role_backup = "Função que permite o cofre gerenciar os backups" + nome_role_backup = var.nome_role_backup + description_role_backup = var.description_role_backup } module "lambda_inicia" { - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.5" - #source = "../Modulo-lambda-inicia/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.5" + source = "../Modulo-lambda-inicia/" nome_funcao_inicia = "IniciaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn_ec2 @@ -42,11 +55,12 @@ module "lambda_inicia" { armazenamento_temporario = 512 rastreio_log = "Active" + depends_on = [module.iam_policy_role] } module "lambda_desliga" { - source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.4" - #source = "../Modulo-lambda-desliga/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.4" + source = "../Modulo-lambda-desliga/" nome_funcao_desliga = "DesligaEC2" instancia_id = module.instancias.instance_id role = module.iam_policy_role.iam_role_arn_ec2 @@ -55,11 +69,12 @@ module "lambda_desliga" { armazenamento_temporario = 512 rastreio_log = "Active" + depends_on = [module.iam_policy_role] } module "cloudwatch_inicia" { - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.3" - #source = "../Modulo-cloudwatch-inicia/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.3" + source = "../Modulo-cloudwatch-inicia/" cloudwatch_inicia_name = "Horario_de_inicio" agendamento_cron = "cron(0 8 ? * MON-FRI *)" estado = "ENABLED" @@ -72,8 +87,8 @@ module "cloudwatch_inicia" { } module "cloudwatch_desliga" { - source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.3" - #source = "../Modulo-cloudwatch-desliga/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.3" + source = "../Modulo-cloudwatch-desliga/" cloudwatch_desliga_name = "Horario_de_desligamento" agendamento_cron = "cron(0 22 ? * MON-FRI *)" estado = "ENABLED" @@ -86,8 +101,8 @@ module "cloudwatch_desliga" { } module "Backup" { - source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.4" - #source = "../Modulo-bakcup/" + #source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.4" + source = "../Modulo-bakcup/" nome_cofre = "cofre_backup_tag" force_destruir = true nome_plano_backup = "plano_backup_tag" @@ -101,4 +116,6 @@ module "Backup" { selecao_recurso_tag_type = "STRINGEQUALS" selecao_recurso_tag_key = "Backup" selecao_recurso_tag_value = "true" + + depends_on = [module.iam_policy_role] } diff --git a/provider.tf b/provider.tf index 5f45926..eca97a6 100644 --- a/provider.tf +++ b/provider.tf @@ -1,8 +1,10 @@ terraform { - backend "s3" { - bucket = "descomplicando-terraform-turma-2024-vborges" #nome do bucket - key = "projeto_final" - region = "us-west-1" + # backend "s3" { + # bucket = "descomplicando-terraform-turma-2024-vborges" #nome do bucket + # key = "projeto_final" + # region = "us-west-1" + # } + backend "local" { } required_providers { diff --git a/variables.tf b/variables.tf index e69de29..7be0508 100644 --- a/variables.tf +++ b/variables.tf @@ -0,0 +1,43 @@ +#variable "modulo_iam_policy_role" { +# description = "Lista da variaveis que serão usadas no modulo iam_policy_role" +# type = set(object({ +# policy_name = string +# policy_description = string +# role_name = string +# role_description = string +# nome_role_backup = string +# description_role_backup = string +# })) +#} + +variable "policy_name" { + type = string + description = "Nome da politica" +} + +variable "policy_description" { + type = string + default = "Default_Varibletf" +} + +variable "role_name" { + type = string + description = "Nome da Funcao" +} + +variable "role_description" { + type = string + description = "Nome da role" +} + + +#IAM Role para o plano de backup +variable "nome_role_backup" { + type = string + description = "Nome da role/função para permitir o AWSBackup gerenciar os pontos de restauração" +} + +variable "description_role_backup" { + type = string + description = "Descrição para função IAM que permite o cofre gerenciar os backups" +} From ad080a53cc464599c70abb74749ca0cb59bb896c Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Fri, 10 Jan 2025 21:17:40 -0300 Subject: [PATCH 11/13] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20vari=C3=A1veis=20?= =?UTF-8?q?para=20configura=C3=A7=C3=A3o=20de=20inst=C3=A2ncias=20EC2=20e?= =?UTF-8?q?=20atualiza=C3=A7=C3=A3o=20das=20tags=20para=20uso=20din=C3=A2m?= =?UTF-8?q?ico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.tf | 23 ++++++++++++++--------- module.instancias.instance_id | 0 variables.tf | 35 ++++++++++++++++++++++++++++++++--- 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 module.instancias.instance_id diff --git a/main.tf b/main.tf index ff99b00..369bd0a 100644 --- a/main.tf +++ b/main.tf @@ -2,14 +2,15 @@ module "instancias" { #source = "git@github.com:Victor-Borges-Silva/Modulo-instancias.git?ref=v1.0.4" source = "../Modulo-instancias/" - numero_de_ec2 = 1 - tipo_instancia = "t3.micro" + numero_de_ec2 = var.numero_de_ec2 + tipo_instancia = var.tipo_instancia + for_each = { for atributo in var.tags : atributo.Name => atributo } tags = { - Name = "Projeto_Final" - Terraform = "Sim" - Environment = "Dev" - Backup = "true" + Name = each.value.Name + Terraform = each.value.Terraform + Environment = each.value.Environment + Backup = each.value.Backup } } @@ -17,7 +18,7 @@ module "instancias" { module "iam_policy_role" { #source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.5" source = "../Modulo-iam/" - # for_each = { for atributo in var.modulo_iam_policy_role : null => atributo } + # for_each = { for atributo in var.modulo_iam_policy_role : atributo.policy_name => atributo } # # #Criação da politica para EC2 # policy_name = each.value.policy_name @@ -44,11 +45,15 @@ module "iam_policy_role" { description_role_backup = var.description_role_backup } +locals { + instance_id = tolist(module.instancias.instance_id) +} + module "lambda_inicia" { #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.5" source = "../Modulo-lambda-inicia/" nome_funcao_inicia = "IniciaEC2" - instancia_id = module.instancias.instance_id + instancia_id = local.instance_id role = module.iam_policy_role.iam_role_arn_ec2 tamanho_memoria = 128 timeout = 3 @@ -62,7 +67,7 @@ module "lambda_desliga" { #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.4" source = "../Modulo-lambda-desliga/" nome_funcao_desliga = "DesligaEC2" - instancia_id = module.instancias.instance_id + instancia_id = local.instance_id role = module.iam_policy_role.iam_role_arn_ec2 tamanho_memoria = 128 timeout = 3 diff --git a/module.instancias.instance_id b/module.instancias.instance_id new file mode 100644 index 0000000..e69de29 diff --git a/variables.tf b/variables.tf index 7be0508..bd10de0 100644 --- a/variables.tf +++ b/variables.tf @@ -1,10 +1,39 @@ +#================================================================================ +# module instancias +#================================================================================ +variable "numero_de_ec2" { + type = number + description = "Quantidade de instancias EC2 a ser provisionada" +} + +variable "tipo_instancia" { + type = string + description = "Tipo de instancia EC2 a ser provisionada" +} + +variable "tags" { + type = set(object({ + Name = string + Terraform = string + Environment = string + Backup = string + })) + + description = "Etiqueta para as instancias EC2" +} + + +#================================================================================ +# module iam_policy_role +#================================================================================ + #variable "modulo_iam_policy_role" { # description = "Lista da variaveis que serão usadas no modulo iam_policy_role" # type = set(object({ -# policy_name = string -# policy_description = string +# policy_name = string +# policy_description = string # role_name = string -# role_description = string +# role_description = string # nome_role_backup = string # description_role_backup = string # })) From dc4c732136648605cae23734b9a325b39bfecb24 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Sat, 18 Jan 2025 00:15:20 -0300 Subject: [PATCH 12/13] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20vari=C3=A1veis=20?= =?UTF-8?q?para=20configura=C3=A7=C3=A3o=20de=20pol=C3=ADticas=20e=20roles?= =?UTF-8?q?=20IAM,=20e=20atualiza=C3=A7=C3=A3o=20do=20.gitignore=20para=20?= =?UTF-8?q?ignorar=20arquivos=20.tfvars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- main.tf | 92 ++++++++------- module.instancias.instance_id | 0 plano | Bin 19115 -> 0 bytes terraform.tfvars | 93 ++++++++++++++++ variables.tf | 203 ++++++++++++++++++++++++++++++---- 6 files changed, 328 insertions(+), 62 deletions(-) delete mode 100644 module.instancias.instance_id delete mode 100644 plano create mode 100644 terraform.tfvars diff --git a/.gitignore b/.gitignore index 2faf43d..b642afb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,7 @@ 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 # Ignore override files as they are usually used to override resources locally and so diff --git a/main.tf b/main.tf index 369bd0a..b642ea9 100644 --- a/main.tf +++ b/main.tf @@ -5,20 +5,28 @@ module "instancias" { numero_de_ec2 = var.numero_de_ec2 tipo_instancia = var.tipo_instancia - for_each = { for atributo in var.tags : atributo.Name => atributo } + #for_each = { for atributo in var.tags : atributo.Name => atributo } + #tags = { + # Name = each.value.Name + # Terraform = each.value.Terraform + # Environment = each.value.Environment + # Backup = each.value.Backup + #} + tags = { - Name = each.value.Name - Terraform = each.value.Terraform - Environment = each.value.Environment - Backup = each.value.Backup + Name = "Projeto_Final" + Terraform = "Sim" + Environment = "Dev" + Backup = "true" } + } module "iam_policy_role" { #source = "git@github.com:Victor-Borges-Silva/Modulo-iam.git?ref=v1.0.5" source = "../Modulo-iam/" - # for_each = { for atributo in var.modulo_iam_policy_role : atributo.policy_name => atributo } + # for_each = { for idx, atributo in var.modulo_iam_policy_role : idx.atributo => idx } # # #Criação da politica para EC2 # policy_name = each.value.policy_name @@ -52,13 +60,13 @@ locals { module "lambda_inicia" { #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git?ref=v1.0.5" source = "../Modulo-lambda-inicia/" - nome_funcao_inicia = "IniciaEC2" + nome_funcao_inicia = var.nome_funcao_inicia instancia_id = local.instance_id role = module.iam_policy_role.iam_role_arn_ec2 - tamanho_memoria = 128 - timeout = 3 - armazenamento_temporario = 512 - rastreio_log = "Active" + tamanho_memoria = var.tamanho_memoria + timeout = var.timeout + armazenamento_temporario = var.armazenamento_temporario + rastreio_log = var.rastreio_log depends_on = [module.iam_policy_role] } @@ -66,13 +74,13 @@ module "lambda_inicia" { module "lambda_desliga" { #source = "git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git?ref=v1.0.4" source = "../Modulo-lambda-desliga/" - nome_funcao_desliga = "DesligaEC2" + nome_funcao_desliga = var.nome_funcao_desliga instancia_id = local.instance_id role = module.iam_policy_role.iam_role_arn_ec2 - tamanho_memoria = 128 - timeout = 3 - armazenamento_temporario = 512 - rastreio_log = "Active" + tamanho_memoria = var.tamanho_memoria + timeout = var.timeout + armazenamento_temporario = var.armazenamento_temporario + rastreio_log = var.rastreio_log depends_on = [module.iam_policy_role] } @@ -80,13 +88,13 @@ module "lambda_desliga" { module "cloudwatch_inicia" { #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git?ref=v1.0.3" source = "../Modulo-cloudwatch-inicia/" - cloudwatch_inicia_name = "Horario_de_inicio" - agendamento_cron = "cron(0 8 ? * MON-FRI *)" - estado = "ENABLED" - evento_cloudwatch = "default" - cloudwatch_inicio_description = "Agendamento para desligar as instancias" - statement_id = "permite_EventBridge_executar_lambda_inicia" - nome_alvo = "Funcao_Lambda_IniciaEC2" + cloudwatch_inicia_name = var.cloudwatch_inicia_name + agendamento_cron = var.agendamento_cron + estado = var.estado + evento_cloudwatch = var.evento_cloudwatch + cloudwatch_inicio_description = var.cloudwatch_inicio_description + statement_id = var.statement_id + nome_alvo = var.nome_alvo lambda_function_arn_inicia = module.lambda_inicia.lambda_function_arn lambda_function_name_inicia = module.lambda_inicia.lambda_function_name_inicia } @@ -94,13 +102,13 @@ module "cloudwatch_inicia" { module "cloudwatch_desliga" { #source = "git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git?ref=v1.0.3" source = "../Modulo-cloudwatch-desliga/" - cloudwatch_desliga_name = "Horario_de_desligamento" - agendamento_cron = "cron(0 22 ? * MON-FRI *)" - estado = "ENABLED" - evento_cloudwatch = "default" - cloudwatch_desliga_description = "Agendamento para desligar as instancias" - statement_id = "permite_EventBridge_executar_lambda_desliga" - nome_alvo = "Funcao_Lambda_DesligaEC2" + cloudwatch_desliga_name = var.desliga_cloudwatch_desliga_name + agendamento_cron = var.desliga_agendamento_cron + estado = var.desliga_estado + evento_cloudwatch = var.desliga_evento_cloudwatch + cloudwatch_desliga_description = var.desliga_cloudwatch_desliga_description + statement_id = var.desliga_statement_id + nome_alvo = var.desliga_nome_alvo lambda_function_arn_desliga = module.lambda_desliga.lambda_function_arn lambda_function_name_desliga = module.lambda_desliga.lambda_function_name_desliga } @@ -108,19 +116,19 @@ module "cloudwatch_desliga" { module "Backup" { #source = "git@github.com:Victor-Borges-Silva/Modulo-bakcup.git?ref=v1.0.4" source = "../Modulo-bakcup/" - nome_cofre = "cofre_backup_tag" - force_destruir = true - nome_plano_backup = "plano_backup_tag" - nome_regra = "backup_tag_diario" - agendamento_backup = "cron(0 15 * * ? *)" # agendametno é feito conforme horário UTC +00 - inicio_manutencao = 60 #Especifique(em minutos) o período em que o plano de backup será iniciado, caso não comece no horário especificado. - janela_manutencao = 180 #Defina(em minutos) o período durante o qual o backup deve ser concluído antes de retornar qualquer erro por timeout. - quantidade_dias_para_delecao = 7 - nome_selecao_alvo_tag = "selecao_alvo_tag" + nome_cofre = var.nome_cofre + force_destruir = var.force_destruir + nome_plano_backup = var.nome_plano_backup + nome_regra = var.nome_regra + agendamento_backup = var.agendamento_backup # agendametno é feito conforme horário UTC +00 + inicio_manutencao = var.inicio_manutencao #Especifique(em minutos) o período em que o plano de backup será iniciado, caso não comece no horário especificado. + janela_manutencao = var.janela_manutencao #Defina(em minutos) o período durante o qual o backup deve ser concluído antes de retornar qualquer erro por timeout. + quantidade_dias_para_delecao = var.quantidade_dias_para_delecao + nome_selecao_alvo_tag = var.nome_selecao_alvo_tag iam_role_arn_backup = module.iam_policy_role.iam_role_arn_backup - selecao_recurso_tag_type = "STRINGEQUALS" - selecao_recurso_tag_key = "Backup" - selecao_recurso_tag_value = "true" + selecao_recurso_tag_type = var.selecao_recurso_tag_type + selecao_recurso_tag_key = var.selecao_recurso_tag_key + selecao_recurso_tag_value = var.selecao_recurso_tag_value depends_on = [module.iam_policy_role] } diff --git a/module.instancias.instance_id b/module.instancias.instance_id deleted file mode 100644 index e69de29..0000000 diff --git a/plano b/plano deleted file mode 100644 index 3c477a8df0a1abc582b7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(fH=;)&B#W+$QV* diff --git a/terraform.tfvars b/terraform.tfvars new file mode 100644 index 0000000..2ecd755 --- /dev/null +++ b/terraform.tfvars @@ -0,0 +1,93 @@ +#================================================================================ +# module instancias +#================================================================================ +numero_de_ec2 = 1 +tipo_instancia = "t3.micro" + +#tags = [ +# { +# Name = "Projeto_Final" +# Terraform = "Sim" +# Environment = "Dev" +# Backup = "true" +# } +#] + +#================================================================================ +# module iam_policy_role +#================================================================================ +#modulo_iam_policy_role = [ +# { +# #Criação da policy para EC2 +# policy_name = "Inicia_Desliga_EC2" +# policy_description = "Policy que permite o Lambda a desligar e ligar as instâncias EC2" +# +# #Criação da role para EC2 +# role_name = "Inicia_Desliga_EC2" +# role_description = "Função que permite o Lambda a desligar e ligar as instâncias EC2" +# +# #Criação de role para AWSBackup +# nome_role_backup = "role_backup" +# description_role_backup = "Função que permite o cofre gerenciar os backups" +# } +#] +#================================================================================ +#Criação da policy para EC2 +policy_name = "Inicia_Desliga_EC2" +policy_description = "Policy que permite o Lambda a desligar e ligar as instâncias EC2" + +#Criação da role para EC2 +role_name = "Inicia_Desliga_EC2" +role_description = "Função que permite o Lambda a desligar e ligar as instâncias EC2" + +#Criação de role para AWSBackup +nome_role_backup = "role_backup" +description_role_backup = "Função que permite o cofre gerenciar os backups" + +#================================================================================ +# module lambda_inicia && lambda_desliga +#================================================================================ +nome_funcao_inicia = "IniciaEC2" +nome_funcao_desliga = "DesligaEC2" +tamanho_memoria = 128 +timeout = 3 +armazenamento_temporario = 512 +rastreio_log = "Active" + +#================================================================================ +# module cloudwatch_inicia +#================================================================================ +cloudwatch_inicia_name = "Horario_de_inicio" +agendamento_cron = "cron(0 8 ? * MON-FRI *)" +estado = "ENABLED" +evento_cloudwatch = "default" +cloudwatch_inicio_description = "Agendamento para desligar as instancias" +statement_id = "permite_EventBridge_executar_lambda_inicia" +nome_alvo = "Funcao_Lambda_IniciaEC2" + +#================================================================================ +# module cloudwatch_desliga +#================================================================================ +desliga_cloudwatch_desliga_name = "Horario_de_desligamento" +desliga_agendamento_cron = "cron(0 22 ? * MON-FRI *)" +desliga_estado = "ENABLED" +desliga_evento_cloudwatch = "default" +desliga_cloudwatch_desliga_description = "Agendamento para desligar as instancias" +desliga_statement_id = "permite_EventBridge_executar_lambda_desliga" +desliga_nome_alvo = "Funcao_Lambda_DesligaEC2" + +#================================================================================ +# module Backup +#================================================================================ +nome_cofre = "cofre_backup_tag" +force_destruir = true +nome_plano_backup = "plano_backup_tag" +nome_regra = "backup_tag_diario" +agendamento_backup = "cron(0 15 * * ? *)" +inicio_manutencao = 60 +janela_manutencao = 180 +quantidade_dias_para_delecao = 7 +nome_selecao_alvo_tag = "selecao_alvo_tag" +selecao_recurso_tag_type = "STRINGEQUALS" +selecao_recurso_tag_key = "Backup" +selecao_recurso_tag_value = "true" \ No newline at end of file diff --git a/variables.tf b/variables.tf index bd10de0..c386d05 100644 --- a/variables.tf +++ b/variables.tf @@ -11,17 +11,15 @@ variable "tipo_instancia" { description = "Tipo de instancia EC2 a ser provisionada" } -variable "tags" { - type = set(object({ - Name = string - Terraform = string - Environment = string - Backup = string - })) - - description = "Etiqueta para as instancias EC2" -} - +#variable "tags" { +# description = "Etiqueta para as instancias EC2" +# type = set(object({ +# Name = string +# Terraform = string +# Environment = string +# Backup = string +# })) +#} #================================================================================ # module iam_policy_role @@ -30,11 +28,8 @@ variable "tags" { #variable "modulo_iam_policy_role" { # description = "Lista da variaveis que serão usadas no modulo iam_policy_role" # type = set(object({ -# policy_name = string -# policy_description = string -# role_name = string -# role_description = string -# nome_role_backup = string +# policy_description = string +# role_description = string # description_role_backup = string # })) #} @@ -45,8 +40,8 @@ variable "policy_name" { } variable "policy_description" { - type = string - default = "Default_Varibletf" + type = string + description = "description" } variable "role_name" { @@ -59,7 +54,6 @@ variable "role_description" { description = "Nome da role" } - #IAM Role para o plano de backup variable "nome_role_backup" { type = string @@ -70,3 +64,174 @@ variable "description_role_backup" { type = string description = "Descrição para função IAM que permite o cofre gerenciar os backups" } +#================================================================================ +# module lambda_inicia +#================================================================================ +variable "nome_funcao_inicia" { + type = string + description = "description" +} + +variable "nome_funcao_desliga" { + type = string + description = "description" +} + +variable "tamanho_memoria" { + type = number + description = "description" +} + +variable "timeout" { + type = number + description = "description" +} + +variable "armazenamento_temporario" { + type = number + description = "description" +} + +variable "rastreio_log" { + type = string + description = "description" +} + +#================================================================================ +# module cloudwatch_inicia +#================================================================================ +variable "cloudwatch_inicia_name" { + type = string + description = "Nome do CloudWatch Inicia" +} + +variable "agendamento_cron" { + type = string + description = "Agendamento em formato cron para iniciar a função" +} + +variable "estado" { + type = string + description = "Estado da instância ou recurso" +} + +variable "evento_cloudwatch" { + type = string + description = "Descrição do evento do CloudWatch" +} + +variable "cloudwatch_inicio_description" { + type = string + description = "Descrição para o início do CloudWatch" +} + +variable "statement_id" { + type = string + description = "ID do statement para a política" +} + +variable "nome_alvo" { + type = string + description = "Nome do alvo da função ou evento" +} + +#================================================================================ +# module cloudwatch_desliga +#================================================================================ +variable "desliga_cloudwatch_desliga_name" { + type = string + description = "Nome do CloudWatch para Desligar" +} + +variable "desliga_agendamento_cron" { + type = string + description = "Agendamento em formato cron para desligar a função" +} + +variable "desliga_estado" { + type = string + description = "Estado da instância ou recurso no processo de desligamento" +} + +variable "desliga_evento_cloudwatch" { + type = string + description = "Descrição do evento do CloudWatch para desligamento" +} + +variable "desliga_cloudwatch_desliga_description" { + type = string + description = "Descrição para o desligamento no CloudWatch" +} + +variable "desliga_statement_id" { + type = string + description = "ID do statement para a política de desligamento" +} + +variable "desliga_nome_alvo" { + type = string + description = "Nome do alvo da função ou evento de desligamento" +} + +#================================================================================ +# module Backup +#================================================================================ +variable "nome_cofre" { + type = string + description = "Nome do Cofre" +} + +variable "force_destruir" { + type = bool + description = "Flag para forçar a destruição" +} + +variable "nome_plano_backup" { + type = string + description = "Nome do plano de backup" +} + +variable "nome_regra" { + type = string + description = "Nome da regra" +} + +variable "agendamento_backup" { + type = string + description = "Agendamento do backup" +} + +variable "inicio_manutencao" { + type = number + description = "Data e hora de início da manutenção" +} + +variable "janela_manutencao" { + type = number + description = "Janela de tempo para a manutenção" +} + +variable "quantidade_dias_para_delecao" { + type = number + description = "Quantidade de dias para a deleção" +} + +variable "nome_selecao_alvo_tag" { + type = string + description = "Nome da tag do alvo de seleção" +} + +variable "selecao_recurso_tag_type" { + type = string + description = "Tipo da tag para seleção de recurso" +} + +variable "selecao_recurso_tag_key" { + type = string + description = "Chave da tag para seleção de recurso" +} + +variable "selecao_recurso_tag_value" { + type = string + description = "Valor da tag para seleção de recurso" +} From 8be3f3ac108e9e2b12efdd976506d6a057140155 Mon Sep 17 00:00:00 2001 From: Victor-Borges-Silva Date: Sat, 18 Jan 2025 00:20:07 -0300 Subject: [PATCH 13/13] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20do=20README=20com?= =?UTF-8?q?=20links=20para=20reposit=C3=B3rios=20auxiliares=20e=20adi?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20vari=C3=A1veis=20de=20entrada=20para=20con?= =?UTF-8?q?figura=C3=A7=C3=A3o=20de=20inst=C3=A2ncias=20EC2=20e=20pol?= =?UTF-8?q?=C3=ADticas=20IAM.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0f6b851..1c6d6f4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # terraform-aws-Victor-Borges-Silva_iac Repositório destinado ao projeto final. +# Repositório auxiliar para checagem de segurança +https://github.com/aquasecurity/tfsec + +# Repositório auxiliar para criação do README +https://github.com/terraform-docs/terraform-docs + ## Requirements @@ -16,13 +22,13 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [Backup](#module\_Backup) | git@github.com:Victor-Borges-Silva/Modulo-bakcup.git | v1.0.4 | -| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-desliga.git | v1.0.3 | -| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-cloudwatch-inicia.git | v1.0.3 | -| [iam\_policy\_role](#module\_iam\_policy\_role) | git@github.com:Victor-Borges-Silva/Modulo-iam.git | v1.0.5 | -| [instancias](#module\_instancias) | git@github.com:Victor-Borges-Silva/Modulo-instancias.git | v1.0.4 | -| [lambda\_desliga](#module\_lambda\_desliga) | git@github.com:Victor-Borges-Silva/Modulo-lambda-desliga.git | v1.0.4 | -| [lambda\_inicia](#module\_lambda\_inicia) | git@github.com:Victor-Borges-Silva/Modulo-lambda-inicia.git | v1.0.5 | +| [Backup](#module\_Backup) | ../Modulo-bakcup/ | n/a | +| [cloudwatch\_desliga](#module\_cloudwatch\_desliga) | ../Modulo-cloudwatch-desliga/ | n/a | +| [cloudwatch\_inicia](#module\_cloudwatch\_inicia) | ../Modulo-cloudwatch-inicia/ | n/a | +| [iam\_policy\_role](#module\_iam\_policy\_role) | ../Modulo-iam/ | n/a | +| [instancias](#module\_instancias) | ../Modulo-instancias/ | n/a | +| [lambda\_desliga](#module\_lambda\_desliga) | ../Modulo-lambda-desliga/ | n/a | +| [lambda\_inicia](#module\_lambda\_inicia) | ../Modulo-lambda-inicia/ | n/a | ## Resources @@ -30,7 +36,48 @@ No resources. ## Inputs -No inputs. +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [agendamento\_backup](#input\_agendamento\_backup) | Agendamento do backup | `string` | n/a | yes | +| [agendamento\_cron](#input\_agendamento\_cron) | Agendamento em formato cron para iniciar a função | `string` | n/a | yes | +| [armazenamento\_temporario](#input\_armazenamento\_temporario) | description | `number` | n/a | yes | +| [cloudwatch\_inicia\_name](#input\_cloudwatch\_inicia\_name) | Nome do CloudWatch Inicia | `string` | n/a | yes | +| [cloudwatch\_inicio\_description](#input\_cloudwatch\_inicio\_description) | Descrição para o início do CloudWatch | `string` | n/a | yes | +| [description\_role\_backup](#input\_description\_role\_backup) | Descrição para função IAM que permite o cofre gerenciar os backups | `string` | n/a | yes | +| [desliga\_agendamento\_cron](#input\_desliga\_agendamento\_cron) | Agendamento em formato cron para desligar a função | `string` | n/a | yes | +| [desliga\_cloudwatch\_desliga\_description](#input\_desliga\_cloudwatch\_desliga\_description) | Descrição para o desligamento no CloudWatch | `string` | n/a | yes | +| [desliga\_cloudwatch\_desliga\_name](#input\_desliga\_cloudwatch\_desliga\_name) | Nome do CloudWatch para Desligar | `string` | n/a | yes | +| [desliga\_estado](#input\_desliga\_estado) | Estado da instância ou recurso no processo de desligamento | `string` | n/a | yes | +| [desliga\_evento\_cloudwatch](#input\_desliga\_evento\_cloudwatch) | Descrição do evento do CloudWatch para desligamento | `string` | n/a | yes | +| [desliga\_nome\_alvo](#input\_desliga\_nome\_alvo) | Nome do alvo da função ou evento de desligamento | `string` | n/a | yes | +| [desliga\_statement\_id](#input\_desliga\_statement\_id) | ID do statement para a política de desligamento | `string` | n/a | yes | +| [estado](#input\_estado) | Estado da instância ou recurso | `string` | n/a | yes | +| [evento\_cloudwatch](#input\_evento\_cloudwatch) | Descrição do evento do CloudWatch | `string` | n/a | yes | +| [force\_destruir](#input\_force\_destruir) | Flag para forçar a destruição | `bool` | n/a | yes | +| [inicio\_manutencao](#input\_inicio\_manutencao) | Data e hora de início da manutenção | `number` | n/a | yes | +| [janela\_manutencao](#input\_janela\_manutencao) | Janela de tempo para a manutenção | `number` | n/a | yes | +| [nome\_alvo](#input\_nome\_alvo) | Nome do alvo da função ou evento | `string` | n/a | yes | +| [nome\_cofre](#input\_nome\_cofre) | Nome do Cofre | `string` | n/a | yes | +| [nome\_funcao\_desliga](#input\_nome\_funcao\_desliga) | description | `string` | n/a | yes | +| [nome\_funcao\_inicia](#input\_nome\_funcao\_inicia) | description | `string` | n/a | yes | +| [nome\_plano\_backup](#input\_nome\_plano\_backup) | Nome do plano de backup | `string` | n/a | yes | +| [nome\_regra](#input\_nome\_regra) | Nome da regra | `string` | n/a | yes | +| [nome\_role\_backup](#input\_nome\_role\_backup) | Nome da role/função para permitir o AWSBackup gerenciar os pontos de restauração | `string` | n/a | yes | +| [nome\_selecao\_alvo\_tag](#input\_nome\_selecao\_alvo\_tag) | Nome da tag do alvo de seleção | `string` | n/a | yes | +| [numero\_de\_ec2](#input\_numero\_de\_ec2) | Quantidade de instancias EC2 a ser provisionada | `number` | n/a | yes | +| [policy\_description](#input\_policy\_description) | description | `string` | n/a | yes | +| [policy\_name](#input\_policy\_name) | Nome da politica | `string` | n/a | yes | +| [quantidade\_dias\_para\_delecao](#input\_quantidade\_dias\_para\_delecao) | Quantidade de dias para a deleção | `number` | n/a | yes | +| [rastreio\_log](#input\_rastreio\_log) | description | `string` | n/a | yes | +| [role\_description](#input\_role\_description) | Nome da role | `string` | n/a | yes | +| [role\_name](#input\_role\_name) | Nome da Funcao | `string` | n/a | yes | +| [selecao\_recurso\_tag\_key](#input\_selecao\_recurso\_tag\_key) | Chave da tag para seleção de recurso | `string` | n/a | yes | +| [selecao\_recurso\_tag\_type](#input\_selecao\_recurso\_tag\_type) | Tipo da tag para seleção de recurso | `string` | n/a | yes | +| [selecao\_recurso\_tag\_value](#input\_selecao\_recurso\_tag\_value) | Valor da tag para seleção de recurso | `string` | n/a | yes | +| [statement\_id](#input\_statement\_id) | ID do statement para a política | `string` | n/a | yes | +| [tamanho\_memoria](#input\_tamanho\_memoria) | description | `number` | n/a | yes | +| [timeout](#input\_timeout) | description | `number` | n/a | yes | +| [tipo\_instancia](#input\_tipo\_instancia) | Tipo de instancia EC2 a ser provisionada | `string` | n/a | yes | ## Outputs