Skip to content

Instantly share code, notes, and snippets.

View karthikeayan's full-sized avatar
🎯
Focusing

Karthikeyan karthikeayan

🎯
Focusing
View GitHub Profile
@karthikeayan
karthikeayan / ecs-shell.sh
Created December 12, 2021 15:06
Get shell of a container running on as a ECS Task
#!/usr/local/bin/bash
echo Enter Cluster Name:
read -e cluster_name
echo Enter Container Name:
read -e container_name
echo Enter Service Name:
read -e service_name
@karthikeayan
karthikeayan / fargate-delpoy-from-jenkins.txt
Last active October 18, 2020 18:30
fargate-deploy-from-jenkins-scheduled-task
cat <<EOF >taskdef.json
{
"family": "v1-taskDefintion",
"containerDefinitions": [
{
"name": "${microservice_name}",
"image": "${docker_repo_uri}/${microservice_name}:${tag}”,
"portMappings": [
{
"containerPort": ${containerPort},
@karthikeayan
karthikeayan / cross_account_ecr_pull.txt
Created October 15, 2020 18:46
Allow other AWS Accounts to pull images from ECR
Account A needs to pull images on Account B:
On Account A:
* Create a role in Account A
* Add policy which as ECR read access
On Account B:
* Create ECR Repository
* Add policy to the ECR Repository as below under permissions and replace <AccountA_ID>
{
@karthikeayan
karthikeayan / aws-cross-account-assume-role.txt
Last active October 15, 2020 18:42
AWS Assume Role Steps
For example, Account A needs to push docker images to Account B:
High level steps:
* Trust relationship will tell from where the request is originating
* Policy will tell what access the role has
* Account B's role will have trust relationship to Account A
* Account B's role will have access to push the image to ECR
* Account A's role will have trust relationship to EC2(as request is originating from EC2(jenkins))
@karthikeayan
karthikeayan / README.md
Created October 12, 2020 17:29
Fargate Scheduled Task
# Replace <your_telegram_api_token> with your Telegram API Token
# Replace <telegram_channel_id> with your Telegram Channel ID where you have to send the alert
package function
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
@karthikeayan
karthikeayan / amznymous.md
Created May 22, 2020 12:59 — forked from bricker/amznymous.md
An Amazon Programmer's Perspective (http://pastebin.com/BjD84BQ3)

Originally posted at http://pastebin.com/BjD84BQ3

Trigger warning: mention of suicidal ideation

tl;dr: I burned out as a developer at Amazon at the end of my second year. I’ve since found a healthy and sustainable work-life balance and enjoy work again. I write this to A) raise awareness, especially for new-hires and their families, and B) help give hope and advice to people going through the same at Amazon or other companies.

Hello, world

There’s been no shortage of anecdotes, opinions, and rebuttals regarding Amazon’s corporate culture as of late. I write this not to capitalize on the latest news-feed fad, but to share what I had already written and promptly deleted. I didn’t think anyone would want to hear my story, but it’s apparent people are going through a similar experience and don’t have a voice.

I’m a Software Development Engineer II at Amazon; SDE II basically means a software developer with at least 2–3 years of industry experience. I started at Amazon as an SDE I.

Send E-Mail from alertmanager by using AWS SES as SMTP server

Alertmanager can be configured to send notifications to different targets, Slack, Email, PagerDuty etc.

Use the below steps to configure AWS SES as SMTP server to send E-Mails from alertmanager

  • The from address should be already verified in AWS SES to send E-Mails from that address

  • Check and confirm if you have secret named "alertmanager-main" in monitoring namespace

resource "aws_iam_role" "firehose_role" {
name = "firehose_es_delivery_role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}