Fix deploy_dev failure by granting missing Terraform deploy-role permissions - #86
Merged
Merged
Conversation
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
Panacota96
marked this pull request as ready for review
June 9, 2026 18:26
There was a problem hiding this comment.
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 = "*" | ||
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deploy_devfailed duringterraform applybecause the GitHub Actions deploy role lacked permissions required by newly managed Terraform resources (aws_default_vpcin ElastiCache networking andaws_scheduler_schedule_groupfor campaigns).elasticache.tfdefault VPC + SG resources.{ Sid = "EventBridgeScheduler" Effect = "Allow" Action = [ "scheduler:CreateScheduleGroup", "scheduler:CreateSchedule", "scheduler:UpdateSchedule" ] Resource = "*" }Validation
make lintmake testmake docs-checkterraform -chdir=phishing-platform-infra/terraform validateLinked Work
Deployment Notes
aws_iam_role_policy.github_actions_deployto cover EC2/ElastiCache/Scheduler actions required by current Terraform resources.