# InstanceReference

A reference to a Instance resource.

- Source: Generated at build time
- Type last changed: v2.272.0 · 30 Sep 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_servicediscovery as interfaces_servicediscovery } from 'aws-cdk-lib/interfaces';
const instanceReference: interfaces_servicediscovery.InstanceReference = {
  instanceId: 'instanceId',
  serviceId: 'serviceId',
};
```

Python:

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

instance_reference = interfaces_servicediscovery.InstanceReference(
    instance_id="instanceId",
    service_id="serviceId"
)
```

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

InstanceReference instanceReference = InstanceReference.builder()
        .instanceId("instanceId")
        .serviceId("serviceId")
        .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.Interfaces.ServiceDiscovery;

var instanceReference = new InstanceReference {
    InstanceId = "instanceId",
    ServiceId = "serviceId"
};
```

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"

instanceReference := &InstanceReference{
	InstanceId: jsii.String("instanceId"),
	ServiceId: jsii.String("serviceId"),
}
```

## Properties

- `instanceId`: string (required) — The InstanceId of the Instance resource.

- `serviceId`: string (required) — The ServiceId of the Instance resource.
