Skip to content

Fix deploy_dev failure by granting missing Terraform deploy-role permissions - #86

Merged
Panacota96 merged 2 commits into
mainfrom
copilot/fix-deploy-dev-job-failure
Jun 9, 2026
Merged

Panacota96 merged 2 commits into
mainfrom
copilot/fix-deploy-dev-job-failure

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • deploy_dev failed during terraform apply because the GitHub Actions deploy role lacked permissions required by newly managed Terraform resources (aws_default_vpc in ElastiCache networking and aws_scheduler_schedule_group for campaigns).
  • IAM policy updates (deploy role):
    • EC2 networking access: added VPC/subnet/security-group read/manage actions needed by elasticache.tf default VPC + SG resources.
    • ElastiCache management: added replication-group and subnet-group CRUD/tagging actions.
    • EventBridge Scheduler management: added schedule-group/schedule CRUD + tagging actions.
  • Example of added capability (Terraform IAM policy):
    {
      Sid    = "EventBridgeScheduler"
      Effect = "Allow"
      Action = [
        "scheduler:CreateScheduleGroup",
        "scheduler:CreateSchedule",
        "scheduler:UpdateSchedule"
      ]
      Resource = "*"
    }

Validation

  • make lint
  • make test
  • make docs-check
  • terraform -chdir=phishing-platform-infra/terraform validate

Linked Work

  • Issue:
  • Milestone:

Deployment Notes

  • New environment variables: None.
  • Infra impact: Expands aws_iam_role_policy.github_actions_deploy to cover EC2/ElastiCache/Scheduler actions required by current Terraform resources.
  • Docs updated: No.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job deploy_dev Fix deploy_dev failure by granting missing Terraform deploy-role permissions Jun 9, 2026
Copilot AI requested a review from Panacota96 June 9, 2026 18:18
@Panacota96
Panacota96 marked this pull request as ready for review June 9, 2026 18:26
Copilot AI review requested due to automatic review settings June 9, 2026 18:26
@Panacota96
Panacota96 merged commit 12bd0ec into main Jun 9, 2026
16 checks passed
@Panacota96
Panacota96 deleted the copilot/fix-deploy-dev-job-failure branch June 9, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR expands the IAM permissions granted to the GitHub Actions deploy role to support provisioning and managing Redis (ElastiCache), related EC2 networking resources, and EventBridge Scheduler resources from CI/CD.

Changes:

  • Add EC2 permissions for VPC/subnet/security-group discovery and security group lifecycle management.
  • Add ElastiCache Redis (replication group + subnet group) management permissions.
  • Add EventBridge Scheduler (schedule groups + schedules) management permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +245 to +263
{
Sid = "EC2ForRedisNetworking"
Effect = "Allow"
Action = [
"ec2:DescribeVpcs",
"ec2:CreateDefaultVpc",
"ec2:DescribeSubnets",
"ec2:DescribeSecurityGroups",
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress",
"ec2:AuthorizeSecurityGroupEgress",
"ec2:RevokeSecurityGroupEgress",
"ec2:CreateTags",
"ec2:DeleteTags",
]
Resource = "*"
},
Comment on lines +249 to +251
"ec2:DescribeVpcs",
"ec2:CreateDefaultVpc",
"ec2:DescribeSubnets",
Comment on lines +264 to +300
{
Sid = "ElastiCacheRedis"
Effect = "Allow"
Action = [
"elasticache:CreateReplicationGroup",
"elasticache:DeleteReplicationGroup",
"elasticache:ModifyReplicationGroup",
"elasticache:DescribeReplicationGroups",
"elasticache:CreateCacheSubnetGroup",
"elasticache:DeleteCacheSubnetGroup",
"elasticache:DescribeCacheSubnetGroups",
"elasticache:ModifyCacheSubnetGroup",
"elasticache:AddTagsToResource",
"elasticache:RemoveTagsFromResource",
"elasticache:ListTagsForResource",
]
Resource = "*"
},
{
Sid = "EventBridgeScheduler"
Effect = "Allow"
Action = [
"scheduler:CreateScheduleGroup",
"scheduler:DeleteScheduleGroup",
"scheduler:GetScheduleGroup",
"scheduler:ListScheduleGroups",
"scheduler:CreateSchedule",
"scheduler:DeleteSchedule",
"scheduler:GetSchedule",
"scheduler:UpdateSchedule",
"scheduler:ListSchedules",
"scheduler:TagResource",
"scheduler:UntagResource",
"scheduler:ListTagsForResource",
]
Resource = "*"
},
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.

3 participants