# ServiceDiscoveryConfig

Properties for VirtualNode Service Discovery.

- Source: [`aws-appmesh/lib/service-discovery.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-appmesh/lib/service-discovery.ts#L54)

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';
const serviceDiscoveryConfig: appmesh.ServiceDiscoveryConfig = {
  cloudmap: {
    namespaceName: 'namespaceName',
    serviceName: 'serviceName',

    // the properties below are optional
    attributes: [{
      key: 'key',
      value: 'value',
    }],
    ipPreference: 'ipPreference',
  },
  dns: {
    hostname: 'hostname',

    // the properties below are optional
    ipPreference: 'ipPreference',
    responseType: 'responseType',
  },
};
```

## Properties

- `cloudmap`: [CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty.html) — Cloud Map based Service Discovery.

  **Default:** no Cloud Map based service discovery

- `dns`: [CfnVirtualNode.DnsServiceDiscoveryProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.DnsServiceDiscoveryProperty.html) — DNS based Service Discovery.

  **Default:** no DNS based service discovery
