# SourceProperty

The source of collected metrics for a scraper.

- Source: Generated at build time
- Type last changed: v2.225.0 · 17 Nov 2025

## 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 sourceProperty: aps.CfnScraper.SourceProperty = {
  eksConfiguration: {
    clusterArn: 'clusterArn',
    subnetIds: ['subnetIds'],

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

Python:

```python
# 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

source_property = 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"]
    )
)
```

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.*;

SourceProperty sourceProperty = 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();
```

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 sourceProperty = 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" }
    }
};
```

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"

sourceProperty := &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"),
		},
	},
}
```

## Properties

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

- `vpcConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnScraper.VpcConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnScraper.VpcConfigurationProperty.html) — Configuration for VPC metrics source.
