Skip to main content

AWS EC2 Instance Running Schedule Stack

GitHub npm (scoped) PyPI Nuget GitHub Workflow Status (branch) GitHub release (latest SemVer)

View on Construct Hub

This is an AWS CDK Construct to make EC2 instance running schedule (only running while working hours(start/stop)).

Fixed

  • EC2 Instance

Resources

This construct creating resource list.

  • EventBridge Scheduler execution role
  • EventBridge Scheduler
  • Step Functions State machine
  • Step Functions State machine role

State Machine Execution Flow

Install

TypeScript

install by npm

npm install @gammarer/aws-ec2-instance-running-schedule-stack

install by yarn

yarn add @gammarer/aws-ec2-instance-running-schedule-stack

Python

pip install gammarer.aws-ec2-instance-running-schedule-stack

C# / .NET

dotnet add package Gammarer.CDK.AWS.Ec2InstanceRunningScheduleStack

Example

import { Ec2InstanceRunningScheduleStack } from '@gammarer/aws-ec2-instance-running-schedule-stack';

new EC2InstanceRunningScheduleStack(app, 'EC2InstanceRunningScheduleStack', {
  targetResource: {
    tagKey: 'WorkHoursRunning',
    tagValues: ['YES'],
  },
  startSchedule: {
    timezone: 'Asia/Tokyo',
    minute: '55',
    hour: '8',
    week: 'MON-FRI',
  },
  stopSchedule: {
    timezone: 'Asia/Tokyo',
    minute: '5',
    hour: '19',
    week: 'MON-FRI',
  },
  notifications: { // OPTIONAL NOTIFICATION
    emails: [  // OPTIONAL SEND EMAIL FROM SNS
      'foo@example.com',
      'bar@example.net',
    ],
  },
});

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for gammarers.aws-ec2-instance-running-schedule-stack 2.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gammarers.aws-ec2-instance-running-schedule-stack 2.4.5
File Size Uploaded
gammarers_aws_ec2_instance_running_schedule_stack-2.4.5.tar.gz 275.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gammarers.aws-ec2-instance-running-schedule-stack 2.4.5
File Interpreter ABI Platform
gammarers_aws_ec2_instance_running_schedule_stack-2.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 549.6 kB

Release files / gammarers_aws_ec2_instance_running_schedule_stack-2.4.5.tar.gz

Download URL gammarers_aws_ec2_instance_running_schedule_stack-2.4.5.tar.gz
Size 275.3 kB
Tags Source
SHA-256 checksum
How to use checksums
946def523928544720cd9539b1bc6f8bbc683edf9105f3ffdb6e9e95381b7b38
BLAKE2b-256 checksum
How to use checksums
931d2463b9d81d7b2730f8861f6d0e2908ca7e05366b523e01b310f1a5910caf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.14.2

Release files / gammarers_aws_ec2_instance_running_schedule_stack-2.4.5-py3-none-any.whl

Download URL gammarers_aws_ec2_instance_running_schedule_stack-2.4.5-py3-none-any.whl
Size 274.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9dfb2676c69daaf4b7bce05ee224ae265964d30cb89a23bd963d2106b4ff9a98
BLAKE2b-256 checksum
How to use checksums
a5fb81c7ab535ab0e983dbf68440c4ffbc9831f1745e263c5dbfed32f6d57c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

2.4.5 This release

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.19

2 release files

2.3.18

2 release files

2.3.17

2 release files

2.3.16

2 release files

2.3.14

2 release files

2.3.13

2 release files

2.3.12

2 release files

2.3.11

2 release files

2.3.10

2 release files

2.3.9

2 release files

2.3.8

2 release files

2.3.7

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.14

2 release files

2.2.13

2 release files

2.2.12

2 release files

2.2.10

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.11

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page