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 = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all scrapers in a region.
SELECT
region,
arn
FROM awscc.aps.scrapers_list_only
WHERE
region = 'us-east-1';
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 }}';
/*+ create */
INSERT INTO awscc.aps.scrapers (
Alias,
ScrapeConfiguration,
RoleConfiguration,
Source,
Destination,
Tags,
region
)
SELECT
'{{ alias }}',
'{{ scrape_configuration }}',
'{{ role_configuration }}',
'{{ source }}',
'{{ destination }}',
'{{ tags }}',
'{{ region }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.aps.scrapers
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
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