- Newest
- Most votes
- Most comments
Hello.
By default, it is automatically created when configuring AWS Config.
If it has not been created automatically, please try running the following AWS CLI command.
https://docs.aws.amazon.com/config/latest/developerguide/using-service-linked-roles.html
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create-service-linked-role.html#create-service-linked-role
aws iam create-service-linked-role \
--aws-service-name config.amazonaws.com
If you verify the AWS Config settings using the AWS CLI and confirm that the service-linked role is configured, there is no issue.
No, you do not need to manually create the AWSServiceRoleForConfig service-linked role before AWS Config can use it. When you create or update AWS Config to use the service-linked role, AWS Config automatically creates the role for you if it doesn't already exist.
Based on what you've described, it sounds like your update has actually worked correctly. The fact that the AWS CLI shows AWS Config is using the AWSServiceRoleForConfig role is the accurate indicator of your configuration's current state. The console display issue you're experiencing is likely just a UI lag or caching issue, which is not uncommon when switching from a custom role to a service-linked role.
When you use the AWS CLI or CloudFormation to configure AWS Config, the service automatically creates the AWSServiceRoleForConfig role if it's not already present in the account. Since your CloudFormation StackSet deployment succeeded and the CLI confirms the role is in use, your configuration change has been applied successfully.
To verify everything is working properly, you can:
- Check that the AWSServiceRoleForConfig role exists in IAM in each account
- Confirm AWS Config is functioning normally (recording resources, delivering to S3, etc.)
- Wait a bit and refresh the console to see if the display updates
There's no need to pre-create the role and redeploy. Your current deployment should be functioning correctly with the service-linked role, despite what the console may be showing.
Sources
Permissions for the IAM Role Assigned to AWS Config - AWS Config
Using Service-Linked Roles for AWS Config - AWS Config
I updated the Cloudformation stackset template hours ago and I can't stills see AWSServiceRoleForConfig role in the IAM roles list. In the AWS Config page also, there's no IAM role displaying.
Relevant content
asked 3 years ago
asked 2 years ago

Hi, thanks for your response. I guess there's no guarantee that the role is created when AWS Config is updated from CFSS?
It is possible that it is created automatically only when configured via the Management Console. I have also set up AWS Config using IaC in the past, and I recall creating the IAM role myself in that instance.
I see. I guess the best route is to create the role first. Thank you for your answer!