> **Experimental**
>
> `@aws-cdk/aws-sagemaker-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# ModelData

Model data represents the source of model artifacts, which will ultimately be loaded from an S3 location.

Obtainable from: ModelData.fromAsset, ModelData.fromBucket

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/model-data.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-sagemaker-alpha/lib/model-data.ts#L26)

## Example

TypeScript:

```ts
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';

declare const image: sagemaker.ContainerImage;
declare const modelData: sagemaker.ModelData;

const model = new sagemaker.Model(this, 'ContainerModel', {
  containers: [
    {
      image,
      modelData,
    }
  ],
  networkIsolation: true,
});
```

Python:

```python
import aws_cdk.aws_sagemaker_alpha as sagemaker

# image: sagemaker.ContainerImage
# model_data: sagemaker.ModelData

model = sagemaker.Model(self, "ContainerModel",
    containers=[sagemaker.ContainerDefinition(
        image=image,
        model_data=model_data
    )
    ],
    network_isolation=True
)
```

Java:

```java
import software.amazon.awscdk.services.sagemaker.alpha.*;

ContainerImage image;
ModelData modelData;

Model model = Model.Builder.create(this, "ContainerModel")
        .containers(List.of(ContainerDefinition.builder()
                .image(image)
                .modelData(modelData)
                .build()))
        .networkIsolation(true)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Sagemaker.Alpha
using Amazon.CDK.AWS.Sagemaker.Alpha;

ContainerImage image;
ModelData modelData;

var model = new Model(this, "ContainerModel", new ModelProps {
    Containers = new [] { new ContainerDefinition {
        Image = image,
        ModelData = modelData
    } },
    NetworkIsolation = true
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdksagemakeralpha/v2
import sagemaker "github.com/aws/aws-cdk-go/awscdksagemakeralpha"

var image ContainerImage
var modelData ModelData

model := sagemaker.NewModel(this, jsii.String("ContainerModel"), &ModelProps{
	Containers: []ContainerDefinition{
		&ContainerDefinition{
			Image: *Image,
			ModelData: *ModelData,
		},
	},
	NetworkIsolation: jsii.Boolean(true),
})
```

## Initializer

TypeScript:

```ts
new ModelData()
```

Python:

```python
ModelData()
```

Java:

```java
new ModelData()
```

C# / .NET:

```csharp
new ModelData()
```

Golang:

```go
NewModelData()
```

## Methods

- `bind(scope: Construct, model: IModel): ModelDataConfig` — This method is invoked by the SageMaker Model construct when it needs to resolve the model data to a URI.

  **Parameters**

  - `scope` — The scope within which the model data is resolved.
  - `model` — The Model construct performing the URI resolution.

- `fromAsset(path: string, options?: AssetOptions): ModelData // chainable` (static) — Constructs model data that will be uploaded to S3 as part of the CDK app deployment.

  **Parameters**

  - `path` — The local path to a model artifact file as a gzipped tar file.
  - `options` — The options to further configure the selected asset.

- `fromBucket(bucket: IBucket, objectKey: string): ModelData // chainable` (static) — Constructs model data which is already available within S3.

  **Parameters**

  - `bucket` — The S3 bucket within which the model artifacts are stored.
  - `objectKey` — The S3 object key at which the model artifacts are stored.
