# CfnScraperProps

Properties for defining a `CfnScraper`.

Used as props by: [CfnScraper](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.html)

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_aps as aps } from 'aws-cdk-lib';
const cfnScraperProps: aps.CfnScraperProps = {
  destination: {
    ampConfiguration: {
      workspaceArn: 'workspaceArn',
    },
    cloudWatchConfiguration: {
      datasetArn: 'datasetArn',
    },
  },
  scrapeConfiguration: {
    configurationBlob: 'configurationBlob',
  },
  source: {
    eksConfiguration: {
      clusterArn: 'clusterArn',
      subnetIds: ['subnetIds'],

      // the properties below are optional
      securityGroupIds: ['securityGroupIds'],
    },
    vpcConfiguration: {
      securityGroupIds: ['securityGroupIds'],
      subnetIds: ['subnetIds'],
    },
  },

  // the properties below are optional
  alias: 'alias',
  exporters: [{
    openSearchConfiguration: {
      domainArn: 'domainArn',
    },
  }],
  roleConfiguration: {
    sourceRoleArn: 'sourceRoleArn',
    targetRoleArn: 'targetRoleArn',
  },
  scraperLoggingConfiguration: {
    loggingDestination: {
      cloudWatchLogs: {
        logGroupArn: 'logGroupArn',
      },
    },
    scraperComponents: [{
      type: 'type',

      // the properties below are optional
      config: {
        options: {
          optionsKey: 'options',
        },
      },
    }],
  },
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_aps as aps

cfn_scraper_props = aps.CfnScraperProps(
    destination=aps.CfnScraper.DestinationProperty(
        amp_configuration=aps.CfnScraper.AmpConfigurationProperty(
            workspace_arn="workspaceArn"
        ),
        cloud_watch_configuration=aps.CfnScraper.CloudWatchConfigurationProperty(
            dataset_arn="datasetArn"
        )
    ),
    scrape_configuration=aps.CfnScraper.ScrapeConfigurationProperty(
        configuration_blob="configurationBlob"
    ),
    source=aps.CfnScraper.SourceProperty(
        eks_configuration=aps.CfnScraper.EksConfigurationProperty(
            cluster_arn="clusterArn",
            subnet_ids=["subnetIds"],

            # the properties below are optional
            security_group_ids=["securityGroupIds"]
        ),
        vpc_configuration=aps.CfnScraper.VpcConfigurationProperty(
            security_group_ids=["securityGroupIds"],
            subnet_ids=["subnetIds"]
        )
    ),

    # the properties below are optional
    alias="alias",
    exporters=[aps.CfnScraper.ExporterConfigurationProperty(
        open_search_configuration=aps.CfnScraper.OpenSearchConfigurationProperty(
            domain_arn="domainArn"
        )
    )],
    role_configuration=aps.CfnScraper.RoleConfigurationProperty(
        source_role_arn="sourceRoleArn",
        target_role_arn="targetRoleArn"
    ),
    scraper_logging_configuration=aps.CfnScraper.ScraperLoggingConfigurationProperty(
        logging_destination=aps.CfnScraper.ScraperLoggingDestinationProperty(
            cloud_watch_logs=aps.CfnScraper.CloudWatchLogDestinationProperty(
                log_group_arn="logGroupArn"
            )
        ),
        scraper_components=[aps.CfnScraper.ScraperComponentProperty(
            type="type",

            # the properties below are optional
            config=aps.CfnScraper.ComponentConfigProperty(
                options={
                    "options_key": "options"
                }
            )
        )]
    ),
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.aps.*;

CfnScraperProps cfnScraperProps = CfnScraperProps.builder()
        .destination(DestinationProperty.builder()
                .ampConfiguration(AmpConfigurationProperty.builder()
                        .workspaceArn("workspaceArn")
                        .build())
                .cloudWatchConfiguration(CloudWatchConfigurationProperty.builder()
                        .datasetArn("datasetArn")
                        .build())
                .build())
        .scrapeConfiguration(ScrapeConfigurationProperty.builder()
                .configurationBlob("configurationBlob")
                .build())
        .source(SourceProperty.builder()
                .eksConfiguration(EksConfigurationProperty.builder()
                        .clusterArn("clusterArn")
                        .subnetIds(List.of("subnetIds"))

                        // the properties below are optional
                        .securityGroupIds(List.of("securityGroupIds"))
                        .build())
                .vpcConfiguration(VpcConfigurationProperty.builder()
                        .securityGroupIds(List.of("securityGroupIds"))
                        .subnetIds(List.of("subnetIds"))
                        .build())
                .build())

        // the properties below are optional
        .alias("alias")
        .exporters(List.of(ExporterConfigurationProperty.builder()
                .openSearchConfiguration(OpenSearchConfigurationProperty.builder()
                        .domainArn("domainArn")
                        .build())
                .build()))
        .roleConfiguration(RoleConfigurationProperty.builder()
                .sourceRoleArn("sourceRoleArn")
                .targetRoleArn("targetRoleArn")
                .build())
        .scraperLoggingConfiguration(ScraperLoggingConfigurationProperty.builder()
                .loggingDestination(ScraperLoggingDestinationProperty.builder()
                        .cloudWatchLogs(CloudWatchLogDestinationProperty.builder()
                                .logGroupArn("logGroupArn")
                                .build())
                        .build())
                .scraperComponents(List.of(ScraperComponentProperty.builder()
                        .type("type")

                        // the properties below are optional
                        .config(ComponentConfigProperty.builder()
                                .options(Map.of(
                                        "optionsKey", "options"))
                                .build())
                        .build()))
                .build())
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APS;

var cfnScraperProps = new CfnScraperProps {
    Destination = new DestinationProperty {
        AmpConfiguration = new AmpConfigurationProperty {
            WorkspaceArn = "workspaceArn"
        },
        CloudWatchConfiguration = new CloudWatchConfigurationProperty {
            DatasetArn = "datasetArn"
        }
    },
    ScrapeConfiguration = new ScrapeConfigurationProperty {
        ConfigurationBlob = "configurationBlob"
    },
    Source = new SourceProperty {
        EksConfiguration = new EksConfigurationProperty {
            ClusterArn = "clusterArn",
            SubnetIds = new [] { "subnetIds" },

            // the properties below are optional
            SecurityGroupIds = new [] { "securityGroupIds" }
        },
        VpcConfiguration = new VpcConfigurationProperty {
            SecurityGroupIds = new [] { "securityGroupIds" },
            SubnetIds = new [] { "subnetIds" }
        }
    },

    // the properties below are optional
    Alias = "alias",
    Exporters = new [] { new ExporterConfigurationProperty {
        OpenSearchConfiguration = new OpenSearchConfigurationProperty {
            DomainArn = "domainArn"
        }
    } },
    RoleConfiguration = new RoleConfigurationProperty {
        SourceRoleArn = "sourceRoleArn",
        TargetRoleArn = "targetRoleArn"
    },
    ScraperLoggingConfiguration = new ScraperLoggingConfigurationProperty {
        LoggingDestination = new ScraperLoggingDestinationProperty {
            CloudWatchLogs = new CloudWatchLogDestinationProperty {
                LogGroupArn = "logGroupArn"
            }
        },
        ScraperComponents = new [] { new ScraperComponentProperty {
            Type = "type",

            // the properties below are optional
            Config = new ComponentConfigProperty {
                Options = new Dictionary<string, string> {
                    { "optionsKey", "options" }
                }
            }
        } }
    },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnScraperProps := &CfnScraperProps{
	Destination: &DestinationProperty{
		AmpConfiguration: &AmpConfigurationProperty{
			WorkspaceArn: jsii.String("workspaceArn"),
		},
		CloudWatchConfiguration: &CloudWatchConfigurationProperty{
			DatasetArn: jsii.String("datasetArn"),
		},
	},
	ScrapeConfiguration: &ScrapeConfigurationProperty{
		ConfigurationBlob: jsii.String("configurationBlob"),
	},
	Source: &SourceProperty{
		EksConfiguration: &EksConfigurationProperty{
			ClusterArn: jsii.String("clusterArn"),
			SubnetIds: []*string{
				jsii.String("subnetIds"),
			},

			// the properties below are optional
			SecurityGroupIds: []*string{
				jsii.String("securityGroupIds"),
			},
		},
		VpcConfiguration: &VpcConfigurationProperty{
			SecurityGroupIds: []*string{
				jsii.String("securityGroupIds"),
			},
			SubnetIds: []*string{
				jsii.String("subnetIds"),
			},
		},
	},

	// the properties below are optional
	Alias: jsii.String("alias"),
	Exporters: []interface{}{
		&ExporterConfigurationProperty{
			OpenSearchConfiguration: &OpenSearchConfigurationProperty{
				DomainArn: jsii.String("domainArn"),
			},
		},
	},
	RoleConfiguration: &RoleConfigurationProperty{
		SourceRoleArn: jsii.String("sourceRoleArn"),
		TargetRoleArn: jsii.String("targetRoleArn"),
	},
	ScraperLoggingConfiguration: &ScraperLoggingConfigurationProperty{
		LoggingDestination: &ScraperLoggingDestinationProperty{
			CloudWatchLogs: &CloudWatchLogDestinationProperty{
				LogGroupArn: jsii.String("logGroupArn"),
			},
		},
		ScraperComponents: []interface{}{
			&ScraperComponentProperty{
				Type: jsii.String("type"),

				// the properties below are optional
				Config: &ComponentConfigProperty{
					Options: map[string]*string{
						"optionsKey": jsii.String("options"),
					},
				},
			},
		},
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `alias`: string — An optional user-assigned scraper alias.

- `destination`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.DestinationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.DestinationProperty.html) (required) — The Amazon Managed Service for Prometheus workspace the scraper sends metrics to.

- `exporters`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.ExporterConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.ExporterConfigurationProperty.html)[] — Exporter configurations for the scraper.

- `roleConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.RoleConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.RoleConfigurationProperty.html) — The role configuration in an Amazon Managed Service for Prometheus scraper.

- `scrapeConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.ScrapeConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.ScrapeConfigurationProperty.html) (required) — The configuration in use by the scraper.

- `scraperLoggingConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.ScraperLoggingConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.ScraperLoggingConfigurationProperty.html) — The definition of logging configuration in an Amazon Managed Service for Prometheus workspace.

- `source`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.SourceProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.SourceProperty.html) (required) — The Amazon EKS cluster from which the scraper collects metrics.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — (Optional) The list of tag keys and values associated with the scraper.
