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
new ScheduledAction(name: string, args: ScheduledActionArgs, opts?: CustomResourceOptions);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);func NewScheduledAction(ctx *Context, name string, args ScheduledActionArgs, opts ...ResourceOption) (*ScheduledAction, error)public ScheduledAction(string name, ScheduledActionArgs args, CustomResourceOptions? opts = null)- 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:
- Resource
Id 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
- Service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- End
Time 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.
- Scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- Scalable
Target ScheduledAction Action Scalable Target Action Args 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
- Start
Time string The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z
- Resource
Id 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
- Service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- End
Time 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.
- Scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- Scalable
Target ScheduledAction Action Scalable Target Action 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
- Start
Time string The date and time for the scheduled action to start. Specify the following format: 2006-01-02T15:04:05Z
- resource
Id 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
- service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- end
Time 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.
- scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- scalable
Target ScheduledAction Action Scalable Target Action 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
- start
Time 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_ Dict[Scheduledaction Action Scalable Target Action] 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:
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): ScheduledActionstatic 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.
- End
Time 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.
- Resource
Id 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
- Scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- Scalable
Target ScheduledAction Action Scalable Target Action Args 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
- Service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- Start
Time 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.
- End
Time 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.
- Resource
Id 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
- Scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- Scalable
Target ScheduledAction Action Scalable Target Action 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
- Service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- Start
Time 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.
- end
Time 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.
- resource
Id 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
- scalable
Dimension string The scalable dimension. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
- scalable
Target ScheduledAction Action Scalable Target Action 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
- service
Namespace string The namespace of the AWS service. Documentation can be found in the parameter at: AWS Application Auto Scaling API Reference Example: ecs
- start
Time 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_ Dict[Scheduledaction Action Scalable Target Action] 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
- Max
Capacity int The maximum capacity.
- Min
Capacity int The minimum capacity.
- Max
Capacity int The maximum capacity.
- Min
Capacity int The minimum capacity.
- max
Capacity number The maximum capacity.
- min
Capacity 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
awsTerraform Provider.