# PlatformVersion

The platform version of the Agent Runtime.

Obtainable from: PlatformVersion.V1, PlatformVersion.V2, PlatformVersion.of

- Source: [`aws-bedrockagentcore/lib/runtime/types.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/runtime/types.ts#L66)
- Type last changed: v2.273.0 · 8 Oct 2026

## Example

TypeScript:

```ts
const repository = new ecr.Repository(this, 'TestRepository', {
  repositoryName: 'test-agent-runtime',
});

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');

new agentcore.Runtime(this, 'test-runtime', {
  runtimeName: 'test_runtime',
  agentRuntimeArtifact: agentRuntimeArtifact,
  platformVersion: agentcore.PlatformVersion.V2,
  minimumMemory: cdk.Size.gibibytes(4),
});
```

Python:

```python
repository = ecr.Repository(self, "TestRepository",
    repository_name="test-agent-runtime"
)

agent_runtime_artifact = agentcore.AgentRuntimeArtifact.from_ecr_repository(repository, "v1.0.0")

agentcore.Runtime(self, "test-runtime",
    runtime_name="test_runtime",
    agent_runtime_artifact=agent_runtime_artifact,
    platform_version=agentcore.PlatformVersion.V2,
    minimum_memory=cdk.Size.gibibytes(4)
)
```

Java:

```java
Repository repository = Repository.Builder.create(this, "TestRepository")
        .repositoryName("test-agent-runtime")
        .build();

AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

Runtime.Builder.create(this, "test-runtime")
        .runtimeName("test_runtime")
        .agentRuntimeArtifact(agentRuntimeArtifact)
        .platformVersion(PlatformVersion.V2)
        .minimumMemory(Size.gibibytes(4))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var repository = new Repository(this, "TestRepository", new RepositoryProps {
    RepositoryName = "test-agent-runtime"
});

var agentRuntimeArtifact = AgentRuntimeArtifact.FromEcrRepository(repository, "v1.0.0");

new Runtime(this, "test-runtime", new RuntimeProps {
    RuntimeName = "test_runtime",
    AgentRuntimeArtifact = agentRuntimeArtifact,
    PlatformVersion = PlatformVersion.V2,
    MinimumMemory = Size.Gibibytes(4)
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
repository := ecr.NewRepository(this, jsii.String("TestRepository"), &RepositoryProps{
	RepositoryName: jsii.String("test-agent-runtime"),
})

agentRuntimeArtifact := agentcore.AgentRuntimeArtifact_FromEcrRepository(repository, jsii.String("v1.0.0"))

agentcore.NewRuntime(this, jsii.String("test-runtime"), &RuntimeProps{
	RuntimeName: jsii.String("test_runtime"),
	AgentRuntimeArtifact: agentRuntimeArtifact,
	PlatformVersion: agentcore.PlatformVersion_V2(),
	MinimumMemory: cdk.Size_Gibibytes(jsii.Number(4)),
})
```

## Properties

- `V1`: [PlatformVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.PlatformVersion.html) (static) — Platform version V1 (the create-time default).

- `V2`: [PlatformVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.PlatformVersion.html) (static) — Platform version V2 (the new AgentCore Runtime — elastic, optimized, consistently fast starts).

- `value`: string — The platform version string value.

## Methods

- `of(value: string): PlatformVersion // chainable` (static) — Use a custom platform version not yet defined in this class.

  **Parameters**

  - `value` — The platform version string value.

- `toString(): string` — Returns the string value.
