Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive audit logs #452

Closed
wants to merge 12 commits into from
Closed

Archive audit logs #452

wants to merge 12 commits into from

Conversation

falila
Copy link
Contributor

@falila falila commented Aug 2, 2023

Summary | Résumé

WP PR on storing audit logs when TTL expires. 
closed #337

Test instructions | Instructions pour tester la modification

Todo

@falila falila changed the title Archive audit logs lambda set up Archive audit logs Aug 2, 2023
@falila falila self-assigned this Aug 23, 2023
@github-actions
Copy link

Staging: app

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

Show Validate results
Warning: Argument is deprecated

  with aws_s3_bucket.reliability_file_storage,
  on s3.tf line 4, in resource "aws_s3_bucket" "reliability_file_storage":
   4: resource "aws_s3_bucket" "reliability_file_storage" {

Use the aws_s3_bucket_lifecycle_configuration resource instead

(and 11 more similar warnings elsewhere)

Error: Reference to undeclared resource

  on lambda.tf line 674, in resource "aws_lambda_event_source_mapping" "archive_audit_logs":
 674:   event_source_arn                   = aws_dynamodb_table.audit_logs.stream_arn

A managed resource "aws_dynamodb_table" "audit_logs" has not been declared in
the root module.
time=2023-10-24T14:09:09Z level=error msg=Terraform invocation failed in /home/runner/work/forms-terraform/forms-terraform/env/cloud/app/.terragrunt-cache/K54TG7zAX8DTTyqwBYHSG8Hho6I/-syjFrdAaB-6kNXhMmF1nXBOp7o/app prefix=[/home/runner/work/forms-terraform/forms-terraform/env/cloud/app] 
time=2023-10-24T14:09:09Z level=error msg=1 error occurred:
	* [/home/runner/work/forms-terraform/forms-terraform/env/cloud/app/.terragrunt-cache/K54TG7zAX8DTTyqwBYHSG8Hho6I/-syjFrdAaB-6kNXhMmF1nXBOp7o/app] exit status 1


Show plan
Releasing state lock. This may take a few moments...

Warning: Argument is deprecated

  with aws_s3_bucket.reliability_file_storage,
  on s3.tf line 4, in resource "aws_s3_bucket" "reliability_file_storage":
   4: resource "aws_s3_bucket" "reliability_file_storage" {

Use the aws_s3_bucket_server_side_encryption_configuration resource instead

(and 11 more similar warnings elsewhere)

Error: Reference to undeclared resource

  on lambda.tf line 674, in resource "aws_lambda_event_source_mapping" "archive_audit_logs":
 674:   event_source_arn                   = aws_dynamodb_table.audit_logs.stream_arn

A managed resource "aws_dynamodb_table" "audit_logs" has not been declared in
the root module.
time=2023-10-24T14:10:27Z level=error msg=Terraform invocation failed in /home/runner/work/forms-terraform/forms-terraform/env/cloud/app/.terragrunt-cache/K54TG7zAX8DTTyqwBYHSG8Hho6I/-syjFrdAaB-6kNXhMmF1nXBOp7o/app prefix=[/home/runner/work/forms-terraform/forms-terraform/env/cloud/app] 
time=2023-10-24T14:10:27Z level=error msg=1 error occurred:
	* [/home/runner/work/forms-terraform/forms-terraform/env/cloud/app/.terragrunt-cache/K54TG7zAX8DTTyqwBYHSG8Hho6I/-syjFrdAaB-6kNXhMmF1nXBOp7o/app] exit status 1


Copy link

⚠ Terrform update available

Terraform: 1.6.2 (using 1.4.2)
Terragrunt: 0.53.0 (using 0.46.3)

Copy link

Staging: sqs

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

🧹   Format: run terraform fmt to fix the following:

outputs.tf
Plan: 1 to add, 0 to change, 0 to destroy
Show summary
CHANGE NAME
add aws_sqs_queue.audit_log_archiver_failure_queue
Show plan
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # aws_sqs_queue.audit_log_archiver_failure_queue will be created
  + resource "aws_sqs_queue" "audit_log_archiver_failure_queue" {
      + arn                               = (known after apply)
      + content_based_deduplication       = false
      + deduplication_scope               = (known after apply)
      + delay_seconds                     = 60
      + fifo_queue                        = false
      + fifo_throughput_limit             = (known after apply)
      + id                                = (known after apply)
      + kms_data_key_reuse_period_seconds = 300
      + kms_master_key_id                 = "alias/aws/sqs"
      + max_message_size                  = 262144
      + message_retention_seconds         = 1209600
      + name                              = "audit_log_archiver_failure_queue"
      + name_prefix                       = (known after apply)
      + policy                            = (known after apply)
      + receive_wait_time_seconds         = 5
      + sqs_managed_sse_enabled           = (known after apply)
      + tags                              = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + tags_all                          = {
          + "CostCentre" = "forms-platform-staging"
          + "Terraform"  = "true"
        }
      + url                               = (known after apply)
      + visibility_timeout_seconds        = 30
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Changes to Outputs:
  + sqs_audit_log_archiver_failure_queue_arn = (known after apply)

─────────────────────────────────────────────────────────────────────────────

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest results
18 tests, 18 passed, 0 warnings, 0 failures, 0 exceptions

@craigzour
Copy link
Contributor

Closing this in favor of #582

@craigzour craigzour closed this Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Archive Audit Logs
4 participants