

# Service-linked roles for Budgets actions

Budgets actions use AWS Identity and Access Management (IAM) [service-linked roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role). A service-linked role is a unique type of IAM role that is linked directly to Budgets. Service-linked roles are predefined by Budgets and include all the permissions that the service requires to call other AWS services on your behalf.

Budgets defines the permissions of its service-linked roles, and unless defined otherwise, only Budgets 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) 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.

## Service-linked role permissions for Budgets actions
<a name="budgets-actions-SLR-permissions"></a>

Budgets uses the service-linked role named `AWSServiceRoleForBudgetsActionExecution`, which lets Budgets run budget actions that limit spend on your behalf. Budgets uses this role to block Amazon Bedrock usage when an AI budget reaches its limit. For more information, see [Blocking Amazon Bedrock usage with an AI budget](budgets-action-block-bedrock.md).

The `AWSServiceRoleForBudgetsActionExecution` service-linked role trusts the `actions.budgets.amazonaws.com` service to assume the role.

The role permissions policy, `AWSBudgetsActionExecutionPolicy`, allows Budgets to complete the following actions in your organization in AWS Organizations:
+ Create service control policies (SCPs), only when the SCP has the tag `budgets:managed` with the value `true`.
+ Describe, update, tag, delete, attach, and detach SCPs, and list their targets, only for SCPs that have the `budgets:managed` tag.
+ Attach these SCPs to, and detach them from, the organization root, organizational units, and accounts.
+ List the organization's roots, accounts, and policies, and the policies attached to a target.

The role can't change, attach, detach, or delete SCPs that don't have the `budgets:managed` tag, such as SCPs that you create yourself.

To view the full permissions details of the service-linked role `AWSBudgetsActionExecutionPolicy`, see [AWSBudgetsActionExecutionPolicy](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSBudgetsActionExecutionPolicy.html) in the *AWS Managed Policy Reference Guide*.

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](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#service-linked-role-permissions) in the *IAM User Guide*.

## Creating the Budgets actions service-linked role
<a name="budgets-actions-create-SLR"></a>

You don't need to manually create the service-linked role. When you turn on **Block Bedrock requests** for an AI cost budget in the management account, select **Allow AWS Budgets to block requests with Service Control Policies (SCPs)**. Budgets creates the `AWSServiceRoleForBudgetsActionExecution` service-linked role when you create the budget.

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.

## Editing the Budgets actions service-linked role
<a name="budgets-actions-edit-SLR"></a>

You can't edit the name or permissions of the `AWSServiceRoleForBudgetsActionExecution` service-linked 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](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#edit-service-linked-role) in the IAM User Guide.

**To allow an IAM entity to edit the description of the `AWSServiceRoleForBudgetsActionExecution` service-linked role**

Add the following statement to the permissions policy for the IAM entity that needs to edit the description of a service-linked role.

```
{
    "Effect": "Allow",
    "Action": [
        "iam:UpdateRoleDescription"
    ],
    "Resource": "arn:aws:iam::*:role/aws-service-role/actions.budgets.amazonaws.com/AWSServiceRoleForBudgetsActionExecution",
    "Condition": {"StringLike": {"iam:AWSServiceName": "actions.budgets.amazonaws.com"}}
}
```

## Deleting the Budgets actions service-linked role
<a name="budgets-actions-delete-SLR"></a>

If you no longer need to block Amazon Bedrock usage with AI budgets, we recommend that you delete the `AWSServiceRoleForBudgetsActionExecution` service-linked role. That way, you don't have an unused entity that isn't actively monitored or maintained. However, before you delete the role, you must turn off blocking for, or delete, every AI budget that blocks Amazon Bedrock. This lets Budgets detach and delete the SCPs that it created.

If you delete the role first, Budgets can't block Amazon Bedrock usage or remove its SCPs. You can then detach and delete the SCPs that have the `budgets:managed` tag yourself in AWS Organizations.

**To manually delete the service-linked role using IAM**

Use the IAM console, the AWS Command Line Interface (AWS CLI), or the AWS API to delete the `AWSServiceRoleForBudgetsActionExecution` service-linked role. For more information, see [Deleting a Service-Linked Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#delete-service-linked-role) in the *IAM User Guide*.

## Supported Regions for Budgets actions service-linked roles
<a name="budgets-actions-SLR-regions"></a>

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