Skip to main content

code_reviews

Creates, updates, deletes, gets or lists a code_reviews resource.

Overview

Namecode_reviews
TypeResource
Idaws.securityagent.code_reviews

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
code_reviewsarrayThe list of code reviews that were found.
not_foundarrayList of code review IDs.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_code_reviewsselectregionRetrieves information about one or more code reviews in an agent space.
list_code_reviewsselectregionReturns a paginated list of code review summaries for the specified agent space.
create_code_reviewinsertregion, title, agentSpaceId, assetsCreates a new code review configuration in an agent space. A code review defines the parameters for automated security-focused code analysis.
update_code_reviewupdateregion, codeReviewId, agentSpaceIdUpdates an existing code review configuration.
batch_delete_code_reviewsexecregion, codeReviewIds, agentSpaceIdDeletes one or more code reviews from an agent space.
start_code_review_jobexecregion, agentSpaceId, codeReviewIdStarts a new code review job for a code review configuration. The job executes the security-focused code analysis defined in the code review.
stop_code_review_jobexecregion, agentSpaceId, codeReviewJobIdStops a running code review job. The job transitions to a stopping state and then to stopped after cleanup completes.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves information about one or more code reviews in an agent space.

SELECT
code_reviews,
not_found
FROM aws.securityagent.code_reviews
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new code review configuration in an agent space. A code review defines the parameters for automated security-focused code analysis.

INSERT INTO aws.securityagent.code_reviews (
title,
agentSpaceId,
assets,
serviceRole,
logConfig,
codeRemediationStrategy,
validationMode,
maxTaskHours,
region
)
SELECT
'{{ title }}' /* required */,
'{{ agentSpaceId }}' /* required */,
'{{ assets }}' /* required */,
'{{ serviceRole }}',
'{{ logConfig }}',
'{{ codeRemediationStrategy }}',
'{{ validationMode }}',
{{ maxTaskHours }},
'{{ region }}'
RETURNING
agent_space_id,
assets,
code_remediation_strategy,
code_review_id,
created_at,
log_config,
max_task_hours,
service_role,
title_,
updated_at,
validation_mode
;

UPDATE examples

Updates an existing code review configuration.

UPDATE aws.securityagent.code_reviews
SET
codeReviewId = '{{ codeReviewId }}',
agentSpaceId = '{{ agentSpaceId }}',
title = '{{ title }}',
assets = '{{ assets }}',
serviceRole = '{{ serviceRole }}',
logConfig = '{{ logConfig }}',
codeRemediationStrategy = '{{ codeRemediationStrategy }}',
validationMode = '{{ validationMode }}',
maxTaskHours = {{ maxTaskHours }}
WHERE
region = '{{ region }}' --required
AND codeReviewId = '{{ codeReviewId }}' --required
AND agentSpaceId = '{{ agentSpaceId }}' --required
RETURNING
agent_space_id,
assets,
code_remediation_strategy,
code_review_id,
created_at,
log_config,
max_task_hours,
service_role,
title_,
updated_at,
validation_mode;

Lifecycle Methods

Deletes one or more code reviews from an agent space.

EXEC aws.securityagent.code_reviews.batch_delete_code_reviews
@region='{{ region }}' --required
@@json=
'{
"codeReviewIds": "{{ codeReviewIds }}",
"agentSpaceId": "{{ agentSpaceId }}"
}'
;