File tree 7 files changed +16
-29
lines changed
7 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,12 @@ module "start_ec2_instance" {
70
70
| kms_key_arn | The ARN for the KMS encryption key. If this configuration is not provided when environment variables are in use, AWS Lambda uses a default service key | string | null | no |
71
71
| aws_regions | A list of one or more aws regions where the lambda will be apply, default use the current region | list | null | no |
72
72
| cloudwatch_schedule_expression | The scheduling expression | string | ` "cron(0 22 ? * MON-FRI *)" ` | yes |
73
+ | schedule_action | Define schedule action to apply on resources | string | ` "stop" ` | yes |
74
+ | resources_tag | Set the tag use for identify resources to stop or start | map | { tostop = "true" } | yes |
73
75
| autoscaling_schedule | Enable scheduling on autoscaling resources | string | ` "false" ` | no |
74
76
| ec2_schedule | Enable scheduling on ec2 instance resources | string | ` "false" ` | no |
75
77
| rds_schedule | Enable scheduling on rds resources | string | ` "false" ` | no |
76
78
| cloudwatch_alarm_schedule | Enable scheduleding on cloudwatch alarm resources | string | ` "false" ` | no |
77
- | schedule_action | Define schedule action to apply on resources | string | ` "stop" ` | yes |
78
- | scheduler_tag | Set the tag to use for identify aws resources to stop or start | map | {"key" = "tostop", "value" = "true"} | yes |
79
79
80
80
## Outputs
81
81
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ module "autoscaling-stop-friday" {
98
98
autoscaling_schedule = " true"
99
99
cloudwatch_alarm_schedule = " true"
100
100
101
- scheduler_tag = {
101
+ resources_tag = {
102
102
key = " tostop"
103
103
value = " true"
104
104
}
@@ -114,7 +114,7 @@ module "autoscaling-start-monday" {
114
114
autoscaling_schedule = " true"
115
115
cloudwatch_alarm_schedule = " true"
116
116
117
- scheduler_tag = {
117
+ resources_tag = {
118
118
key = " tostop"
119
119
value = " true"
120
120
}
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ module "ec2-stop-friday" {
47
47
autoscaling_schedule = " false"
48
48
cloudwatch_alarm_schedule = " true"
49
49
50
- scheduler_tag = {
50
+ resources_tag = {
51
51
key = " tostop"
52
52
value = " true"
53
53
}
@@ -63,7 +63,7 @@ module "ec2-start-monday" {
63
63
autoscaling_schedule = " false"
64
64
cloudwatch_alarm_schedule = " true"
65
65
66
- scheduler_tag = {
66
+ resources_tag = {
67
67
key = " tostop"
68
68
value = " true"
69
69
}
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ module "rds-stop-friday" {
104
104
autoscaling_schedule = " false"
105
105
cloudwatch_alarm_schedule = " true"
106
106
107
- scheduler_tag = {
107
+ resources_tag = {
108
108
key = " tostop"
109
109
value = " true"
110
110
}
@@ -120,7 +120,7 @@ module "rds-start-monday" {
120
120
autoscaling_schedule = " false"
121
121
cloudwatch_alarm_schedule = " true"
122
122
123
- scheduler_tag = {
123
+ resources_tag = {
124
124
key = " tostop"
125
125
value = " true"
126
126
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ module "aws-stop-friday" {
15
15
ec2_schedule = " true"
16
16
rds_schedule = " true"
17
17
18
- scheduler_tag = {
18
+ resources_tag = {
19
19
key = " tostop"
20
20
value = " true"
21
21
}
@@ -30,7 +30,7 @@ module "aws-start-monday" {
30
30
ec2_schedule = " true"
31
31
rds_schedule = " true"
32
32
33
- scheduler_tag = {
33
+ resources_tag = {
34
34
key = " tostop"
35
35
value = " true"
36
36
}
Original file line number Diff line number Diff line change @@ -210,8 +210,6 @@ locals {
210
210
}
211
211
]
212
212
}
213
- # Backwared compatibility with the former terraform variable name.
214
- scheduler_tag = var. scheduler_tag == { " key" = " tostop" , " value" = " true" } ? var. resources_tag : var. scheduler_tag
215
213
}
216
214
217
215
# ###############################################
@@ -224,7 +222,7 @@ locals {
224
222
data "archive_file" "this" {
225
223
type = " zip"
226
224
source_dir = " ${ path . module } /package/"
227
- output_path = " ${ path . module } /aws-stop-start-resources-3.1.1 .zip" # The version should match with the latest git tag
225
+ output_path = " ${ path . module } /aws-stop-start-resources-3.1.2 .zip" # The version should match with the latest git tag
228
226
}
229
227
230
228
# Create Lambda function for stop or start aws resources
@@ -241,8 +239,8 @@ resource "aws_lambda_function" "this" {
241
239
variables = {
242
240
AWS_REGIONS = var.aws_regions == null ? data.aws_region.current.name : join (" , " , var. aws_regions )
243
241
SCHEDULE_ACTION = var.schedule_action
244
- TAG_KEY = local.scheduler_tag [" key" ]
245
- TAG_VALUE = local.scheduler_tag [" value" ]
242
+ TAG_KEY = var.resources_tag [" key" ]
243
+ TAG_VALUE = var.resources_tag [" value" ]
246
244
EC2_SCHEDULE = tostring (var. ec2_schedule )
247
245
RDS_SCHEDULE = tostring (var. rds_schedule )
248
246
AUTOSCALING_SCHEDULE = tostring (var. autoscaling_schedule )
Original file line number Diff line number Diff line change @@ -39,23 +39,12 @@ variable "schedule_action" {
39
39
}
40
40
41
41
variable "resources_tag" {
42
- # This variable has been renamed to "scheduler_tag"
43
- description = " DEPRECATED, use scheduler_tag variable instead"
42
+ description = " Set the tag use for identify resources to stop or start"
44
43
type = map (string )
45
44
46
45
default = {
47
- " key" = " tostop"
48
- " value" = " true"
49
- }
50
- }
51
-
52
- variable "scheduler_tag" {
53
- description = " Set the tag to use for identify aws resources to stop or start"
54
- type = map (string )
55
-
56
- default = {
57
- " key" = " tostop"
58
- " value" = " true"
46
+ key = " tostop"
47
+ value = " true"
59
48
}
60
49
}
61
50
You can’t perform that action at this time.
0 commit comments