I had this same problem, to fix it I just created a new role, instead of using the default role option.
template.yml:
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template to create a service-linked role for Elastic Beanstalk
Resources:
ElasticBeanstalkServiceRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName: 'cicd-role'
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: 'Allow'
Action: 'sts:AssumeRole'
Principal:
Service: 'elasticbeanstalk.amazonaws.com'
Description: 'Allows Elastic Beanstalk to create and manage AWS resources on your behalf.'
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AdministratorAccess-AWSElasticBeanstalk
- arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkEnhancedHealth
- arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkService
Outputs:
RoleArn:
Description: 'ARN of the Elastic Beanstalk service role'
Value: !GetAtt [ElasticBeanstalkServiceRole, Arn]
Or in the aws Management Console:
- Roles > Create
- Trusted entity type > AWS service
- Use case > Elastic Beanstalk
- (Everything else as default)
- Create
- List item
lastly:
eb create $EB_CONFIG-env --platform "$EBS_PLATFORM" --service-role $EB_SERVICE_ROLE