Skip to content

Instantly share code, notes, and snippets.

View nikolaymatrosov's full-sized avatar

Nikolay Matrosov nikolaymatrosov

  • Serbia, Belgrade
View GitHub Profile
@nikolaymatrosov
nikolaymatrosov / serverless.yml
Created June 30, 2022 12:37
API Gateway example
service: bot
frameworkVersion: "3"
provider:
name: yandex-cloud
runtime: golang117
environment:
FOLDER_ID: b1g***
httpApi:
payload: '1.0'
@nikolaymatrosov
nikolaymatrosov / fluent-bit-ds.yaml
Created June 14, 2022 13:42
Fluentbit Deamon Set yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluent-bit
namespace: logging
labels:
k8s-app: fluent-bit-logging
version: v1
kubernetes.io/cluster-service: "true"
spec:
@nikolaymatrosov
nikolaymatrosov / fluent-bit-config.yaml
Created June 14, 2022 12:56
Fluentbit ConfigMap for Yandex Cloud Logging
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: logging
labels:
k8s-app: fluent-bit
data:
# Configuration files: server, input, filters and output
# ======================================================
@nikolaymatrosov
nikolaymatrosov / transfer.cs
Created May 12, 2022 05:52
Yandex Cloud Object Storage Transfer Example
using System;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using Amazon.S3;
using Amazon.S3.Transfer;
namespace ConsoleApp1
{
static class Program
@nikolaymatrosov
nikolaymatrosov / sa.go
Created May 5, 2022 07:20
Yandex Cloud Service Account Go example
package main
import (
"context"
"fmt"
"github.com/yandex-cloud/go-genproto/yandex/cloud/resourcemanager/v1"
"github.com/yandex-cloud/go-sdk"
"github.com/yandex-cloud/go-sdk/iamkey"
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package main
import (
"context"
"fmt"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"time"
)
@nikolaymatrosov
nikolaymatrosov / diagram.py
Created September 26, 2020 13:44
Yandex cloud diagram
from diagrams import Diagram
from diagrams import Group
from diagrams.yc.infrastructure import Compute
from diagrams.yc.serverless import ServerlessFunctions
from diagrams.yc.serverless import ServerlessTriggers
from diagrams.yc.serverless import YMQ
with Diagram("Create Snapshots", show=False, direction="LR", curvestyle="polyline"):
cron = ServerlessTriggers("Cron Trigger")
spawn = ServerlessFunctions("Spawn Function")
@nikolaymatrosov
nikolaymatrosov / build.yaml
Created April 21, 2020 17:09
Github Action to build and publish static Gatsby site
name: Gatsby Build and Publish
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
// Конфгурируем Yandex.Cloud provider
provider "yandex" {
zone = "ru-central1-a"
}
// Объявляем переменную с названием Организации на гитхабе.
// К сожалению github provider не создает ресурсы `github_actions_secret` в личных репах
// https://github.com/terraform-providers/terraform-provider-github/issues/422
// К счастью базовая функциональность организаций теперь бесплатна.
variable "github_organization" {