cds-snc / notification-terraform

Terraform for notification.canada.ca
MIT License
13 stars 6 forks source link

Converting dev destroy to individual jobs #1468

Closed ben851 closed 2 weeks ago

ben851 commented 1 month ago

Summary | Résumé

Converting the dev destroy workflow to individual jobs so we can re-run as needed.

Related Issues | Cartes liées

Test instructions | Instructions pour tester la modification

Oh so many checks to make sure I'm destroying dev

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

github-actions[bot] commented 2 weeks ago

Staging: dns

✅   Terraform Init: success ✅   Terraform Validate: success ✅   Terraform Format: success ✅   Terraform Plan: success ✅   Conftest: success

Plan: 0 to add, 2 to change, 0 to destroy
Show summary | CHANGE | NAME | |--------|-----------------------------------------------------| | update | `aws_secretsmanager_secret.internal_dns_fqdn` | | | `aws_secretsmanager_secret.internal_dns_key_base64` |
Show plan ```terraform Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # aws_secretsmanager_secret.internal_dns_fqdn will be updated in-place ~ resource "aws_secretsmanager_secret" "internal_dns_fqdn" { id = "arn:aws:secretsmanager:ca-central-1:239043911459:secret:INTERNAL_DNS_FQDN-pUqTjc" name = "INTERNAL_DNS_FQDN" ~ recovery_window_in_days = 30 -> 0 tags = {} # (3 unchanged attributes hidden) } # aws_secretsmanager_secret.internal_dns_key_base64 will be updated in-place ~ resource "aws_secretsmanager_secret" "internal_dns_key_base64" { id = "arn:aws:secretsmanager:ca-central-1:239043911459:secret:INTERNAL_DNS_KEY_BASE64-314TUu" name = "INTERNAL_DNS_KEY_BASE64" ~ recovery_window_in_days = 30 -> 0 tags = {} # (3 unchanged attributes hidden) } Plan: 0 to add, 2 to change, 0 to destroy. ───────────────────────────────────────────────────────────────────────────── Saved the plan to: plan.tfplan To perform exactly these actions, run the following command to apply: terraform apply "plan.tfplan" ```
Show Conftest results ```sh WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.internal_dns"] WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.dev_dns_manager[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.production_dns_manager[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.sandbox_dns_manager[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.scratch_dns_manager[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.staging_dns_manager[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_route53_zone.internal_dns"] WARN - plan.json - main - Missing Common Tags: ["aws_route53_zone.notification-sandbox[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_cert_base64"] WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_fqdn"] WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.internal_dns_key_base64"] 30 tests, 19 passed, 11 warnings, 0 failures, 0 exceptions ```
github-actions[bot] commented 2 weeks ago

Staging: eks

✅   Terraform Init: success ✅   Terraform Validate: success ✅   Terraform Format: success ✅   Terraform Plan: success ✅   Conftest: success

Plan: 0 to add, 1 to change, 0 to destroy
Show summary | CHANGE | NAME | |--------|--------------------------------------------------------------------| | update | `module.sentinel_forwarder.aws_lambda_function.sentinel_forwarder` |
Show plan ```terraform Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # module.sentinel_forwarder.aws_lambda_function.sentinel_forwarder will be updated in-place ~ resource "aws_lambda_function" "sentinel_forwarder" { id = "sentinel-cloud-watch-forwarder" ~ layers = [ - "arn:aws:lambda:ca-central-1:283582579564:layer:aws-sentinel-connector-layer:132", + "arn:aws:lambda:ca-central-1:283582579564:layer:aws-sentinel-connector-layer:150", ] tags = { "CostCentre" = "notification-canada-ca-staging" } # (23 unchanged attributes hidden) # (4 unchanged blocks hidden) } Plan: 0 to add, 1 to change, 0 to destroy. ───────────────────────────────────────────────────────────────────────────── Saved the plan to: plan.tfplan To perform exactly these actions, run the following command to apply: terraform apply "plan.tfplan" ```
Show Conftest results ```sh WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.client_vpn"] WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca"] WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.notification-canada-ca-alt[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_alb.notification-canada-ca"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener.internal_alb_tls"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener.notification-canada-ca"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.internal_nginx_http"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-admin"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-api"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-document-api"] WARN - plan.json - main - Missing Common Tags: ["aws_alb_target_group.notification-canada-ca-documentation"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-application-logs[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-cluster-logs[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-eks-prometheus-logs[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-evicted-pods[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-pods-high-cpu-warning[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-pods-high-memory-warning[0]"] WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.admin-replicas-unavailable[0]"] WARN - plan.json - main - Missing Common Tags:... ```