diff options
| author | Robert Massaioli <robertmassaioli@gmail.com> | 2024-10-04 14:33:48 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-04 14:33:48 +1000 |
| commit | 57923515ae462e74eea9e0f391770febf28c61cd (patch) | |
| tree | 18ec00c6022ba3a61de8b6946b054568cd3e5cdb /readme.md | |
| parent | 83e1825109772d5bf76d4fc137cba910dfc60247 (diff) | |
Update readme.md to add simple CLI option.
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 39 |
1 files changed, 39 insertions, 0 deletions
@@ -115,6 +115,45 @@ Update your CloudFormation stack. Enter a different limit. Update your CloudFormation stack. Change the server state parameter from "Running" to "Stopped".
+**How do I turn my stack on and off from the terminal?**
+
+You can write a bash script, using the CLI like so:
+
+``` bash
+#!/bin/bash
+
+update_stack() {
+ local state=$1
+ aws cloudformation update-stack \
+ --stack-name factorio-2024 \
+ --use-previous-template \
+ --parameters ParameterKey=ServerState,ParameterValue=$state \
+ --capabilities CAPABILITY_IAM \
+ --profile AdministratorAccess-110055367801
+}
+
+case "$1" in
+ start)
+ update_stack "Running"
+ ;;
+ stop)
+ update_stack "Stopped"
+ ;;
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 1
+ ;;
+esac
+```
+
+If you put that in a file called `update_factorio.bash` then you could run:
+
+``` bash
+$ bash update_factorio.bash <start|stop>
+```
+
+That does require that you run `aws configure sso` first and set up an IAM account with all the right perms.
+
**I'm done with Factorio, how do I delete this server?**
Delete the CloudFormation stack. Except for the EFS, Done. The EFS is retained when the CloudFormation stack is deleted to preserve your saves, but can then be manually deleted.
|
