scrapers
Creates, updates, deletes or gets a scraper resource or lists scrapers in a region
Overview
| Name | scrapers |
| Type | Resource |
| Description | Resource Type definition for AWS::APS::Scraper |
| Id | awscc.aps.scrapers |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
scraper_id | string | Required to identify a specific scraper. |
alias | string | Scraper alias. |
arn | string | Scraper ARN. |
role_arn | string | IAM role ARN for the scraper. |
scrape_configuration | object | Scraper configuration |
role_configuration | object | Role configuration |
source | object | Scraper metrics source |
destination | object | Scraper metrics destination |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | Scraper ARN. |
region | string | AWS region. |
For more information, see AWS::APS::Scraper.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | scrapers | INSERT | ScrapeConfiguration, Source, Destination, region |
delete_resource | scrapers | DELETE | Identifier, region |
update_resource | scrapers | UPDATE | Identifier, PatchDocument, region |
list_resources | scrapers_list_only | SELECT | region |
get_resource | scrapers | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual scraper.
SELECT
region,
scraper_id,
alias,
arn,
role_arn,
scrape_configuration,
role_configuration,
source,
destination,
tags
FROM awscc.aps.scrapers
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all scrapers in a region.
SELECT
region,
arn
FROM awscc.aps.scrapers_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new scraper resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.aps.scrapers (
ScrapeConfiguration,
Source,
Destination,
region
)
SELECT
'{{ scrape_configuration }}',
'{{ source }}',
'{{ destination }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.aps.scrapers (
Alias,
ScrapeConfiguration,
RoleConfiguration,
Source,
Destination,
Tags,
region
)
SELECT
'{{ alias }}',
'{{ scrape_configuration }}',
'{{ role_configuration }}',
'{{ source }}',
'{{ destination }}',
'{{ 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: scraper
props:
- name: alias
value: '{{ alias }}'
- name: scrape_configuration
value:
configuration_blob: '{{ configuration_blob }}'
- name: role_configuration
value:
source_role_arn: '{{ source_role_arn }}'
target_role_arn: '{{ target_role_arn }}'
- name: source
value:
eks_configuration:
cluster_arn: '{{ cluster_arn }}'
security_group_ids:
- '{{ security_group_ids[0] }}'
subnet_ids:
- '{{ subnet_ids[0] }}'
- name: destination
value:
amp_configuration:
workspace_arn: '{{ workspace_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a scraper resource, using stack-deploy.
/*+ update */
UPDATE awscc.aps.scrapers
SET PatchDocument = string('{{ {
"Alias": alias,
"ScrapeConfiguration": scrape_configuration,
"RoleConfiguration": role_configuration,
"Destination": destination,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.aps.scrapers
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
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 scrapers resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
aps:CreateScraper,
aps:DescribeScraper,
aps:DescribeWorkspace,
aps:TagResource,
eks:CreateAccessEntry,
eks:AssociateAccessPolicy,
eks:DescribeCluster,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
iam:CreateServiceLinkedRole,
iam:PassRole
aps:DescribeScraper,
aps:ListTagsForResource
aps:CreateScraper,
aps:DescribeScraper,
aps:UpdateScraper,
aps:DescribeWorkspace,
aps:TagResource,
aps:UntagResource,
aps:ListTagsForResource,
iam:PassRole
aps:DeleteScraper,
aps:DescribeScraper,
aps:DescribeWorkspace,
eks:AssociateAccessPolicy,
eks:DescribeCluster,
ec2:DescribeSubnets,
ec2:DescribeSecurityGroups,
iam:DeleteServiceLinkedRole
aps:ListScrapers,
aps:ListTagsForResource