CfnScraperPropsMixin

class aws_cdk.mixins_preview.aws_aps.mixins.CfnScraperPropsMixin(props, *, strategy=None)

Bases: Mixin

A scraper is a fully-managed agentless collector that discovers and pulls metrics automatically.

A scraper pulls metrics from Prometheus-compatible sources within an Amazon EKS cluster, and sends them to your Amazon Managed Service for Prometheus workspace. Scrapers are flexible. You can configure the scraper to control what metrics are collected, the frequency of collection, what transformations are applied to the metrics, and more.

An IAM role will be created for you that Amazon Managed Service for Prometheus uses to access the metrics in your cluster. You must configure this role with a policy that allows it to scrape metrics from your cluster. For more information, see Configuring your Amazon EKS cluster in the Amazon Managed Service for Prometheus User Guide .

The scrapeConfiguration parameter contains the YAML configuration for the scraper. .. epigraph:

For more information about collectors, including what metrics are collected, and how to configure the scraper, see `Using an AWS managed collector <https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-collector-how-to.html>`_ in the *Amazon Managed Service for Prometheus User Guide* .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-aps-scraper.html

CloudformationResource:

AWS::APS::Scraper

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

cfn_scraper_props_mixin = aps_mixins.CfnScraperPropsMixin(aps_mixins.CfnScraperMixinProps(
    alias="alias",
    destination=aps_mixins.CfnScraperPropsMixin.DestinationProperty(
        amp_configuration=aps_mixins.CfnScraperPropsMixin.AmpConfigurationProperty(
            workspace_arn="workspaceArn"
        )
    ),
    role_configuration=aps_mixins.CfnScraperPropsMixin.RoleConfigurationProperty(
        source_role_arn="sourceRoleArn",
        target_role_arn="targetRoleArn"
    ),
    scrape_configuration=aps_mixins.CfnScraperPropsMixin.ScrapeConfigurationProperty(
        configuration_blob="configurationBlob"
    ),
    scraper_logging_configuration=aps_mixins.CfnScraperPropsMixin.ScraperLoggingConfigurationProperty(
        logging_destination=aps_mixins.CfnScraperPropsMixin.ScraperLoggingDestinationProperty(
            cloud_watch_logs=aps_mixins.CfnScraperPropsMixin.CloudWatchLogDestinationProperty(
                log_group_arn="logGroupArn"
            )
        ),
        scraper_components=[aps_mixins.CfnScraperPropsMixin.ScraperComponentProperty(
            config=aps_mixins.CfnScraperPropsMixin.ComponentConfigProperty(
                options={
                    "options_key": "options"
                }
            ),
            type="type"
        )]
    ),
    source=aps_mixins.CfnScraperPropsMixin.SourceProperty(
        eks_configuration=aps_mixins.CfnScraperPropsMixin.EksConfigurationProperty(
            cluster_arn="clusterArn",
            security_group_ids=["securityGroupIds"],
            subnet_ids=["subnetIds"]
        ),
        vpc_configuration=aps_mixins.CfnScraperPropsMixin.VpcConfigurationProperty(
            security_group_ids=["securityGroupIds"],
            subnet_ids=["subnetIds"]
        )
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::APS::Scraper.

Parameters:
  • props (Union[CfnScraperMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['alias', 'destination', 'roleConfiguration', 'scrapeConfiguration', 'scraperLoggingConfiguration', 'source', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

AmpConfigurationProperty

class CfnScraperPropsMixin.AmpConfigurationProperty(*, workspace_arn=None)

Bases: object

The AmpConfiguration structure defines the Amazon Managed Service for Prometheus instance a scraper should send metrics to.

Parameters:

workspace_arn (Optional[str]) – ARN of the Amazon Managed Service for Prometheus workspace.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-ampconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

amp_configuration_property = aps_mixins.CfnScraperPropsMixin.AmpConfigurationProperty(
    workspace_arn="workspaceArn"
)

Attributes

workspace_arn

ARN of the Amazon Managed Service for Prometheus workspace.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-ampconfiguration.html#cfn-aps-scraper-ampconfiguration-workspacearn

CloudWatchLogDestinationProperty

class CfnScraperPropsMixin.CloudWatchLogDestinationProperty(*, log_group_arn=None)

Bases: object

Represents a cloudwatch logs destination for scraper logging.

Parameters:

log_group_arn (Optional[str]) – ARN of the CloudWatch log group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-cloudwatchlogdestination.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

cloud_watch_log_destination_property = aps_mixins.CfnScraperPropsMixin.CloudWatchLogDestinationProperty(
    log_group_arn="logGroupArn"
)

Attributes

log_group_arn

ARN of the CloudWatch log group.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-cloudwatchlogdestination.html#cfn-aps-scraper-cloudwatchlogdestination-loggrouparn

ComponentConfigProperty

class CfnScraperPropsMixin.ComponentConfigProperty(*, options=None)

Bases: object

Configuration settings for a scraper component.

Parameters:

options (Union[Mapping[str, str], IResolvable, None]) – Configuration options for the scraper component.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-componentconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

component_config_property = aps_mixins.CfnScraperPropsMixin.ComponentConfigProperty(
    options={
        "options_key": "options"
    }
)

Attributes

options

Configuration options for the scraper component.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-componentconfig.html#cfn-aps-scraper-componentconfig-options

DestinationProperty

class CfnScraperPropsMixin.DestinationProperty(*, amp_configuration=None)

Bases: object

Where to send the metrics from a scraper.

Parameters:

amp_configuration (Union[IResolvable, AmpConfigurationProperty, Dict[str, Any], None]) – The Amazon Managed Service for Prometheus workspace to send metrics to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-destination.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

destination_property = aps_mixins.CfnScraperPropsMixin.DestinationProperty(
    amp_configuration=aps_mixins.CfnScraperPropsMixin.AmpConfigurationProperty(
        workspace_arn="workspaceArn"
    )
)

Attributes

amp_configuration

The Amazon Managed Service for Prometheus workspace to send metrics to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-destination.html#cfn-aps-scraper-destination-ampconfiguration

EksConfigurationProperty

class CfnScraperPropsMixin.EksConfigurationProperty(*, cluster_arn=None, security_group_ids=None, subnet_ids=None)

Bases: object

The EksConfiguration structure describes the connection to the Amazon EKS cluster from which a scraper collects metrics.

Parameters:
  • cluster_arn (Optional[str]) – ARN of the Amazon EKS cluster.

  • security_group_ids (Optional[Sequence[str]]) – A list of the security group IDs for the Amazon EKS cluster VPC configuration.

  • subnet_ids (Optional[Sequence[str]]) – A list of subnet IDs for the Amazon EKS cluster VPC configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-eksconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

eks_configuration_property = aps_mixins.CfnScraperPropsMixin.EksConfigurationProperty(
    cluster_arn="clusterArn",
    security_group_ids=["securityGroupIds"],
    subnet_ids=["subnetIds"]
)

Attributes

cluster_arn

ARN of the Amazon EKS cluster.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-eksconfiguration.html#cfn-aps-scraper-eksconfiguration-clusterarn

security_group_ids

A list of the security group IDs for the Amazon EKS cluster VPC configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-eksconfiguration.html#cfn-aps-scraper-eksconfiguration-securitygroupids

subnet_ids

A list of subnet IDs for the Amazon EKS cluster VPC configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-eksconfiguration.html#cfn-aps-scraper-eksconfiguration-subnetids

RoleConfigurationProperty

class CfnScraperPropsMixin.RoleConfigurationProperty(*, source_role_arn=None, target_role_arn=None)

Bases: object

The role configuration in an Amazon Managed Service for Prometheus scraper.

Parameters:
  • source_role_arn (Optional[str]) – The ARN of the source role.

  • target_role_arn (Optional[str]) – The ARN of the target role.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-roleconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

role_configuration_property = aps_mixins.CfnScraperPropsMixin.RoleConfigurationProperty(
    source_role_arn="sourceRoleArn",
    target_role_arn="targetRoleArn"
)

Attributes

source_role_arn

The ARN of the source role.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-roleconfiguration.html#cfn-aps-scraper-roleconfiguration-sourcerolearn

target_role_arn

The ARN of the target role.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-roleconfiguration.html#cfn-aps-scraper-roleconfiguration-targetrolearn

ScrapeConfigurationProperty

class CfnScraperPropsMixin.ScrapeConfigurationProperty(*, configuration_blob=None)

Bases: object

A scrape configuration for a scraper, base 64 encoded.

For more information, see Scraper configuration in the Amazon Managed Service for Prometheus User Guide .

Parameters:

configuration_blob (Optional[str]) – The base 64 encoded scrape configuration file.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scrapeconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

scrape_configuration_property = aps_mixins.CfnScraperPropsMixin.ScrapeConfigurationProperty(
    configuration_blob="configurationBlob"
)

Attributes

configuration_blob

The base 64 encoded scrape configuration file.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scrapeconfiguration.html#cfn-aps-scraper-scrapeconfiguration-configurationblob

ScraperComponentProperty

class CfnScraperPropsMixin.ScraperComponentProperty(*, config=None, type=None)

Bases: object

A component of a Amazon Managed Service for Prometheus scraper that can be configured for logging.

Parameters:
  • config (Union[IResolvable, ComponentConfigProperty, Dict[str, Any], None]) – The configuration settings for the scraper component.

  • type (Optional[str]) – The type of the scraper component.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scrapercomponent.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

scraper_component_property = aps_mixins.CfnScraperPropsMixin.ScraperComponentProperty(
    config=aps_mixins.CfnScraperPropsMixin.ComponentConfigProperty(
        options={
            "options_key": "options"
        }
    ),
    type="type"
)

Attributes

config

The configuration settings for the scraper component.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scrapercomponent.html#cfn-aps-scraper-scrapercomponent-config

type

The type of the scraper component.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scrapercomponent.html#cfn-aps-scraper-scrapercomponent-type

ScraperLoggingConfigurationProperty

class CfnScraperPropsMixin.ScraperLoggingConfigurationProperty(*, logging_destination=None, scraper_components=None)

Bases: object

Configuration for scraper logging.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scraperloggingconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

scraper_logging_configuration_property = aps_mixins.CfnScraperPropsMixin.ScraperLoggingConfigurationProperty(
    logging_destination=aps_mixins.CfnScraperPropsMixin.ScraperLoggingDestinationProperty(
        cloud_watch_logs=aps_mixins.CfnScraperPropsMixin.CloudWatchLogDestinationProperty(
            log_group_arn="logGroupArn"
        )
    ),
    scraper_components=[aps_mixins.CfnScraperPropsMixin.ScraperComponentProperty(
        config=aps_mixins.CfnScraperPropsMixin.ComponentConfigProperty(
            options={
                "options_key": "options"
            }
        ),
        type="type"
    )]
)

Attributes

logging_destination

Destination for scraper logging.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scraperloggingconfiguration.html#cfn-aps-scraper-scraperloggingconfiguration-loggingdestination

scraper_components

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scraperloggingconfiguration.html#cfn-aps-scraper-scraperloggingconfiguration-scrapercomponents

Type:

see

ScraperLoggingDestinationProperty

class CfnScraperPropsMixin.ScraperLoggingDestinationProperty(*, cloud_watch_logs=None)

Bases: object

The destination where scraper logs are sent.

Parameters:

cloud_watch_logs (Union[IResolvable, CloudWatchLogDestinationProperty, Dict[str, Any], None]) – The CloudWatch Logs configuration for the scraper logging destination.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scraperloggingdestination.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

scraper_logging_destination_property = aps_mixins.CfnScraperPropsMixin.ScraperLoggingDestinationProperty(
    cloud_watch_logs=aps_mixins.CfnScraperPropsMixin.CloudWatchLogDestinationProperty(
        log_group_arn="logGroupArn"
    )
)

Attributes

cloud_watch_logs

The CloudWatch Logs configuration for the scraper logging destination.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-scraperloggingdestination.html#cfn-aps-scraper-scraperloggingdestination-cloudwatchlogs

SourceProperty

class CfnScraperPropsMixin.SourceProperty(*, eks_configuration=None, vpc_configuration=None)

Bases: object

The source of collected metrics for a scraper.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-source.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

source_property = aps_mixins.CfnScraperPropsMixin.SourceProperty(
    eks_configuration=aps_mixins.CfnScraperPropsMixin.EksConfigurationProperty(
        cluster_arn="clusterArn",
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"]
    ),
    vpc_configuration=aps_mixins.CfnScraperPropsMixin.VpcConfigurationProperty(
        security_group_ids=["securityGroupIds"],
        subnet_ids=["subnetIds"]
    )
)

Attributes

eks_configuration

The Amazon EKS cluster from which a scraper collects metrics.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-source.html#cfn-aps-scraper-source-eksconfiguration

vpc_configuration

Configuration for VPC metrics source.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-source.html#cfn-aps-scraper-source-vpcconfiguration

VpcConfigurationProperty

class CfnScraperPropsMixin.VpcConfigurationProperty(*, security_group_ids=None, subnet_ids=None)

Bases: object

Configuration for VPC metrics source.

Parameters:
  • security_group_ids (Optional[Sequence[str]]) – List of security group IDs.

  • subnet_ids (Optional[Sequence[str]]) – List of subnet IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-vpcconfiguration.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_aps import mixins as aps_mixins

vpc_configuration_property = aps_mixins.CfnScraperPropsMixin.VpcConfigurationProperty(
    security_group_ids=["securityGroupIds"],
    subnet_ids=["subnetIds"]
)

Attributes

security_group_ids

List of security group IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-vpcconfiguration.html#cfn-aps-scraper-vpcconfiguration-securitygroupids

subnet_ids

List of subnet IDs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-aps-scraper-vpcconfiguration.html#cfn-aps-scraper-vpcconfiguration-subnetids