transactions
Creates, updates, deletes, gets or lists a transactions resource.
Overview​
| Name | transactions |
| Type | Resource |
| Id | aws.rds_data.transactions |
Fields​
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
begin_transaction | exec | region, resourceArn, secretArn | Starts a SQL transaction. A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours. A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically. For Aurora MySQL, DDL statements inside a transaction cause an implicit commit. We recommend that you run each MySQL DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled. | |
commit_transaction | exec | region, resourceArn, secretArn, transactionId | Ends a SQL transaction started with the BeginTransaction operation and commits the changes. | |
rollback_transaction | exec | region, resourceArn, secretArn, transactionId | Performs a rollback of a transaction. Rolling back a transaction cancels its changes. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
Lifecycle Methods​
- begin_transaction
- commit_transaction
- rollback_transaction
Starts a SQL transaction. A transaction can run for a maximum of 24 hours. A transaction is terminated and rolled back automatically after 24 hours. A transaction times out if no calls use its transaction ID in three minutes. If a transaction times out before it's committed, it's rolled back automatically. For Aurora MySQL, DDL statements inside a transaction cause an implicit commit. We recommend that you run each MySQL DDL statement in a separate ExecuteStatement call with continueAfterTimeout enabled.
EXEC aws.rds_data.transactions.begin_transaction
@region='{{ region }}' --required
@@json=
'{
"resourceArn": "{{ resourceArn }}",
"secretArn": "{{ secretArn }}",
"database": "{{ database }}",
"schema": "{{ schema }}"
}'
;
Ends a SQL transaction started with the BeginTransaction operation and commits the changes.
EXEC aws.rds_data.transactions.commit_transaction
@region='{{ region }}' --required
@@json=
'{
"resourceArn": "{{ resourceArn }}",
"secretArn": "{{ secretArn }}",
"transactionId": "{{ transactionId }}"
}'
;
Performs a rollback of a transaction. Rolling back a transaction cancels its changes.
EXEC aws.rds_data.transactions.rollback_transaction
@region='{{ region }}' --required
@@json=
'{
"resourceArn": "{{ resourceArn }}",
"secretArn": "{{ secretArn }}",
"transactionId": "{{ transactionId }}"
}'
;