Skip to content
v2.277.0

Host Struct ​

The details on a container instance bind mount host volume.

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 host: ecs.Host = {
  sourcePath: 'sourcePath',
};
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 = ecs.Host(
    source_path="sourcePath"
)
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.*;

Host host = Host.builder()
        .sourcePath("sourcePath")
        .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 host = new Host {
    SourcePath = "sourcePath"
};
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"

host := &Host{
	SourcePath: jsii.String("sourcePath"),
}

Properties ​

sourcePathoptionalstringsource_pathoptionalstrsourcePathoptionalStringSourcePathoptionalstringSourcePathoptional*string#
Specifies the path on the host container instance that is presented to the container.
notes

If the sourcePath value does not exist on the host container instance, the Docker daemon creates it. If the location does exist, the contents of the source path folder are exported.

This property is not supported for tasks that use the Fargate launch type.