Using Service-Linked Roles for AWS BugBust - AWS BugBust

Using Service-Linked Roles for AWS BugBust

AWS BugBust uses AWS Identity and Access Management (IAM) service-linked roles. A service-linked role is a unique type of IAM role that is linked directly to AWS BugBust. Service-linked roles are predefined by AWS BugBust and include all the permissions that the service requires to call other AWS services on your behalf.

A service-linked role makes setting up AWS BugBust easier because you don’t have to manually add the necessary permissions. AWS BugBust defines the permissions of its service-linked roles, and unless defined otherwise, only AWS BugBust can assume its roles. The defined permissions include the trust policy and the permissions policy, and that permissions policy cannot be attached to any other IAM entity.

For information about other services that support service-linked roles, see AWS Services That Work with IAM and look for the services that have Yes in the Service-Linked Role column. Choose a Yes with a link to view the service-linked role documentation for that service.

The AWSBugBustServiceRolePolicy policy contains the following statement.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "codeguru-reviewer:ListRecommendations", "codeguru-reviewer:UntagResource", "codeguru-reviewer:DescribeCodeReview" ], "Resource": "*", "Condition": { "StringLike": { "aws:ResourceTag/bugbust": "enabled" } } } ] }

Service-Linked Role Permissions for AWS BugBust

AWS BugBust uses the service-linked role named AWSServiceRoleForBugBust – A service-linked role required for AWS Bug Bust to access resources on your behalf.

The AWSServiceRoleForBugBust service-linked role trusts the following service to assume the role, BugBust.

The role's permissions policy allows AWS BugBust to complete the following actions.

  • Action: Action:"codeguru-reviewer:ListRecommendations" on all AWS resources

  • Action: Action:"codeguru-reviewer:UntagResource" on all AWS resources

  • Action: Action:"codeguru-reviewer:DescribeCodeReview" on all AWS resources

For this service-linked role, all AWS resources refers to the "Resource": "*" element in the policy. This means that AWS BugBust service-linked role has access to all available resources in CodeGuru Reviewer.

You must configure permissions to allow an IAM entity (such as a user, group, or role) to create, edit, or delete a service-linked role. For more information, see Service-Linked Role Permissions in the IAM User Guide.

Creating a Service-Linked Role for AWS BugBust

You don't need to manually create a service-linked role. When you call the CreateEvent API, AWS BugBust creates the AWSServiceRoleForBugBust. The CreateEvent API is called when you create a new AWS BugBust event.

If you delete this service-linked role, and then need to create it again, you can use the same process to recreate the role in your account. When you call the CreateEvent API, AWS BugBust creates the AWSServiceRoleForBugBust, AWS BugBust creates the service-linked role for you again.

You can also use the IAM console to create a service-linked role with the AWSServiceRoleForBugBust use case. In the AWS CLI or the AWS API, create a service-linked role with the BugBust service name. For more information, see Creating a Service-Linked Role in the IAM User Guide. If you delete this service-linked role, you can use this same process to create the role again.

Editing a Service-Linked Role for AWS BugBust

AWS BugBust does not allow you to edit the AWSServiceRoleForBugBust service-linked role. After you create a service-linked role, you cannot change the name of the role because various entities might reference the role. However, you can edit the description of the role using IAM. For more information, see Editing a Service-Linked Role in the IAM User Guide.

Deleting a Service-Linked Role for AWS BugBust

To remove the AWSServiceRoleForBugBust you need to use the IAM console to manually delete the service-linked role. To do this, you must first clean up the AWS BugBust resources for your service-linked role and then you can manually delete it.

To clean up the resources required to delete AWSServiceRoleForBugBust, all AWS BugBust events in your account must be in the Closed state.

To clean up resources for AWS BugBust events that only have bugs (work items) included:

For these events, the status automatically changes to Closed based on the End time you chose during event setup. Once your event status has changed to Closed, you can safely delete the service linked role.

To clean up the resources for AWS BugBust events that have both bugs and profiling groups included:
  • If all checked-in profiling groups have been evaluated by an AWS BugBust administrator when an event ends, the status automatically changes from Active to Closed. Once your events status has changed to Closed, you can safely delete the service-linked role.

  • If all checked in profiling groups have not been evaluated by a AWS BugBust administrator when the event ends, the status automatically changes to Finalizing points. To evaluate the remaining profiling groups, choose Evaluate profiling groups on the Profiling groups event page. This changes the status of your event from Finalizing points to Closed. Once your event status has changed to Closed, you can safely delete the service-linked role.

AWS BugBust resources used by the AWSServiceRoleForBugBust can be cleaned up when you have no active AWS BugBust events in your AWS account. To learn more about the status of your AWS BugBust events, see View the state of an AWS BugBust event.

Note

If the AWS BugBust service is using the role when you try to delete the resources, then the deletion might fail. If that happens, wait for a few minutes and try the operation again.

To manually delete the service-linked role using IAM

Use the IAM console to delete the AWSServiceRoleForBugBust service-linked role. For more information, see Deleting a Service-Linked Role in the IAM User Guide.

Supported Regions for AWS BugBust Service-Linked Roles

AWS BugBust supports using service-linked roles in all of the Regions where the service is available. For more information, see AWS Regions and Endpoints.