From 0e7cc32f5619db5d66462d742273a322516c27fe Mon Sep 17 00:00:00 2001 From: Shia Date: Mon, 15 Jul 2024 14:55:27 +0900 Subject: [PATCH] Update README --- README.md | 83 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 67 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index dcb72e6..935fde8 100644 --- a/README.md +++ b/README.md @@ -8,18 +8,20 @@ Consider it as a specialized terraform with Step function & EventBridge Schedule - Similar schema to AWS resource API - Write configuration in Jsonnet, which gives us more flexibility than plain JSON -## Why fubura? +### Why fubura? - Need low cost job scheduler implemented with Step Function, EventBridge, and ECS - Need the better way to handle state machine definition than terraform -## Why not fubura? +### Why not fubura? - Need few, carefully crafted complex state machine - Want to handle all resources(including resources call by state machine, scheduler dlq, etc) in one place ## Install +Custom tap is available for Homebrew. + ### Homebrew (macOS and Linux) XXX: to be supported @@ -28,9 +30,7 @@ XXX: to be supported brew install rieshia/x/fubura ``` -### Binary - -XXX: to be supported +or you can download the code from the [release page](https://github.com/riseshia/fubura/releases) and compile from it. ## How to use @@ -40,7 +40,7 @@ Usage: fubura Commands: apply apply config plan plan config - import import state machine config + import import state machine to specified config file help Print this message or the help of the given subcommand(s) Options: @@ -50,19 +50,70 @@ Options: ## Configuration -### `fubura.jsonnet` - ```jsonnet -[{ - schedule: { - // {Create,Update}Schedule API Request Body - }, // could be null - state: { - // {Create,Update}StateMachine API Request Body - }, // must not be null -}] +// `fubura.jsonnet` +{ + ssConfigs: [{ + state: { + // CreateStateMachine API Request Params except "versionDescription" + // https://docs.aws.amazon.com/step-functions/latest/apireference/API_CreateStateMachine.html + }, // should not be null + schedule: { + // CreateSchedule API Request Body except "ActionAfterCompletion", "ClientToken" + // https://docs.aws.amazon.com/scheduler/latest/APIReference/API_CreateSchedule.html + }, // could be null + deleteAll: true // Optional, default is false. If true, delete the state machine and schedule + deleteSchedule: true // Optional, default is false. If true, delete the schedule + }] +} ``` +Full example configuration is available in [example](./example) directory. + +### `delete*` fields + +fubura do not have the state which resource is managed by it, +such as terraform's `tfstate` for simplexity. +Instead, fubura provides `delete*` fields to delete the resource, +so you can delete each resource by setting `delete*` field to `true`, and apply it. + +## Required IAM permissions + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AllowStateModification", + "Effect": "Allow", + "Action": [ + "states:CreateStateMachine", + "states:UpdateStateMachine", + "states:DeleteStateMachine", + "states:TagResource", + "states:UntagResource", + ], + "Resource": "*" + }, + { + "Sid": "AllowScheduleModification", + "Effect": "Allow", + "Action": [ + "scheduler:CreateSchedule", + "scheduler:UpdateSchedule", + "scheduler:DeleteSchedule", + ], + "Resource": "*" + } + ] +} +``` + +Reference: + +- [Actions, resources, and condition keys for AWS Step Functions](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsstepfunctions.html) +- [Actions, resources, and condition keys for Amazon EventBridge Scheduler](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoneventbridgescheduler.html) + ## License This project is licensed under MIT License.