Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_packer_janitor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
steamhaus
tf_mod_packer_janitor
Commits
d7e6e386
Commit
d7e6e386
authored
Feb 07, 2017
by
A-Gordon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduced invoke rate to 5 mins and Instance timeout to 50, will help keep instances under 1 hour
parent
8565b064
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
2 deletions
+2
-2
main.tf
main.tf
+1
-1
packer_janitor.py
packer_janitor.py
+1
-1
packer_janitor.zip
packer_janitor.zip
+0
-0
No files found.
main.tf
View file @
d7e6e386
variable
"cloudwatch_schedule"
{
description
=
"Schedule for cloudwatch event to invoke Lambda function"
default
=
"rate(
2 hour
s)"
default
=
"rate(
5 minute
s)"
}
resource
"aws_iam_role"
"packer_janitor"
{
...
...
packer_janitor.py
View file @
d7e6e386
...
...
@@ -53,7 +53,7 @@ def lambda_handler (event, context):
logger
.
info
(
'[
%
s]: Runtime:
%
s days'
,
instance
.
id
,
runtime_days
)
logger
.
info
(
'[
%
s]: Runtime:
%
s mins'
,
instance
.
id
,
runtime_minutes
)
if
(
runtime_days
>=
1
)
or
(
runtime_minutes
>=
12
0
):
if
(
runtime_days
>=
1
)
or
(
runtime_minutes
>=
5
0
):
logger
.
info
(
'[
%
s]: Instance has been running for
%
s days and
%
s mins. Marking for termination'
,
instance
.
id
,
runtime
.
days
,
runtime_minutes
)
instance
.
terminate
(
DryRun
=
DRYRUN
)
...
...
packer_janitor.zip
View file @
d7e6e386
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment