Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
riseshia committed Jul 15, 2024
1 parent 2828a74 commit 0e7cc32
Showing 1 changed file with 67 additions and 16 deletions.
83 changes: 67 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -40,7 +40,7 @@ Usage: fubura <COMMAND>
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:
Expand All @@ -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.
Expand Down

0 comments on commit 0e7cc32

Please sign in to comment.