assessment_targets
Creates, updates, deletes, gets or lists an assessment_targets resource.
Overview
| Name | assessment_targets |
| Type | Resource |
| Id | aws.inspector.assessment_targets |
Fields
The following fields are returned by SELECT queries:
- describe_assessment_targets
- list_assessment_targets
| Name | Datatype | Description |
|---|---|---|
assessment_targets | array | Information about the assessment targets. |
failed_items | object | Assessment target details that cannot be described. An error code is provided for each failed item. |
| Name | Datatype | Description |
|---|---|---|
assessment_target_arn | string | A list of ARNs that specifies the assessment targets that are returned by the action. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_assessment_targets | select | region | Describes the assessment targets that are specified by the ARNs of the assessment targets. | |
list_assessment_targets | select | region | Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see Amazon Inspector Assessment Targets. | |
create_assessment_target | insert | region, assessmentTargetName | Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the service-linked role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets. | |
update_assessment_target | update | region, assessmentTargetArn, assessmentTargetName | Updates the assessment target that is specified by the ARN of the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. | |
delete_assessment_target | delete | region | Deletes the assessment target that is specified by the ARN of the assessment target. |
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) |
SELECT examples
- describe_assessment_targets
- list_assessment_targets
Describes the assessment targets that are specified by the ARNs of the assessment targets.
SELECT
assessment_targets,
failed_items
FROM aws.inspector.assessment_targets
WHERE region = '{{ region }}' -- required
;
Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see Amazon Inspector Assessment Targets.
SELECT
assessment_target_arn
FROM aws.inspector.assessment_targets
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_assessment_target
- Manifest
Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the service-linked role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets.
INSERT INTO aws.inspector.assessment_targets (
assessmentTargetName,
resourceGroupArn,
region
)
SELECT
'{{ assessmentTargetName }}' /* required */,
'{{ resourceGroupArn }}',
'{{ region }}'
RETURNING
assessment_target_arn
;
# Description fields are for documentation purposes
- name: assessment_targets
props:
- name: region
value: "{{ region }}"
description: Required parameter for the assessment_targets resource.
- name: assessmentTargetName
value: "{{ assessmentTargetName }}"
description: |
The user-defined name that identifies the assessment target that you want to create. The name must be unique within the AWS account.
- name: resourceGroupArn
value: "{{ resourceGroupArn }}"
description: |
The ARN that specifies the resource group that is used to create the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.
UPDATE examples
- update_assessment_target
Updates the assessment target that is specified by the ARN of the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.
UPDATE aws.inspector.assessment_targets
SET
assessmentTargetArn = '{{ assessmentTargetArn }}',
assessmentTargetName = '{{ assessmentTargetName }}',
resourceGroupArn = '{{ resourceGroupArn }}'
WHERE
region = '{{ region }}' --required
AND assessmentTargetArn = '{{ assessmentTargetArn }}' --required
AND assessmentTargetName = '{{ assessmentTargetName }}' --required;
DELETE examples
- delete_assessment_target
Deletes the assessment target that is specified by the ARN of the assessment target.
DELETE FROM aws.inspector.assessment_targets
WHERE region = '{{ region }}' --required
;