-
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.
Merge pull request #5 from schubergphilis/update-docs
docs: Add docs to examples, fix README image
- Loading branch information
Showing
5 changed files
with
57 additions
and
6 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
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,13 @@ | ||
# Office Hours | ||
|
||
This example starts resources at 09:00 AM on weekdays and shuts them down again at 06:00 PM. | ||
|
||
When starting the resources it follows these steps: | ||
|
||
1. Giving the RDS instance with id `application-cluster-1` a start command. | ||
1. Waits 10 minutes for the RDS instance to become available. | ||
1. Update the ECS service named `application-service-1` on ECS cluster `application-cluster-1` and put the number of desired tasks in the service to 2. | ||
|
||
These steps are executed in reverse when stopping the instances. | ||
|
||
The RDS instance will also be started 15 minutes before its configured maintenance- and backup window. It will be stopped 15 minutes after its configured maintenance- and backup window. The ECS service is unaffected during these windows. |
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,13 @@ | ||
# On-Demand | ||
|
||
This example never starts resources on a schedule, but will always attempt to shut them down at 06:00 PM. There are no webhooks configured in this example, meaning the state machine that starts resources will have to be triggered in some other way. | ||
|
||
When starting the resources it follows these steps: | ||
|
||
1. Giving the RDS instance with id `application-cluster-1` a start command. | ||
1. Waits 10 minutes for the RDS instance to become available. | ||
1. Update the ECS service named `application-service-1` on ECS cluster `application-cluster-1` and put the number of desired tasks in the service to 2. | ||
|
||
These steps are executed in reverse when stopping the instances. | ||
|
||
The RDS instance will also be started 15 minutes before its configured maintenance- and backup window. It will be stopped 15 minutes after its configured maintenance- and backup window. The ECS service is unaffected during these windows. |
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,15 @@ | ||
# Webhooks | ||
|
||
This example starts resources at 09:00 AM on weekdays and shuts them down again at 06:00 PM. | ||
|
||
When starting the resources it follows these steps: | ||
|
||
1. Giving the RDS instance with id `application-cluster-1` a start command. | ||
1. Waits 10 minutes for the RDS instance to become available. | ||
1. Update the ECS service named `application-service-1` on ECS cluster `application-cluster-1` and put the number of desired tasks in the service to 2. | ||
|
||
These steps are executed in reverse when stopping the instances. | ||
|
||
The RDS instance will also be started 15 minutes before its configured maintenance- and backup window. It will be stopped 15 minutes after its configured maintenance- and backup window. The ECS service is unaffected during these windows. | ||
|
||
Additional to the scheduled start/stop of the mentioned resources, an API Gateway is deployed that provides endpoints for webhooks that can be used for automation from external resources. Think starting/stopping a bunch of resources from a ticketing system or via ChatOps. |
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,15 +1,23 @@ | ||
output "api_gateway_stage_arn" { | ||
value = var.webhooks.deploy ? aws_api_gateway_stage.webhooks[0].arn : null | ||
} | ||
|
||
output "start_composition_state_machine_arn" { | ||
value = aws_sfn_state_machine.composition_start.arn | ||
} | ||
|
||
output "start_composition_webhook_url" { | ||
value = var.webhooks.deploy ? "${aws_api_gateway_stage.webhooks[0].invoke_url}/start" : null | ||
} | ||
|
||
output "stop_composition_state_machine_arn" { | ||
value = aws_sfn_state_machine.composition_stop.arn | ||
} | ||
|
||
output "stop_composition_webhook_url" { | ||
value = var.webhooks.deploy ? "${aws_api_gateway_stage.webhooks[0].invoke_url}/stop" : null | ||
} | ||
|
||
output "webhook_api_key" { | ||
value = var.webhooks.deploy ? aws_api_gateway_api_key.webhooks[0].value : null | ||
} | ||
|
||
output "api_gateway_stage_arn" { | ||
value = var.webhooks.deploy ? aws_api_gateway_stage.webhooks[0].arn : null | ||
} |