# ExternalServiceAttributes

The properties to import from the service using the External launch type.

Used as argument in: [ExternalService.fromExternalServiceAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ExternalService.html#fromexternalserviceattributes)

- Source: [`aws-ecs/lib/external/external-service.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ecs/lib/external/external-service.ts#L60)
- Type last changed: v2.60.0 · 12 Jan 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_ecs as ecs } from 'aws-cdk-lib';

declare const cluster: ecs.Cluster;
const externalServiceAttributes: ecs.ExternalServiceAttributes = {
  cluster: cluster,

  // the properties below are optional
  serviceArn: 'serviceArn',
  serviceName: 'serviceName',
};
```

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_ecs as ecs

# cluster: ecs.Cluster

external_service_attributes = ecs.ExternalServiceAttributes(
    cluster=cluster,

    # the properties below are optional
    service_arn="serviceArn",
    service_name="serviceName"
)
```

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

Cluster cluster;

ExternalServiceAttributes externalServiceAttributes = ExternalServiceAttributes.builder()
        .cluster(cluster)

        // the properties below are optional
        .serviceArn("serviceArn")
        .serviceName("serviceName")
        .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.ECS;

Cluster cluster;

var externalServiceAttributes = new ExternalServiceAttributes {
    Cluster = cluster,

    // the properties below are optional
    ServiceArn = "serviceArn",
    ServiceName = "serviceName"
};
```

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"

var cluster Cluster

externalServiceAttributes := &ExternalServiceAttributes{
	Cluster: cluster,

	// the properties below are optional
	ServiceArn: jsii.String("serviceArn"),
	ServiceName: jsii.String("serviceName"),
}
```

## Properties

- `cluster`: [ICluster](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ICluster.html) (required) — The cluster that hosts the service.

- `serviceArn`: string — The service ARN.

  **Default:** either this, or `serviceName`, is required

- `serviceName`: string — The name of the service.

  **Default:** either this, or `serviceArn`, is required
