aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-chandler <mchandler89@gmail.com>2024-10-04 14:44:48 +1000
committerGitHub <noreply@github.com>2024-10-04 14:44:48 +1000
commita8b38421654e3fa2fd14fec8f4b60a2f533b5f65 (patch)
tree13bda7f11d3e1e2501fed876657a7131ec16fa4a
parent83e1825109772d5bf76d4fc137cba910dfc60247 (diff)
parent3c3126746e0b73ba17f0d5f9fea000eea2b59aa4 (diff)
Merge pull request #29 from robertmassaioli/patch-2
Update readme.md to add simple CLI option.
-rw-r--r--readme.md39
1 files changed, 39 insertions, 0 deletions
diff --git a/readme.md b/readme.md
index 10761b7..04c4b02 100644
--- a/readme.md
+++ b/readme.md
@@ -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-111111111111
+}
+
+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.
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage