Skip to content

Commit

Permalink
fix: prettier linter
Browse files Browse the repository at this point in the history
  • Loading branch information
KostLinux committed Oct 9, 2024
1 parent 8b8baf5 commit 2dbf65b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion employment-tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This folder is used to store test tasks from the real job interviews. The tasks are stored in the `test-tasks` folder. Each task is stored in a separate folder with the name of the company that provided the task. Inside the company folder, there is a `README.md` file with the task description.

The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack.
The real job interviews prepare students and junior specialists for the real job interviews. The tasks are designed to test the knowledge and skills of the candidates. The tasks are usually taken from the job position interviews and the company's technology stack.
17 changes: 9 additions & 8 deletions employment-tasks/devops/basic-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ some basic validation against an expected message format and content,
and then puts that payload into a queue of your choice or a file.

Example valid payload:

```json
{
"ts": "1530228282",
"sender": "curler-user",
"message": {
"foo": "bar",
"hash": "bash"
},
"sent-from-ip": "1.2.3.4"
"ts": "1530228282",
"sender": "curler-user",
"message": {
"foo": "bar",
"hash": "bash"
},
"sent-from-ip": "1.2.3.4"
}
```

Expand All @@ -34,4 +35,4 @@ Deploy this application to your favourite cloud provider using Terraform.

## Part 3 – NewRelic

Implement NewRelic monitoring for this application using Terraform.
Implement NewRelic monitoring for this application using Terraform.
23 changes: 12 additions & 11 deletions employment-tasks/devops/notbad-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ Look at the following tasks and estimate how much time you will spend on them.
## Preconditions

### Technical & Knowledge

You need at least:

* Experience with AWS stack
* Experience with CI/CD
* Experience with Bash scripts
* Experience in at least one programming language (Java, Python, PHP, Perl, etc.)
* A text editor of your choice
- Experience with AWS stack
- Experience with CI/CD
- Experience with Bash scripts
- Experience in at least one programming language (Java, Python, PHP, Perl, etc.)
- A text editor of your choice

## The tasks
1) We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this.

2) Look into keycloak folder. What can be improved?

3) Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad".
Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them.
Hint: https://aws.amazon.com/free/
1. We have a Terraform securitygroups.tf file. Every time Terraform runs, it says the security group in that file will be updated in place. Find a way to prevent this.

2. Look into keycloak folder. What can be improved?
3. Provide infrastructure and create CI/CD with a web app that will listen to 8089 port and return "ReallyNotBad" string when POST request contains header "NotBad" with value "true", eg. `curl -X POST -H "NotBad: true" https://someurl:8089/` should return "ReallyNotBad".
Use any technology you want to deploy the application to AWS. It can be Ansible, Terraform, etc. or a combination of some of them.
Hint: https://aws.amazon.com/free/
3 changes: 2 additions & 1 deletion employment-tasks/devops/notbad-task/keycloak/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# alpeso-test

alpeso-test

## How-to use

Simple run ```./keycloack.sh test test1``` where test = keycloak user id and test1 = keycloak client secret.
Simple run `./keycloack.sh test test1` where test = keycloak user id and test1 = keycloak client secret.
2 changes: 1 addition & 1 deletion employment-tasks/software-engineer/game-task/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ This user has 50 amount of his balance for testing.
1. Create `.env` file in root folder and add all required variables from `.env.example` file
2. To run docker container you should have `docker` and `docker-compose` tools installed (Tested on `Docker version 26.1.3, build b72abbb` and `Docker Compose version v2.27.1`)
3. `docker-compose up` - to run application in docker container
4. `docker-compose down` - to stop application in docker container
4. `docker-compose down` - to stop application in docker container
21 changes: 10 additions & 11 deletions subjects/devops/serverless/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Serverless Payments Reminder
## Serverless Payments Reminder

Serverless Payments Reminder is a basic Slack Bot that reminds companies / users to pay their bills. The reminder gets triggered by AWS EventBridge (also known as CloudWatch Events). The bot itself is hosted on a simple AWS Lambda function.

Expand All @@ -15,7 +15,7 @@ Create a simple Slack bot using:

The task is separated into multiple different levels. The levels are ordered by complexity. You can choose the level that you feel most comfortable with.

## Level 0: Basic Lambda Function hosted via Serverless**
## Level 0: Basic Lambda Function hosted via Serverless

**1. Create Slack Bot**

Expand All @@ -31,17 +31,17 @@ The environment variables which must be available in the Lambda function are:
- `AMOUNT` - The amount to be paid
- `IBAN_NUMBER` - The IBAN number

The due date must be calculated based on the current date for the next month.
The due date must be calculated based on the current date for the next month.

Before step two, you need to test that Slack Bot is functioning properly by running an application locally. It should send a message to the Slack channel.
Before step two, you need to test that Slack Bot is functioning properly by running an application locally. It should send a message to the Slack channel.

**2. Write tests for the application**

Write integration tests for the application to ensure that each part of the application is functioning properly.

**3. Use [Serverless Framework](https://github.com/serverless/serverless) to host the lambda function**

Serverless framework is an automation tool used to deploy serverless applications which can help with event-driven architecture deployments.
Serverless framework is an automation tool used to deploy serverless applications which can help with event-driven architecture deployments.

Use the serverless framework to host the lambda function combined with AWS Eventbridge.

Expand All @@ -54,7 +54,7 @@ AWS Eventbridge should trigger lambda function every month on the 1st day of the

**Note** Before hosting, you need to ensure that the bot is written in a way that it can be hosted on AWS Lambda. You can look at the example [here](https://github.com/KostLinux/aws-incident-manager-notifier/blob/56d52e90f8a14e689e7d2a1c7ee44590de5af2f5/main.go#L158).

## Level 1: Basic Lambda Function automation via Cloudformation**
## Level 1: Basic Lambda Function automation via Cloudformation

**1. Repeat the 1st and 2nd step from Level 0**

Expand All @@ -70,7 +70,7 @@ Cloudformation is Infrastructure As Code (IaC) tool used to automate the provisi

Write cloudformation template with parameters (variables) `SlackWebhookUrl`, `Amount`, `IbanNumber`. The template should automatically provision the Slackbot based on architecture mentioned in [Level 0](#level-0-basic-lambda-function-hosted-via-serverless) step 3.

## Level 2: Basic Lambda Function automation via Basic Terraform with Local State**
## Level 2: Basic Lambda Function automation via Basic Terraform with Local State\*\*

Terraform is an Infrastructure As Code (IaC) tool used to automate the provisioning of resources inside different SaaS solutions and Cloud providers. It uses HCL syntax, which is easy maintainable. The main problem of terraform is that you need to know, how everything works under the hood (e.g. IAM roles, policies, serverless platforms etc).

Expand All @@ -94,7 +94,7 @@ Create a slack bot, that sends a reminder to slack channel. Write integration te

At this level you can use local state for terraform, no modules needed to write.

## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)**
## Level 3: Basic Lambda Function automation via Terraform Module with Remote S3 State (advanced)\*\*

In a DevOps world, mostly we use remote state for terraform. The main reason is that we can share the state with other team members and we can easily manage the state of the infrastructure. Although it is a bit more complex to set up, it allows you to avoid issues when someone even removes the state file, cause S3 has versioning turned on.

Expand Down Expand Up @@ -137,7 +137,7 @@ terraform {
}
```

Use the module written at step 1 to provision the resources
Use the module written at step 1 to provision the resources

```tf
module "slack_bot" {
Expand All @@ -150,11 +150,10 @@ module "slack_bot" {
}
```


## Helpful commands

- `serverless deploy` - Deploy the serverless application
- `aws cloudformation deploy --template-file template.yaml --stack-name my-stack` - Deploy the cloudformation stack
- `terraform init` - Initialize the terraform project and remote state.
- `terraform plan` - Plan the resources you're going to provision. It will show you the changes that will be made.
- `terraform apply` - Apply the terraform project only if you're sure that everything is correct during the plan.
- `terraform apply` - Apply the terraform project only if you're sure that everything is correct during the plan.

0 comments on commit 2dbf65b

Please sign in to comment.