This module requires a tag:key and tag:value to query aws ec2 instances and apply the schedule to stop or start
Scheduled events are managed by a Cron, the format can be found: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
Example:
module "stop_jenkins" {
source = "git::https://github.com/wcampos/terraform_aws_module_ec2_start_stop_scheduled_trigger.git"
region = "us-east-1"
prefix = "test"
tag_key = "Name"
tag_value = "MyMachineName"
instance_state = "Stop"
cron_schedule = "cron(0 12 * * ? *)"
}
No requirements.
Name | Version |
---|---|
archive | n/a |
aws | n/a |
No modules.
Name | Type |
---|---|
aws_cloudwatch_event_rule.start_stop_lambda_cw_event_rule | resource |
aws_cloudwatch_event_target.start_stop_lambda | resource |
aws_iam_policy.start_stop_lambda | resource |
aws_iam_role.start_stop_lambda | resource |
aws_iam_role_policy_attachment.start_stop_lambda_policy_attachment | resource |
aws_lambda_function.start_stop_lambda | resource |
aws_lambda_permission.start_stop_lambda | resource |
archive_file.start_stop_lambda | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cron_schedule | Cron Expression to Start or Stop EC2s | string |
"" |
no |
instance_state | Desire state for Ec2s. Available options: [ 'Start', 'Stop'] | string |
"" |
no |
region | EC2 Instances Region | string |
"" |
no |
tag_key | Name of the Tag:Key used on ec2 filter | string |
"" |
no |
tag_value | Value for the Tag:Value used for ec2 filter | string |
"" |
no |
No outputs.