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

If you're not sure about the file name format, learn more about wheel file names.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.3.15.tar.gz
Algorithm Hash digest
SHA256 073d20d669e16a828f9ed3ceff3fdd4e29253c3ee4ad460e9f098089dc65afb5
MD5 4b7c5094ff75db60e3e815357b169213
BLAKE2b-256 d8f2fe1e0b6b66c8414234b91138de09b75ca71d6f3edef3e935e8d9ebf16414

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.3.15-py3-none-any.whl
Algorithm Hash digest
SHA256 74515bf7439863a7393c5585f67bd4150112c1e220a2b32e9cc693391f68d2b6
MD5 882d6c5f7a1f4e68eca47dbab980ff9e
BLAKE2b-256 9f7e74112a0cc0bbeb7041470b0119af45ea3a4365581d48c6d9f217a89014f6

See more details on using hashes here.

Supported by

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