# AWS EC2 Instance Running Schedule Stack
[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-ec2-instance-running-schedule-stack)
[](https://pypi.org/project/gammarers.aws-ec2-instance-running-schedule-stack/)
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.EC2InstanceRunningScheduleStack/)
[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/releases)
[](https://constructs.dev/packages/@gammarers/aws-ec2-instance-running-schedule-stack)
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
```shell
npm install @gammarer/aws-ec2-instance-running-schedule-stack
```
#### install by yarn
```shell
yarn add @gammarer/aws-ec2-instance-running-schedule-stack
```
### Python
```shell
pip install gammarer.aws-ec2-instance-running-schedule-stack
```
### C# / .NET
```shell
dotnet add package Gammarer.CDK.AWS.Ec2InstanceRunningScheduleStack
```
## Example
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/gammarers/aws-ec2-instance-running-schedule-stack.git",
"name": "gammarers.aws-ec2-instance-running-schedule-stack",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.9",
"maintainer_email": null,
"keywords": null,
"author": "yicr<yicr@users.noreply.github.com>",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a5/d5/5dbb97eb60ce4280a6aba4063f0c999786fe006cd33574b26c3b5c97dc92/gammarers_aws_ec2_instance_running_schedule_stack-2.3.9.tar.gz",
"platform": null,
"description": "# AWS EC2 Instance Running Schedule Stack\n\n[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/blob/main/LICENSE)\n[](https://www.npmjs.com/package/@gammarers/aws-ec2-instance-running-schedule-stack)\n[](https://pypi.org/project/gammarers.aws-ec2-instance-running-schedule-stack/)\n[](https://www.nuget.org/packages/Gammarers.CDK.AWS.EC2InstanceRunningScheduleStack/)\n[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/actions/workflows/release.yml)\n[](https://github.com/gammarers/aws-ec2-instance-running-schedule-stack/releases)\n\n[](https://constructs.dev/packages/@gammarers/aws-ec2-instance-running-schedule-stack)\n\nThis is an AWS CDK Construct to make EC2 instance running schedule (only running while working hours(start/stop)).\n\n## Fixed\n\n* EC2 Instance\n\n## Resources\n\nThis construct creating resource list.\n\n* EventBridge Scheduler execution role\n* EventBridge Scheduler\n* Step Functions State machine\n* Step Functions State machine role\n\n## State Machine Execution Flow\n\n\n\n## Install\n\n### TypeScript\n\n#### install by npm\n\n```shell\nnpm install @gammarer/aws-ec2-instance-running-schedule-stack\n```\n\n#### install by yarn\n\n```shell\nyarn add @gammarer/aws-ec2-instance-running-schedule-stack\n```\n\n### Python\n\n```shell\npip install gammarer.aws-ec2-instance-running-schedule-stack\n```\n\n### C# / .NET\n\n```shell\ndotnet add package Gammarer.CDK.AWS.Ec2InstanceRunningScheduleStack\n```\n\n## Example\n\n```python\nimport { Ec2InstanceRunningScheduleStack } from '@gammarer/aws-ec2-instance-running-schedule-stack';\n\nnew EC2InstanceRunningScheduleStack(app, 'EC2InstanceRunningScheduleStack', {\n targetResource: {\n tagKey: 'WorkHoursRunning',\n tagValues: ['YES'],\n },\n startSchedule: {\n timezone: 'Asia/Tokyo',\n minute: '55',\n hour: '8',\n week: 'MON-FRI',\n },\n stopSchedule: {\n timezone: 'Asia/Tokyo',\n minute: '5',\n hour: '19',\n week: 'MON-FRI',\n },\n notifications: { // OPTIONAL NOTIFICATION\n emails: [ // OPTIONAL SEND EMAIL FROM SNS\n 'foo@example.com',\n 'bar@example.net',\n ],\n },\n});\n```\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "AWS EC2 Instance Running Scheduler",
"version": "2.3.9",
"project_urls": {
"Homepage": "https://github.com/gammarers/aws-ec2-instance-running-schedule-stack.git",
"Source": "https://github.com/gammarers/aws-ec2-instance-running-schedule-stack.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6040ffe5d1a2c333c48be3555cd92a0289772a290186e757bb99b9a23b2b3f4f",
"md5": "d9dd3fc1ebcf32c15f714c5c0059bbb9",
"sha256": "ef7661e9fe8199956db3a013b4f2ce37412db1ab1336bf30426523458c8a41e9"
},
"downloads": -1,
"filename": "gammarers_aws_ec2_instance_running_schedule_stack-2.3.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d9dd3fc1ebcf32c15f714c5c0059bbb9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.9",
"size": 272521,
"upload_time": "2025-09-03T16:41:55",
"upload_time_iso_8601": "2025-09-03T16:41:55.504669Z",
"url": "https://files.pythonhosted.org/packages/60/40/ffe5d1a2c333c48be3555cd92a0289772a290186e757bb99b9a23b2b3f4f/gammarers_aws_ec2_instance_running_schedule_stack-2.3.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a5d55dbb97eb60ce4280a6aba4063f0c999786fe006cd33574b26c3b5c97dc92",
"md5": "6111e9ef112c2440703b59518f59af4b",
"sha256": "450babb1984012555c9d0423651ed7ae8c6eff06cc5fa9b058b4d9749e968299"
},
"downloads": -1,
"filename": "gammarers_aws_ec2_instance_running_schedule_stack-2.3.9.tar.gz",
"has_sig": false,
"md5_digest": "6111e9ef112c2440703b59518f59af4b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.9",
"size": 273434,
"upload_time": "2025-09-03T16:41:56",
"upload_time_iso_8601": "2025-09-03T16:41:56.582272Z",
"url": "https://files.pythonhosted.org/packages/a5/d5/5dbb97eb60ce4280a6aba4063f0c999786fe006cd33574b26c3b5c97dc92/gammarers_aws_ec2_instance_running_schedule_stack-2.3.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-03 16:41:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gammarers",
"github_project": "aws-ec2-instance-running-schedule-stack",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gammarers.aws-ec2-instance-running-schedule-stack"
}