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

fix: add permission for the incidents table #738

Merged
merged 2 commits into from
Jan 30, 2025
Merged

Conversation

gcharest
Copy link
Contributor

Summary | Résumé

Add permissions for the bot

@gcharest gcharest requested a review from a team January 30, 2025 15:26
@gcharest gcharest self-assigned this Jan 30, 2025
Copy link

github-actions bot commented Jan 30, 2025

GitHub Action status on 8893de3 generated by comment-failure-action

Terraform plan

job url
null https://github.com/cds-snc/sre-bot/actions/runs/13055521627/job/36425485661

Build containers CI

No jobs failed 👍

Copy link

Production: terraform

✅   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 aws_iam_policy.sre-bot_secrets_manager
Show plan
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_iam_policy.sre-bot_secrets_manager will be updated in-place
  ~ resource "aws_iam_policy" "sre-bot_secrets_manager" {
        id               = "arn:aws:iam::283582579564:policy/sre-botSecretsManagerKeyRetrieval"
        name             = "sre-botSecretsManagerKeyRetrieval"
      ~ policy           = jsonencode(
          ~ {
              ~ Statement = [
                    # (1 unchanged element hidden)
                    {
                        Action   = "ssm:GetParameters"
                        Effect   = "Allow"
                        Resource = [
                            "arn:aws:ssm:ca-central-1:283582579564:parameter/sre-bot-config",
                            "arn:aws:ssm:ca-central-1:283582579564:parameter/google_oauth_pickle_string",
                            "arn:aws:ssm:ca-central-1:283582579564:parameter/gcp_sre_service_account_key",
                        ]
                    },
                  ~ {
                      ~ Resource = [
                            "arn:aws:dynamodb:ca-central-1:283582579564:table/webhooks",
                          + "arn:aws:dynamodb:ca-central-1:283582579564:table/sre_bot_data",
                          + "arn:aws:dynamodb:ca-central-1:283582579564:table/incidents",
                            "arn:aws:dynamodb:ca-central-1:283582579564:table/aws_access_requests",
                        ]
                        # (2 unchanged elements hidden)
                    },
                ]
                # (1 unchanged element hidden)
            }
        )
        tags             = {}
        # (5 unchanged attributes hidden)
    }

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

Warning: Argument is deprecated

  with module.sre_bot_bucket.aws_s3_bucket.this,
  on .terraform/modules/sre_bot_bucket/S3/main.tf line 8, in resource "aws_s3_bucket" "this":
   8: resource "aws_s3_bucket" "this" {

Use the aws_s3_bucket_versioning resource instead

(and 6 more similar warnings elsewhere)

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

Saved the plan to: plan.tfplan

To perform exactly these actions, run the following command to apply:
    terraform apply "plan.tfplan"
Show Conftest results
WARN - plan.json - main - Cloudwatch log metric pattern is invalid: ["aws_cloudwatch_log_metric_filter.sre_bot_error"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.sre_bot"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sre-bot_group"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sre_bot_dns"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.sre_bot_waf_log_group"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.sre_bot_error"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.sre_bot_high_cpu"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.sre_bot_high_memory"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.sre_bot_warning"]
WARN - plan.json - main - Missing Common Tags: ["aws_dynamodb_table.aws_access_requests_table"]
WARN - plan.json - main - Missing Common Tags: ["aws_dynamodb_table.incidents_table"]
WARN - plan.json - main - Missing Common Tags: ["aws_dynamodb_table.sre_bot_data"]
WARN - plan.json - main - Missing Common Tags: ["aws_dynamodb_table.webhooks_table"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.sre-bot"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_cluster.sre-bot"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_service.main"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecs_task_definition.sre-bot"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.geodb_refresh_policy"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.sre-bot_secrets_manager"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.sre_bot_bucket"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.sre-bot"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.sre_bot_sqs_access_role"]
WARN - plan.json - main - Missing Common Tags:...

@gcharest gcharest merged commit 43eadee into main Jan 30, 2025
6 checks passed
@gcharest gcharest deleted the fix/dynamodb_permissions branch January 30, 2025 15:32
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.

2 participants