# AssociateCloudMapServiceOptions

The options for using a cloudmap service.

- Source: [`aws-ecs/lib/base/base-service.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L2097)

## Example

TypeScript:

```ts
declare const cloudMapService: cloudmap.Service;
declare const ecsService: ecs.FargateService;

ecsService.associateCloudMapService({
  service: cloudMapService,
});
```

Python:

```python
# cloud_map_service: cloudmap.Service
# ecs_service: ecs.FargateService

ecs_service.associate_cloud_map_service(
    service=cloud_map_service
)
```

Java:

```java
Service cloudMapService;
FargateService ecsService;

ecsService.associateCloudMapService(AssociateCloudMapServiceOptions.builder()
        .service(cloudMapService)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Service cloudMapService;
FargateService ecsService;

ecsService.AssociateCloudMapService(new AssociateCloudMapServiceOptions {
    Service = cloudMapService
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cloudMapService Service
var ecsService FargateService

ecsService.AssociateCloudMapService(&AssociateCloudMapServiceOptions{
	Service: cloudMapService,
})
```

## Properties

- `container`: [ContainerDefinition](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerDefinition.html) — The container to point to for a SRV record.

  **Default:** the task definition's default container

- `containerPort`: number — The port to point to for a SRV record.

  **Default:** the default port of the task definition's default container

- `service`: [IService](/cdk/api/v2/docs/aws-cdk-lib.aws_servicediscovery.IService.html) (required) — The cloudmap service to register with.
