# FargatePlatformVersion

The platform version on which to run your service.

- Source: [`aws-ecs/lib/fargate/fargate-service.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ecs/lib/fargate/fargate-service.ts#L258)

## Example

TypeScript:

```ts
declare const cluster: ecs.Cluster;
const scheduledFargateTask = new ecsPatterns.ScheduledFargateTask(this, 'ScheduledFargateTask', {
  cluster,
  scheduledFargateTaskImageOptions: {
    image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
    containerName: 'customContainerName',
    memoryLimitMiB: 512,
  },
  schedule: appscaling.Schedule.expression('rate(1 minute)'),
  platformVersion: ecs.FargatePlatformVersion.LATEST,
});
```

Python:

```python
# cluster: ecs.Cluster

scheduled_fargate_task = ecs_patterns.ScheduledFargateTask(self, "ScheduledFargateTask",
    cluster=cluster,
    scheduled_fargate_task_image_options=ecsPatterns.ScheduledFargateTaskImageOptions(
        image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
        container_name="customContainerName",
        memory_limit_mi_b=512
    ),
    schedule=appscaling.Schedule.expression("rate(1 minute)"),
    platform_version=ecs.FargatePlatformVersion.LATEST
)
```

Java:

```java
Cluster cluster;

ScheduledFargateTask scheduledFargateTask = ScheduledFargateTask.Builder.create(this, "ScheduledFargateTask")
        .cluster(cluster)
        .scheduledFargateTaskImageOptions(ScheduledFargateTaskImageOptions.builder()
                .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                .containerName("customContainerName")
                .memoryLimitMiB(512)
                .build())
        .schedule(Schedule.expression("rate(1 minute)"))
        .platformVersion(FargatePlatformVersion.LATEST)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Cluster cluster;

var scheduledFargateTask = new ScheduledFargateTask(this, "ScheduledFargateTask", new ScheduledFargateTaskProps {
    Cluster = cluster,
    ScheduledFargateTaskImageOptions = new ScheduledFargateTaskImageOptions {
        Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
        ContainerName = "customContainerName",
        MemoryLimitMiB = 512
    },
    Schedule = Schedule.Expression("rate(1 minute)"),
    PlatformVersion = FargatePlatformVersion.LATEST
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var cluster Cluster

scheduledFargateTask := ecsPatterns.NewScheduledFargateTask(this, jsii.String("ScheduledFargateTask"), &ScheduledFargateTaskProps{
	Cluster: Cluster,
	ScheduledFargateTaskImageOptions: &ScheduledFargateTaskImageOptions{
		Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")),
		ContainerName: jsii.String("customContainerName"),
		MemoryLimitMiB: jsii.Number(512),
	},
	Schedule: appscaling.Schedule_Expression(jsii.String("rate(1 minute)")),
	PlatformVersion: ecs.FargatePlatformVersion_LATEST,
})
```

## Members

| Member | Description |
| --- | --- |
| `LATEST` | The latest, recommended platform version. |
| `VERSION1_4` | Version 1.4.0. |
| `VERSION1_3` | Version 1.3.0. |
| `VERSION1_2` | Version 1.2.0. |
| `VERSION1_1` | Version 1.1.0. |
| `VERSION1_0` | Initial release. |

## Referenced by

- [`EcsFargateContainerDefinition`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EcsFargateContainerDefinition.html).fargatePlatformVersion
- [`EcsFargateContainerDefinitionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.EcsFargateContainerDefinitionProps.html).fargatePlatformVersion
- [`EcsFargateLaunchTargetOptions`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.EcsFargateLaunchTargetOptions.html).platformVersion
- [`EcsTaskProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.EcsTaskProps.html).platformVersion
- [`FargateServiceBaseProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs_patterns.FargateServiceBaseProps.html).platformVersion
- [`FargateServiceProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.FargateServiceProps.html).platformVersion
- [`FargateTaskProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_scheduler_targets.FargateTaskProps.html).platformVersion
- [`IEcsFargateContainerDefinition`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_batch.IEcsFargateContainerDefinition.html).fargatePlatformVersion
