Skip to content
v2.277.0

HostEntryProperty Struct ​

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.

Example ​

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
# 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
// 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();
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"
};
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 ​

hostnameoptionalstringhostnameoptionalstrhostnameoptionalStringHostnameoptionalstringHostnameoptional*string#
The hostname to use in the `/etc/hosts` entry.
ipAddressoptionalstringip_addressoptionalstripAddressoptionalStringIpAddressoptionalstringIpAddressoptional*string#
The IP address to use in the `/etc/hosts` entry.