Skip to content

Commit

Permalink
docs: update aws_health_to_slack README for cloud (#121)
Browse files Browse the repository at this point in the history
# Restructure README for Better User Experience

## Changes
- Reorganized deployment sections to prioritize cloud usage
- Separated and clarified configuration steps for different deployment
methods (cloud/UI vs self-hosted)
- Added clear instructions for modifying variables in both environments
- Improved documentation structure and readability

## Why
The previous README mixed cloud and self-hosted instructions, making it
confusing for users. This restructuring:
- Makes it easier for cloud users to quickly find relevant information
- Keeps detailed self-hosted instructions accessible but separate
- Clarifies how to configure variables in different environments
- Provides a more logical flow of information

---------

Co-authored-by: Daniel Abraham <[email protected]>
  • Loading branch information
pashafateev and daabr authored Nov 28, 2024
1 parent 9922b59 commit 4b10c6d
Showing 1 changed file with 55 additions and 69 deletions.
124 changes: 55 additions & 69 deletions aws_health_to_slack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ This project automates the process of announcing AWS health events in Slack base
2. Reads project-to-Slack-channel mappings from a Google Sheet.
3. Posts relevant health events to the corresponding Slack channels based on the Google Sheet data.

## How It Works
## Deployment & Configuration

1. Fetches AWS Health events from AWS API.
2. Reads project-to-Slack-channel mappings from a Google Sheet.
3. Posts relevant health events to the corresponding Slack channels based on the Google Sheet data.
### Cloud Usage (Recommended)

### Google Sheets Data
1. Initialize your connections through the UI
2. Configure your Google Sheet mapping (see [Google Sheets Configuration](#google-sheets-configuration) below)

The default Google Sheet used for mapping projects to Slack channels is as follows:
## Google Sheets Configuration

The default Google Sheet format for mapping projects to Slack channels:

| Project Tag | Slack Channel |
|-------------|--------------------|
Expand All @@ -34,71 +35,56 @@ The default Google Sheet used for mapping projects to Slack channels is as follo

This table represents how each project is linked to a specific Slack channel, guiding where health events will be posted.

> [!NOTE] You can configure your own project-to-Slack-channel mappings by specifying a different Google Sheet in the [`autokitteh.yaml`](autokitteh.yaml) file.

## Installation and Usage

- [Install AutoKitteh](https://docs.autokitteh.com/get_started/install)

### Configure Integrations

Ensure you have set up the required integrations and environment variables. This project uses Google Sheets, AWS Health API, and Slack API.

- [Google Sheets](https://docs.autokitteh.com/integrations/google)
- [Slack](https://docs.autokitteh.com/integrations/slack)

### Clone the Repository

```shell
git clone https://github.com/autokitteh/kittehub.git
cd kittehub/aws_health_to_slack
```
> [!NOTE]
> You can configure your own project-to-Slack-channel mappings by either:
> - Cloud/UI: Navigate to the Variables tab in your project settings and update the `GOOGLE_SHEET_URL` value
> - Self-hosted (VSCode / CLI): Modify the Google Sheet URL in the [`autokitteh.yaml`](autokitteh.yaml) file
Alternatively, you can copy the individual files in this directory.
## Trigger Workflow

### Run the AutoKitteh Server
The workflow runs automatically every minute after deployment. You can modify this interval:
- Cloud/UI: Navigate to the Variables tab in your project settings and update the `SCHEDULE_INTERVAL` value
- Self-hosted (VSCode / CLI): Modify the schedule interval in the [`autokitteh.yaml`](autokitteh.yaml) file

Simply run this command:
> [!IMPORTANT]
> Ensure all connections (AWS, Google Sheets, and Slack) are properly initialized before the workflow starts running.
```shell
ak up --mode dev
```
## Self-Hosted Deployment

### Apply Manifest and Deploy Project

1. Navigate to the aws_health_slack directory:

```shell
cd aws_health_slack
```

2. Apply manifest and deploy project by running the following command:

```shell
ak deploy --manifest autokitteh.yaml
```

The output of this command will be important for initializing connections in the following step if you're using the CLI.

For example, for each configured connection, you will see a line that looks similar to the one below:

```shell
[exec] create_connection "aws_health_slack/google_sheets_connection": con_01j36p9gj6e2nt87p9vap6rbmz created
```

`con_01j36p9gj6e2nt87p9vap6rbmz` is the connection ID.

### Initialize Connections

Using the connection IDs from the previous step, run these commands:

```shell
ak connection init aws_connection <connection ID>
ak connection init google_sheets_connection <connection ID>
ak connection init slack_connection <connection ID>
```

### Trigger the Workflow

The workflow is triggered automatically after deployment to run every minute. The interval can be configured in `autokitteh.yaml`.
#### Prerequisites
- [Install AutoKitteh](https://docs.autokitteh.com/get_started/install)
- Set up required integrations:
- [Google Sheets](https://docs.autokitteh.com/integrations/google)
- [Slack](https://docs.autokitteh.com/integrations/slack)
- AWS Health API

#### Installation Steps
1. Clone the repository:
```shell
git clone https://github.com/autokitteh/kittehub.git
cd kittehub/aws_health_to_slack
```

2. Start the AutoKitteh server:
```shell
ak up --mode dev
```

3. Deploy the project:
```shell
ak deploy --manifest autokitteh.yaml
```

The output will show your connection IDs, which you'll need for the next step. Look for lines like:
```shell
[exec] create_connection "aws_health_slack/google_sheets_connection": con_01j36p9gj6e2nt87p9vap6rbmz created
```
In this example, `con_01j36p9gj6e2nt87p9vap6rbmz` is the connection ID.

4. Initialize your connections using the CLI:
```shell
ak connection init aws_connection <connection ID>
ak connection init google_sheets_connection <connection ID>
ak connection init slack_connection <connection ID>
```

0 comments on commit 4b10c6d

Please sign in to comment.