Skip to main content

AWS EC2 Instance Running Scheduler

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file gammarers_aws_ec2_instance_running_schedule_stack-2.2.12.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.2.12.tar.gz
Algorithm Hash digest
SHA256 3828082107aecb915c1584beffecf02ec2b7a2ee6012b3c4a97bc6078b2db8ed
MD5 270957edf4d81711490c9b0ab2bdb800
BLAKE2b-256 77887d180eeba2e86011b9758747652003f6e3293b6c08f1bd2cfac53031d56f

See more details on using hashes here.

File details

Details for the file gammarers_aws_ec2_instance_running_schedule_stack-2.2.12-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a499b516da97eef1b795493ea2f30d32c07083a8c2abf7e5795a7eeb4150aa04
MD5 7b1d0dae1ce3d86e5d9e54d4ac470fdf
BLAKE2b-256 6b70d819e98cffcbb5a39971be34e0c21286ce6709d989db5cb395e35f169734

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page