# ServiceDiscoveryProperty

An object that represents the service discovery information for a virtual node.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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 serviceDiscoveryProperty: appmesh.CfnVirtualNode.ServiceDiscoveryProperty = {
  awsCloudMap: {
    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',
  },
};
```

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_appmesh as appmesh

service_discovery_property = appmesh.CfnVirtualNode.ServiceDiscoveryProperty(
    aws_cloud_map=appmesh.CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty(
        namespace_name="namespaceName",
        service_name="serviceName",

        # the properties below are optional
        attributes=[appmesh.CfnVirtualNode.AwsCloudMapInstanceAttributeProperty(
            key="key",
            value="value"
        )],
        ip_preference="ipPreference"
    ),
    dns=appmesh.CfnVirtualNode.DnsServiceDiscoveryProperty(
        hostname="hostname",

        # the properties below are optional
        ip_preference="ipPreference",
        response_type="responseType"
    )
)
```

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

ServiceDiscoveryProperty serviceDiscoveryProperty = ServiceDiscoveryProperty.builder()
        .awsCloudMap(AwsCloudMapServiceDiscoveryProperty.builder()
                .namespaceName("namespaceName")
                .serviceName("serviceName")

                // the properties below are optional
                .attributes(List.of(AwsCloudMapInstanceAttributeProperty.builder()
                        .key("key")
                        .value("value")
                        .build()))
                .ipPreference("ipPreference")
                .build())
        .dns(DnsServiceDiscoveryProperty.builder()
                .hostname("hostname")

                // the properties below are optional
                .ipPreference("ipPreference")
                .responseType("responseType")
                .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.AppMesh;

var serviceDiscoveryProperty = new ServiceDiscoveryProperty {
    AwsCloudMap = new AwsCloudMapServiceDiscoveryProperty {
        NamespaceName = "namespaceName",
        ServiceName = "serviceName",

        // the properties below are optional
        Attributes = new [] { new AwsCloudMapInstanceAttributeProperty {
            Key = "key",
            Value = "value"
        } },
        IpPreference = "ipPreference"
    },
    Dns = new DnsServiceDiscoveryProperty {
        Hostname = "hostname",

        // the properties below are optional
        IpPreference = "ipPreference",
        ResponseType = "responseType"
    }
};
```

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"

serviceDiscoveryProperty := &ServiceDiscoveryProperty{
	AwsCloudMap: &AwsCloudMapServiceDiscoveryProperty{
		NamespaceName: jsii.String("namespaceName"),
		ServiceName: jsii.String("serviceName"),

		// the properties below are optional
		Attributes: []interface{}{
			&AwsCloudMapInstanceAttributeProperty{
				Key: jsii.String("key"),
				Value: jsii.String("value"),
			},
		},
		IpPreference: jsii.String("ipPreference"),
	},
	Dns: &DnsServiceDiscoveryProperty{
		Hostname: jsii.String("hostname"),

		// the properties below are optional
		IpPreference: jsii.String("ipPreference"),
		ResponseType: jsii.String("responseType"),
	},
}
```

## Properties

- `awsCloudMap`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.AwsCloudMapServiceDiscoveryProperty.html) — Specifies any AWS Cloud Map information for the virtual node.

- `dns`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVirtualNode.DnsServiceDiscoveryProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.DnsServiceDiscoveryProperty.html) — Specifies the DNS information for the virtual node.
