What permissions are required to use the atlassian/aws-elasticbeanstalk-deploy:1.5.0 pipe with an OIDC deployment? I want to ensure that I haven't given to many permissions to the OIDC role.
Hi @Matthew Musgrove,
For the atlassian/aws-elasticbeanstalk-deploy:1.5.0 pipe with OIDC, you'll need these minimum IAM permissions:
atlassian/aws-elasticbeanstalk-deploy:1.5.0
Essential Permissions:
<span>{ </span><span> "Version": "2012-10-17", </span><span> "Statement": [ </span><span> { </span><span> "Effect": "Allow", </span><span> "Action": [ </span><span> "elasticbeanstalk:CreateApplicationVersion", </span><span> "elasticbeanstalk:DescribeApplicationVersions", </span><span> "elasticbeanstalk:DescribeApplications", </span><span> "elasticbeanstalk:DescribeEnvironments", </span><span> "elasticbeanstalk:UpdateEnvironment", </span><span> "s3:GetObject", </span><span> "s3:PutObject", </span><span> "s3:DeleteObject" </span><span> ], </span><span> "Resource": "*" </span><span> } </span><span> ] </span><span>}</span>
Additional permissions you might need:
elasticbeanstalk:DescribeEvents
elasticbeanstalk:DescribeEnvironmentHealth
Best Practice:
arn:aws:s3:::your-eb-bucket/*
OIDC Trust Policy: Make sure your OIDC role has the correct trust relationship with your Bitbucket repository.
The exact permissions can vary based on your specific EB configuration and deployment needs.
Need help with the complete IAM policy setup? Feel free to DM me!
That's what I thought as well but in practice I'm getting permission errors for things from cloudformation, autoscaling, and ec2.
I removed all of the elasticbeanstalk, cloudformation, autoscaling, ec2, etc permissions and adding theĀ AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy policy instead.
Good catch! You're absolutely right - EB deployments often trigger CloudFormation, Auto Scaling, and EC2 operations behind the scenes. The AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy is a solid approach.
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy
Alternative Managed Policies to Consider:
AWSElasticBeanstalkWebTier
AWSElasticBeanstalkWorkerTier
AWSElasticBeanstalkMulticontainerDocker
If You Want Granular Control: You'll likely need these additional permissions:
<span>{ </span><span> "Effect": "Allow", </span><span> "Action": [ </span><span> "cloudformation:DescribeStacks", </span><span> "cloudformation:DescribeStackEvents", </span><span> "cloudformation:DescribeStackResources", </span><span> "autoscaling:DescribeAutoScalingGroups", </span><span> "autoscaling:DescribeLaunchConfigurations", </span><span> "ec2:DescribeInstances", </span><span> "ec2:DescribeImages", </span><span> "ec2:DescribeSecurityGroups" </span><span> ], </span><span> "Resource": "*" </span><span>}</span>
Pro Tip: Enable CloudTrail temporarily during deployment to see exactly which API calls are being made - helps identify the minimal permission set.
The managed policy route is often the safest bet for EB since AWS keeps it updated with the required permissions as the service evolves.
It looks like you're new here. Sign in or register to get started.