# ScratchSpace

The temporary disk space mounted to the container.

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

- Source: [`aws-ecs/lib/container-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ecs/lib/container-definition.ts#L1509)

## 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 scratchSpace: ecs.ScratchSpace = {
  containerPath: 'containerPath',
  name: 'name',
  readOnly: false,
  sourcePath: 'sourcePath',
};
```

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

scratch_space = ecs.ScratchSpace(
    container_path="containerPath",
    name="name",
    read_only=False,
    source_path="sourcePath"
)
```

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

ScratchSpace scratchSpace = ScratchSpace.builder()
        .containerPath("containerPath")
        .name("name")
        .readOnly(false)
        .sourcePath("sourcePath")
        .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 scratchSpace = new ScratchSpace {
    ContainerPath = "containerPath",
    Name = "name",
    ReadOnly = false,
    SourcePath = "sourcePath"
};
```

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"

scratchSpace := &ScratchSpace{
	ContainerPath: jsii.String("containerPath"),
	Name: jsii.String("name"),
	ReadOnly: jsii.Boolean(false),
	SourcePath: jsii.String("sourcePath"),
}
```

## Properties

- `containerPath`: string (required) — The path on the container to mount the scratch volume at.

- `name`: string (required) — The name of the scratch volume to mount.

  Must be a volume name referenced in the name parameter of task definition volume.

- `readOnly`: boolean (required) — Specifies whether to give the container read-only access to the scratch volume.

  If this value is true, the container has read-only access to the scratch volume.
  If this value is false, then the container can write to the scratch volume.

- `sourcePath`: string (required)
