Skip to content
v2.277.0

ScheduledTaskImageProps Struct ​

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,
  },
};
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
from aws_cdk import aws_ecs_patterns as ecs_patterns

# container_image: ecs.ContainerImage
# log_driver: ecs.LogDriver
# secret: ecs.Secret

scheduled_task_image_props = ecs_patterns.ScheduledTaskImageProps(
    image=container_image,

    # the properties below are optional
    command=["command"],
    container_name="containerName",
    environment={
        "environment_key": "environment"
    },
    log_driver=log_driver,
    secrets={
        "secrets_key": secret
    }
)
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.*;
import software.amazon.awscdk.services.ecs.patterns.*;

ContainerImage containerImage;
LogDriver logDriver;
Secret secret;

ScheduledTaskImageProps scheduledTaskImageProps = ScheduledTaskImageProps.builder()
        .image(containerImage)

        // the properties below are optional
        .command(List.of("command"))
        .containerName("containerName")
        .environment(Map.of(
                "environmentKey", "environment"))
        .logDriver(logDriver)
        .secrets(Map.of(
                "secretsKey", secret))
        .build();
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;
using Amazon.CDK.AWS.ECS.Patterns;

ContainerImage containerImage;
LogDriver logDriver;
Secret secret;

var scheduledTaskImageProps = new ScheduledTaskImageProps {
    Image = containerImage,

    // the properties below are optional
    Command = new [] { "command" },
    ContainerName = "containerName",
    Environment = new Dictionary<string, string> {
        { "environmentKey", "environment" }
    },
    LogDriver = logDriver,
    Secrets = new Dictionary<string, Secret> {
        { "secretsKey", secret }
    }
};
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"
import "github.com/aws/aws-cdk-go/awscdk"

var containerImage ContainerImage
var logDriver LogDriver
var secret Secret

scheduledTaskImageProps := &ScheduledTaskImageProps{
	Image: containerImage,

	// the properties below are optional
	Command: []*string{
		jsii.String("command"),
	},
	ContainerName: jsii.String("containerName"),
	Environment: map[string]*string{
		"environmentKey": jsii.String("environment"),
	},
	LogDriver: logDriver,
	Secrets: map[string]Secret{
		"secretsKey": secret,
	},
}

Properties ​

commandoptionalstring[]commandoptionaltyping.List[str]commandoptionalList<String>Commandoptionalstring[]Commandoptional*[]*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.

containerNameoptionalstringcontainer_nameoptionalstrcontainerNameoptionalStringContainerNameoptionalstringContainerNameoptional*string= ScheduledContainer#
Optional name for the container added.
environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string= none#
The environment variables to pass to the container.
The image used to start a container.

Image or taskDefinition must be specified, but not both.

logDriveroptionalLogDriverlog_driveroptionalLogDriverlogDriveroptionalLogDriverLogDriveroptionalLogDriverLogDriveroptionalLogDriver#
The log driver to use.

Default: AwsLogDriver if enableLogging is true

secretsoptional{ [key: string]: Secret }secretsoptionaltyping.Mapping[str, Secret]secretsoptionalMap<String, Secret>SecretsoptionalIDictionary<string, Secret>Secretsoptional*map[string]Secret#
The secret to expose to the container as an environment variable.

Default: No secret environment variables.