# HostEntryProperty

The `HostEntry` property specifies a hostname and an IP address that are added to the `/etc/hosts` file of a container through the `extraHosts` parameter of its `ContainerDefinition` resource.

- 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_ecs as ecs } from 'aws-cdk-lib';
const hostEntryProperty: ecs.CfnTaskDefinition.HostEntryProperty = {
  hostname: 'hostname',
  ipAddress: 'ipAddress',
};
```

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

host_entry_property = ecs.CfnTaskDefinition.HostEntryProperty(
    hostname="hostname",
    ip_address="ipAddress"
)
```

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

HostEntryProperty hostEntryProperty = HostEntryProperty.builder()
        .hostname("hostname")
        .ipAddress("ipAddress")
        .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;

var hostEntryProperty = new HostEntryProperty {
    Hostname = "hostname",
    IpAddress = "ipAddress"
};
```

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"

hostEntryProperty := &HostEntryProperty{
	Hostname: jsii.String("hostname"),
	IpAddress: jsii.String("ipAddress"),
}
```

## Properties

- `hostname`: string — The hostname to use in the `/etc/hosts` entry.

- `ipAddress`: string — The IP address to use in the `/etc/hosts` entry.
