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.5.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.3.5.tar.gz
Algorithm Hash digest
SHA256 9cde5ba0537051900df1e1089a2b5ca12679042e142ed76ed8cbfcc3782a7af0
MD5 df8aced6bc078f594090b320f3273c3c
BLAKE2b-256 fd23962b259cf3d46eec62f5ca2efcd2ceec4f3083a42b106c55141306a89e8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_ec2_instance_running_schedule_stack-2.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5fefd7480a330d07db7a1c883807ede0dc6b445a4cd63b1db18b8838f2e54288
MD5 5c0e64a4c1c27e98838c36e46c279ab2
BLAKE2b-256 0cd51304ef6901151237d573e9d67e6f8f7e8f45a5d2ab79a11a6a0fb9d7d82b

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