Skip to content

JohnPreston/troposphere-awscommunity-applicationautoscaling-scheduledaction

Repository files navigation

AwsCommunity::ApplicationAutoscaling::ScheduledAction

Troposphere object for the AwsCommunity::ApplicationAutoscaling::ScheduledAction resource.

See The AWS CFN Community Registry or the original resource here

The resoure properties detail what attributes to assign for the resource

Example

Creates a scheduled action for a dynamodb table

from troposphere import Template
from troposphere_awscommunity_applicationautoscaling_scheduledaction import (
    ScheduledAction,
    ScalableTargetAction,
)


def test_scheduled_action():
    props: dict = {
        "ScheduledActionName": "cfn-testing-resource",
        "ServiceNamespace": "dynamodb",
        "ScalableDimension": "dynamodb:table:ReadCapacityUnits",
        "ScalableTargetAction": ScalableTargetAction(
            **{"MinCapacity": 1, "MaxCapacity": 4}
        ),
        "Schedule": "cron(5 2 ? * FRI)",
        "Timezone": "Europe/London",
        "ResourceId": "table/awscommunityscheduledactiontesttable",
    }
    tpl = Template()
    action = tpl.add_resource(ScheduledAction("MyAction", **props))
    print(tpl.to_yaml())

Renders, with the template, the following

Resources:
  MyAction:
    Properties:
      ResourceId: table/awscommunityscheduledactiontesttable
      ScalableDimension: dynamodb:table:ReadCapacityUnits
      ScalableTargetAction:
        MaxCapacity: 4
        MinCapacity: 1
      Schedule: cron(5 2 ? * FRI)
      ScheduledActionName: cfn-testing-resource
      ServiceNamespace: dynamodb
      Timezone: Europe/London
    Type: AwsCommunity::ApplicationAutoscaling::ScheduledAction

About

Troposphere resource to manage AwsCommunity::ApplicationAutoscaling::ScheduledAction

Resources

License

Stars

Watchers

Forks

Packages

No packages published