package awsecspatterns import ( "github.com/aws/aws-cdk-go/awscdk/v2/awsecs" ) // The properties for the ScheduledEc2Task using an image. // // Example: // // Instantiate an Amazon EC2 Task to run at a scheduled interval // var cluster cluster // // ecsScheduledTask := ecsPatterns.NewScheduledEc2Task(this, jsii.String("ScheduledTask"), &ScheduledEc2TaskProps{ // Cluster: Cluster, // ScheduledEc2TaskImageOptions: &ScheduledEc2TaskImageOptions{ // Image: ecs.ContainerImage_FromRegistry(jsii.String("amazon/amazon-ecs-sample")), // MemoryLimitMiB: jsii.Number(256), // Environment: map[string]*string{ // "name": jsii.String("TRIGGER"), // "value": jsii.String("CloudWatch Events"), // }, // }, // Schedule: appscaling.Schedule_Expression(jsii.String("rate(1 minute)")), // Enabled: jsii.Boolean(true), // RuleName: jsii.String("sample-scheduled-task-rule"), // }) // type ScheduledEc2TaskImageOptions struct { // The image used to start a container. // // Image or taskDefinition must be specified, but not both. Image awsecs.ContainerImage `field:"required" json:"image" yaml:"image"` // The command that is passed to the container. // // If you provide a shell command as a single string, you have to quote command-line arguments. Command *[]*string `field:"optional" json:"command" yaml:"command"` // The environment variables to pass to the container. Environment *map[string]*string `field:"optional" json:"environment" yaml:"environment"` // The log driver to use. LogDriver awsecs.LogDriver `field:"optional" json:"logDriver" yaml:"logDriver"` // The secret to expose to the container as an environment variable. Secrets *map[string]awsecs.Secret `field:"optional" json:"secrets" yaml:"secrets"` // The minimum number of CPU units to reserve for the container. Cpu *float64 `field:"optional" json:"cpu" yaml:"cpu"` // The hard limit (in MiB) of memory to present to the container. // // If your container attempts to exceed the allocated memory, the container // is terminated. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. MemoryLimitMiB *float64 `field:"optional" json:"memoryLimitMiB" yaml:"memoryLimitMiB"` // The soft limit (in MiB) of memory to reserve for the container. // // When system memory is under contention, Docker attempts to keep the // container memory within the limit. If the container requires more memory, // it can consume up to the value specified by the Memory property or all of // the available memory on the container instance—whichever comes first. // // At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services. MemoryReservationMiB *float64 `field:"optional" json:"memoryReservationMiB" yaml:"memoryReservationMiB"` }