Skip to content

Commit

Permalink
Add license headers
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosafonso committed Aug 30, 2021
1 parent fce9d43 commit 9c3c13f
Show file tree
Hide file tree
Showing 26 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
aws-scheduled-event-adjuster
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 changes: 2 additions & 0 deletions adjust_schedule_function/adjust_schedule/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions adjust_schedule_function/adjust_schedule/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import boto3
from lib.events import EventBus
from lib.processors.autoscaling import AutoScalingGroupProcessor
Expand Down
2 changes: 2 additions & 0 deletions adjust_schedule_function/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# coding: utf-8
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from __future__ import absolute_import

Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/events.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import json

class Event:
Expand Down
2 changes: 2 additions & 0 deletions adjust_schedule_function/lib/processors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/processors/autoscaling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from lib import utils
from lib.processors.base import ResourceProcessor

Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/processors/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

class ResourceProcessor:
def __init__(self, tag_prefix):
self._tag_prefix = tag_prefix
Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/processors/eventbridge.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from lib import utils
from lib.processors.base import ResourceProcessor

Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/recurrence.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from crontab import CronTab
from dateutil import parser
from datetime import datetime, timedelta
Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/services.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import boto3


Expand Down
3 changes: 3 additions & 0 deletions adjust_schedule_function/lib/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

def get_tag_by_key(tags, key):
tags = list(filter(lambda t: t['Key'] == key, tags))
if len(tags):
Expand Down
3 changes: 3 additions & 0 deletions buildspec.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

version: 0.2

env:
Expand Down
3 changes: 3 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import sys, os

sys.path.insert(0, os.path.abspath("adjust_schedule_function"))
2 changes: 2 additions & 0 deletions pipeline.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: '2010-09-09'

Description: >
Expand Down
2 changes: 2 additions & 0 deletions send-event.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

aws events put-events \
--entries '[
Expand Down
2 changes: 2 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
AWSTemplateFormatVersion: '2010-09-09'

Transform: AWS::Serverless-2016-10-31
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions tests/unit/processors/test_autoscaling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from lib.processors.autoscaling import AutoScalingGroupProcessor
from lib.recurrence import RecurrenceCalculator
from lib.services import AutoScalingService
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/processors/test_eventbridge.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from lib.processors.eventbridge import EventBridgeProcessor
from lib.recurrence import RecurrenceCalculator
from lib.services import EventBridgeService
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions tests/unit/services/test_autoscaling.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import boto3
from botocore.stub import Stubber
from datetime import datetime
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/services/test_eventbridge.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import boto3
from botocore.stub import Stubber
from lib.services import EventBridgeService
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_events.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import boto3
from botocore.stub import Stubber
from lib.events import EventBus
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_recurrence.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

from datetime import datetime
import pytest
from lib.recurrence import parse_cron_expression, RecurrenceCalculator, TimeSource
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

import pytest

from lib import utils
Expand Down

0 comments on commit 9c3c13f

Please sign in to comment.