budgets_actions
Creates, updates, deletes or gets a budgets_action resource or lists budgets_actions in a region
Overview
| Name | budgets_actions |
| Type | Resource |
| Description | An example resource schema demonstrating some basic constructs and validation rules. |
| Id | awscc.budgets.budgets_actions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
action_id | string | |
budget_name | string | |
notification_type | string | |
action_type | string | |
action_threshold | object | |
execution_role_arn | string | |
approval_model | string | |
subscribers | array | |
definition | object | |
resource_tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
action_id | string | |
budget_name | string | |
region | string | AWS region. |
For more information, see AWS::Budgets::BudgetsAction.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | budgets_actions | INSERT | BudgetName, NotificationType, ActionType, ActionThreshold, ExecutionRoleArn, Definition, Subscribers, region |
delete_resource | budgets_actions | DELETE | Identifier, region |
update_resource | budgets_actions | UPDATE | Identifier, PatchDocument, region |
list_resources | budgets_actions_list_only | SELECT | region |
get_resource | budgets_actions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual budgets_action.
SELECT
region,
action_id,
budget_name,
notification_type,
action_type,
action_threshold,
execution_role_arn,
approval_model,
subscribers,
definition,
resource_tags
FROM awscc.budgets.budgets_actions
WHERE
region = 'us-east-1' AND
Identifier = '{{ action_id }}|{{ budget_name }}';
Lists all budgets_actions in a region.
SELECT
region,
action_id,
budget_name
FROM awscc.budgets.budgets_actions_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new budgets_action resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.budgets.budgets_actions (
BudgetName,
NotificationType,
ActionType,
ActionThreshold,
ExecutionRoleArn,
Subscribers,
Definition,
region
)
SELECT
'{{ budget_name }}',
'{{ notification_type }}',
'{{ action_type }}',
'{{ action_threshold }}',
'{{ execution_role_arn }}',
'{{ subscribers }}',
'{{ definition }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.budgets.budgets_actions (
BudgetName,
NotificationType,
ActionType,
ActionThreshold,
ExecutionRoleArn,
ApprovalModel,
Subscribers,
Definition,
ResourceTags,
region
)
SELECT
'{{ budget_name }}',
'{{ notification_type }}',
'{{ action_type }}',
'{{ action_threshold }}',
'{{ execution_role_arn }}',
'{{ approval_model }}',
'{{ subscribers }}',
'{{ definition }}',
'{{ resource_tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: budgets_action
props:
- name: budget_name
value: '{{ budget_name }}'
- name: notification_type
value: '{{ notification_type }}'
- name: action_type
value: '{{ action_type }}'
- name: action_threshold
value:
value: null
type: '{{ type }}'
- name: execution_role_arn
value: '{{ execution_role_arn }}'
- name: approval_model
value: '{{ approval_model }}'
- name: subscribers
value:
- type: '{{ type }}'
address: '{{ address }}'
- name: definition
value:
iam_action_definition:
policy_arn: '{{ policy_arn }}'
roles:
- '{{ roles[0] }}'
groups:
- '{{ groups[0] }}'
users:
- '{{ users[0] }}'
scp_action_definition:
policy_id: '{{ policy_id }}'
target_ids:
- '{{ target_ids[0] }}'
ssm_action_definition:
subtype: '{{ subtype }}'
region: '{{ region }}'
instance_ids:
- '{{ instance_ids[0] }}'
- name: resource_tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a budgets_action resource, using stack-deploy.
/*+ update */
UPDATE awscc.budgets.budgets_actions
SET PatchDocument = string('{{ {
"NotificationType": notification_type,
"ActionThreshold": action_threshold,
"ExecutionRoleArn": execution_role_arn,
"ApprovalModel": approval_model,
"Subscribers": subscribers,
"Definition": definition,
"ResourceTags": resource_tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ action_id }}|{{ budget_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.budgets.budgets_actions
WHERE
Identifier = '{{ action_id }}|{{ budget_name }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the budgets_actions resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
budgets:CreateBudgetAction,
iam:PassRole,
budgets:TagResource
budgets:DescribeBudgetAction,
budgets:ListTagsForResource
budgets:UpdateBudgetAction,
iam:PassRole,
budgets:TagResource,
budgets:UntagResource,
budgets:ListTagsForResource
budgets:DeleteBudgetAction
budgets:DescribeBudgetActionsForAccount,
budgets:DescribeBudgetActionsForBudget