# ScheduledTaskImageProps

- Source: [`aws-ecs-patterns/lib/base/scheduled-task-base.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs-patterns/lib/base/scheduled-task-base.ts#L94)
- Type last changed: v2.144.0 · 31 May 2024

## 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';
import { aws_ecs_patterns as ecs_patterns } from 'aws-cdk-lib';

declare const containerImage: ecs.ContainerImage;
declare const logDriver: ecs.LogDriver;
declare const secret: ecs.Secret;
const scheduledTaskImageProps: ecs_patterns.ScheduledTaskImageProps = {
  image: containerImage,

  // the properties below are optional
  command: ['command'],
  containerName: 'containerName',
  environment: {
    environmentKey: 'environment',
  },
  logDriver: logDriver,
  secrets: {
    secretsKey: secret,
  },
};
```

## Properties

- `command`: string[] — The command that is passed to the container.

  **Default:** CMD value built into container image.

  If you provide a shell command as a single string, you have to quote command-line arguments.

- `containerName`: string = ScheduledContainer — Optional name for the container added.

- `environment`: { [key: string]: string } = none — The environment variables to pass to the container.

- `image`: [ContainerImage](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ContainerImage.html) (required) = none — The image used to start a container.

  Image or taskDefinition must be specified, but not both.

- `logDriver`: [LogDriver](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.LogDriver.html) — The log driver to use.

  **Default:** AwsLogDriver if enableLogging is true

- `secrets`: { [key: string]: [Secret](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.Secret.html) } — The secret to expose to the container as an environment variable.

  **Default:** No secret environment variables.
