# ServiceAttributes

- Source: [`aws-servicediscovery/lib/service.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-servicediscovery/lib/service.ts#L171)
- Type last changed: v2.38.0 · 17 Aug 2022

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_servicediscovery as servicediscovery } from 'aws-cdk-lib';

declare const namespace: servicediscovery.INamespace;
const serviceAttributes: servicediscovery.ServiceAttributes = {
  dnsRecordType: servicediscovery.DnsRecordType.A,
  namespace: namespace,
  routingPolicy: servicediscovery.RoutingPolicy.WEIGHTED,
  serviceArn: 'serviceArn',
  serviceId: 'serviceId',
  serviceName: 'serviceName',

  // the properties below are optional
  discoveryType: servicediscovery.DiscoveryType.API,
};
```

## Properties

- `discoveryType`: [DiscoveryType](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.DiscoveryType.html)

- `dnsRecordType`: [DnsRecordType](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.DnsRecordType.html) (required)

- `namespace`: [INamespace](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.INamespace.html) (required)

- `routingPolicy`: [RoutingPolicy](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.RoutingPolicy.html) (required)

- `serviceArn`: string (required)

- `serviceId`: string (required)

- `serviceName`: string (required)
