forked from aws-samples/aws-scheduled-event-adjuster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea84570
commit 244abfe
Showing
10 changed files
with
165 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ samconfig.toml | |
.aws-sam | ||
|
||
# Other ignores | ||
envs.json | ||
hello_world_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
class ResourceProcessor: | ||
# The tag that determines whether the resource should be processed. | ||
ENABLED_TAG = 'scheduled-event-adjuster:enabled' | ||
def __init__(self, tag_prefix): | ||
self._tag_prefix = tag_prefix | ||
|
||
# The tag that determines the timezone of the local time. | ||
LOCAL_TIMEZONE_TAG = 'scheduled-event-adjuster:local-timezone' | ||
def _get_enabled_tag(self): | ||
"""Returns the tag that, when present, determines whether a resource | ||
must be processed. | ||
""" | ||
return '%s:%s' % (self._tag_prefix, 'enabled') | ||
|
||
# The tag that determines the local time at which the scheduled event is | ||
# expected to run. | ||
LOCAL_TIME_TAG = 'scheduled-event-adjuster:local-time' | ||
def _get_local_timezone_tag(self): | ||
"""Returns the tag that specifies the timezone of the local time. | ||
""" | ||
return '%s:%s' % (self._tag_prefix, 'local-timezone') | ||
|
||
def _get_local_time_tag(self): | ||
"""Returns the tag that specifies the local time at which scheduled | ||
events must run. | ||
""" | ||
return '%s:%s' % (self._tag_prefix, 'local-time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"AdjustScheduleFunction": { | ||
"TAG_PREFIX": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.