CfnScraperPropsMixin
- class aws_cdk.mixins_preview.aws_aps.mixins.CfnScraperPropsMixin(props, *, strategy=None)
Bases:
MixinA 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
scrapeConfigurationparameter 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:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
AmpConfigurationProperty
- class CfnScraperPropsMixin.AmpConfigurationProperty(*, workspace_arn=None)
Bases:
objectThe
AmpConfigurationstructure 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:
- 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.
CloudWatchLogDestinationProperty
- class CfnScraperPropsMixin.CloudWatchLogDestinationProperty(*, log_group_arn=None)
Bases:
objectRepresents a cloudwatch logs destination for scraper logging.
- Parameters:
log_group_arn (
Optional[str]) – ARN of the CloudWatch log group.- See:
- 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.
ComponentConfigProperty
- class CfnScraperPropsMixin.ComponentConfigProperty(*, options=None)
Bases:
objectConfiguration settings for a scraper component.
- Parameters:
options (
Union[Mapping[str,str],IResolvable,None]) – Configuration options for the scraper component.- See:
- 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.
DestinationProperty
- class CfnScraperPropsMixin.DestinationProperty(*, amp_configuration=None)
Bases:
objectWhere 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:
- 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.
EksConfigurationProperty
- class CfnScraperPropsMixin.EksConfigurationProperty(*, cluster_arn=None, security_group_ids=None, subnet_ids=None)
Bases:
objectThe
EksConfigurationstructure 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:
- 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.
- security_group_ids
A list of the security group IDs for the Amazon EKS cluster VPC configuration.
- subnet_ids
A list of subnet IDs for the Amazon EKS cluster VPC configuration.
RoleConfigurationProperty
- class CfnScraperPropsMixin.RoleConfigurationProperty(*, source_role_arn=None, target_role_arn=None)
Bases:
objectThe 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:
- 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.
- target_role_arn
The ARN of the target role.
ScrapeConfigurationProperty
- class CfnScraperPropsMixin.ScrapeConfigurationProperty(*, configuration_blob=None)
Bases:
objectA 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:
- 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.
ScraperComponentProperty
- class CfnScraperPropsMixin.ScraperComponentProperty(*, config=None, type=None)
Bases:
objectA 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:
- 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.
- type
The type of the scraper component.
ScraperLoggingConfigurationProperty
- class CfnScraperPropsMixin.ScraperLoggingConfigurationProperty(*, logging_destination=None, scraper_components=None)
Bases:
objectConfiguration for scraper logging.
- Parameters:
logging_destination (
Union[IResolvable,ScraperLoggingDestinationProperty,Dict[str,Any],None]) – Destination for scraper logging.scraper_components (
Union[IResolvable,Sequence[Union[IResolvable,ScraperComponentProperty,Dict[str,Any]]],None])
- See:
- 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.
ScraperLoggingDestinationProperty
- class CfnScraperPropsMixin.ScraperLoggingDestinationProperty(*, cloud_watch_logs=None)
Bases:
objectThe 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:
- 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.
SourceProperty
- class CfnScraperPropsMixin.SourceProperty(*, eks_configuration=None, vpc_configuration=None)
Bases:
objectThe source of collected metrics for a scraper.
- Parameters:
eks_configuration (
Union[IResolvable,EksConfigurationProperty,Dict[str,Any],None]) – The Amazon EKS cluster from which a scraper collects metrics.vpc_configuration (
Union[IResolvable,VpcConfigurationProperty,Dict[str,Any],None]) – Configuration for VPC metrics source.
- 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.
- vpc_configuration
Configuration for VPC metrics source.
VpcConfigurationProperty
- class CfnScraperPropsMixin.VpcConfigurationProperty(*, security_group_ids=None, subnet_ids=None)
Bases:
objectConfiguration 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:
- 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.