ScheduledAction

Provides an Application AutoScaling ScheduledAction resource.

Example Usage

DynamoDB Table Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var dynamodbTarget = new Aws.AppAutoScaling.Target("dynamodbTarget", new Aws.AppAutoScaling.TargetArgs
        {
            MaxCapacity = 100,
            MinCapacity = 5,
            ResourceId = "table/tableName",
            ScalableDimension = "dynamodb:table:ReadCapacityUnits",
            ServiceNamespace = "dynamodb",
        });
        var dynamodbScheduledAction = new Aws.AppAutoScaling.ScheduledAction("dynamodbScheduledAction", new Aws.AppAutoScaling.ScheduledActionArgs
        {
            ResourceId = dynamodbTarget.ResourceId,
            ScalableDimension = dynamodbTarget.ScalableDimension,
            ScalableTargetAction = new Aws.AppAutoScaling.Inputs.ScheduledActionScalableTargetActionArgs
            {
                MaxCapacity = 200,
                MinCapacity = 1,
            },
            Schedule = "at(2006-01-02T15:04:05)",
            ServiceNamespace = dynamodbTarget.ServiceNamespace,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appautoscaling"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        dynamodbTarget, err := appautoscaling.NewTarget(ctx, "dynamodbTarget", &appautoscaling.TargetArgs{
            MaxCapacity:       pulumi.Int(100),
            MinCapacity:       pulumi.Int(5),
            ResourceId:        pulumi.String("table/tableName"),
            ScalableDimension: pulumi.String("dynamodb:table:ReadCapacityUnits"),
            ServiceNamespace:  pulumi.String("dynamodb"),
        })
        if err != nil {
            return err
        }
        _, err = appautoscaling.NewScheduledAction(ctx, "dynamodbScheduledAction", &appautoscaling.ScheduledActionArgs{
            ResourceId:        dynamodbTarget.ResourceId,
            ScalableDimension: dynamodbTarget.ScalableDimension,
            ScalableTargetAction: &appautoscaling.ScheduledActionScalableTargetActionArgs{
                MaxCapacity: pulumi.Int(200),
                MinCapacity: pulumi.Int(1),
            },
            Schedule:         pulumi.String("at(2006-01-02T15:04:05)"),
            ServiceNamespace: dynamodbTarget.ServiceNamespace,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

dynamodb_target = aws.appautoscaling.Target("dynamodbTarget",
    max_capacity=100,
    min_capacity=5,
    resource_id="table/tableName",
    scalable_dimension="dynamodb:table:ReadCapacityUnits",
    service_namespace="dynamodb")
dynamodb_scheduled_action = aws.appautoscaling.ScheduledAction("dynamodbScheduledAction",
    resource_id=dynamodb_target.resource_id,
    scalable_dimension=dynamodb_target.scalable_dimension,
    scalable_target_action={
        "max_capacity": 200,
        "min_capacity": 1,
    },
    schedule="at(2006-01-02T15:04:05)",
    service_namespace=dynamodb_target.service_namespace)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dynamodbTarget = new aws.appautoscaling.Target("dynamodb", {
    maxCapacity: 100,
    minCapacity: 5,
    resourceId: "table/tableName",
    scalableDimension: "dynamodb:table:ReadCapacityUnits",
    serviceNamespace: "dynamodb",
});
const dynamodbScheduledAction = new aws.appautoscaling.ScheduledAction("dynamodb", {
    resourceId: dynamodbTarget.resourceId,
    scalableDimension: dynamodbTarget.scalableDimension,
    scalableTargetAction: {
        maxCapacity: 200,
        minCapacity: 1,
    },
    schedule: "at(2006-01-02T15:04:05)",
    serviceNamespace: dynamodbTarget.serviceNamespace,
});

ECS Service Autoscaling

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var ecsTarget = new Aws.AppAutoScaling.Target("ecsTarget", new Aws.AppAutoScaling.TargetArgs
        {
            MaxCapacity = 4,
            MinCapacity = 1,
            ResourceId = "service/clusterName/serviceName",
            ScalableDimension = "ecs:service:DesiredCount",
            ServiceNamespace = "ecs",
        });
        var ecsScheduledAction = new Aws.AppAutoScaling.ScheduledAction("ecsScheduledAction", new Aws.AppAutoScaling.ScheduledActionArgs
        {
            ResourceId = ecsTarget.ResourceId,
            ScalableDimension = ecsTarget.ScalableDimension,
            ScalableTargetAction = new Aws.AppAutoScaling.Inputs.ScheduledActionScalableTargetActionArgs
            {
                MaxCapacity = 10,
                MinCapacity = 1,
            },
            Schedule = "at(2006-01-02T15:04:05)",
            ServiceNamespace = ecsTarget.ServiceNamespace,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/appautoscaling"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        ecsTarget, err := appautoscaling.NewTarget(ctx, "ecsTarget", &appautoscaling.TargetArgs{
            MaxCapacity:       pulumi.Int(4),
            MinCapacity:       pulumi.Int(1),
            ResourceId:        pulumi.String("service/clusterName/serviceName"),
            ScalableDimension: pulumi.String("ecs:service:DesiredCount"),
            ServiceNamespace:  pulumi.String("ecs"),
        })
        if err != nil {
            return err
        }
        _, err = appautoscaling.NewScheduledAction(ctx, "ecsScheduledAction", &appautoscaling.ScheduledActionArgs{
            ResourceId:        ecsTarget.ResourceId,
            ScalableDimension: ecsTarget.ScalableDimension,
            ScalableTargetAction: &appautoscaling.ScheduledActionScalableTargetActionArgs{
                MaxCapacity: pulumi.Int(10),
                MinCapacity: pulumi.Int(1),
            },
            Schedule:         pulumi.String("at(2006-01-02T15:04:05)"),
            ServiceNamespace: ecsTarget.ServiceNamespace,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

ecs_target = aws.appautoscaling.Target("ecsTarget",
    max_capacity=4,
    min_capacity=1,
    resource_id="service/clusterName/serviceName",
    scalable_dimension="ecs:service:DesiredCount",
    service_namespace="ecs")
ecs_scheduled_action = aws.appautoscaling.ScheduledAction("ecsScheduledAction",
    resource_id=ecs_target.resource_id,
    scalable_dimension=ecs_target.scalable_dimension,
    scalable_target_action={
        "max_capacity": 10,
        "min_capacity": 1,
    },
    schedule="at(2006-01-02T15:04:05)",
    service_namespace=ecs_target.service_namespace)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ecsTarget = new aws.appautoscaling.Target("ecs", {
    maxCapacity: 4,
    minCapacity: 1,
    resourceId: "service/clusterName/serviceName",
    scalableDimension: "ecs:service:DesiredCount",
    serviceNamespace: "ecs",
});
const ecsScheduledAction = new aws.appautoscaling.ScheduledAction("ecs", {
    resourceId: ecsTarget.resourceId,
    scalableDimension: ecsTarget.scalableDimension,
    scalableTargetAction: {
        maxCapacity: 10,
        minCapacity: 1,
    },
    schedule: "at(2006-01-02T15:04:05)",
    serviceNamespace: ecsTarget.serviceNamespace,
});

Create a ScheduledAction Resource

def ScheduledAction(resource_name, opts=None, end_time=None, name=None, resource_id=None, scalable_dimension=None, scalable_target_action=None, schedule=None, service_namespace=None, start_time=None, __props__=None);
name string
The unique name of the resource.
args ScheduledActionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ScheduledActionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ScheduledActionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ScheduledAction Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ScheduledAction resource accepts the following input properties:

ResourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

EndTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

Name string

The name of the scheduled action.

ScalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

ScalableTargetAction ScheduledActionScalableTargetActionArgs

The new minimum and maximum capacity. You can set both values or just one. See below

Schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

StartTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

ResourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

EndTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

Name string

The name of the scheduled action.

ScalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

ScalableTargetAction ScheduledActionScalableTargetAction

The new minimum and maximum capacity. You can set both values or just one. See below

Schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

StartTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

resourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

serviceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

endTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

name string

The name of the scheduled action.

scalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

scalableTargetAction ScheduledActionScalableTargetAction

The new minimum and maximum capacity. You can set both values or just one. See below

schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

startTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

resource_id str

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

service_namespace str

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

end_time str

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

name str

The name of the scheduled action.

scalable_dimension str

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

scalable_target_action Dict[ScheduledActionScalableTargetAction]

The new minimum and maximum capacity. You can set both values or just one. See below

schedule str

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

start_time str

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

Outputs

All input properties are implicitly available as output properties. Additionally, the ScheduledAction resource produces the following output properties:

Arn string

The Amazon Resource Name (ARN) of the scheduled action.

Id string
The provider-assigned unique ID for this managed resource.
Arn string

The Amazon Resource Name (ARN) of the scheduled action.

Id string
The provider-assigned unique ID for this managed resource.
arn string

The Amazon Resource Name (ARN) of the scheduled action.

id string
The provider-assigned unique ID for this managed resource.
arn str

The Amazon Resource Name (ARN) of the scheduled action.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ScheduledAction Resource

Get an existing ScheduledAction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ScheduledActionState, opts?: CustomResourceOptions): ScheduledAction
static get(resource_name, id, opts=None, arn=None, end_time=None, name=None, resource_id=None, scalable_dimension=None, scalable_target_action=None, schedule=None, service_namespace=None, start_time=None, __props__=None);
func GetScheduledAction(ctx *Context, name string, id IDInput, state *ScheduledActionState, opts ...ResourceOption) (*ScheduledAction, error)
public static ScheduledAction Get(string name, Input<string> id, ScheduledActionState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

The Amazon Resource Name (ARN) of the scheduled action.

EndTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

Name string

The name of the scheduled action.

ResourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

ScalableTargetAction ScheduledActionScalableTargetActionArgs

The new minimum and maximum capacity. You can set both values or just one. See below

Schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

StartTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

Arn string

The Amazon Resource Name (ARN) of the scheduled action.

EndTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

Name string

The name of the scheduled action.

ResourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ScalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

ScalableTargetAction ScheduledActionScalableTargetAction

The new minimum and maximum capacity. You can set both values or just one. See below

Schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

ServiceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

StartTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

arn string

The Amazon Resource Name (ARN) of the scheduled action.

endTime string

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

name string

The name of the scheduled action.

resourceId string

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

scalableDimension string

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

scalableTargetAction ScheduledActionScalableTargetAction

The new minimum and maximum capacity. You can set both values or just one. See below

schedule string

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

serviceNamespace string

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

startTime string

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

arn str

The Amazon Resource Name (ARN) of the scheduled action.

end_time str

The date and time for the scheduled action to end. Specify the following format: 2006-01-02T15:04:05Z

name str

The name of the scheduled action.

resource_id str

The identifier of the resource associated with the scheduled action. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

scalable_dimension str

The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount

scalable_target_action Dict[ScheduledActionScalableTargetAction]

The new minimum and maximum capacity. You can set both values or just one. See below

schedule str

The schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). In UTC. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference

service_namespace str

The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs

start_time str

The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z

Supporting Types

ScheduledActionScalableTargetAction

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

MaxCapacity int

The maximum capacity.

MinCapacity int

The minimum capacity.

MaxCapacity int

The maximum capacity.

MinCapacity int

The minimum capacity.

maxCapacity number

The maximum capacity.

minCapacity number

The minimum capacity.

max_capacity float

The maximum capacity.

min_capacity float

The minimum capacity.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.