Skip to content

Instantly share code, notes, and snippets.

View tsoe77's full-sized avatar
☁️

Thiha Soe tsoe77

☁️
View GitHub Profile
@tsoe77
tsoe77 / .gitlab-ci.yml
Last active May 16, 2024 19:33
Gitlab CI example for Gitlab + AWS OIDC integrated role
# gitlab ci template for terraform with webidentity role
# https://docs.gitlab.com/ee/ci/cloud_services/aws/ for how to setup gitlab oidc in aws.
#
# assuming it is a monorepo with vpc/dev and vpc/prod
# assuming AWS_IAM_ROLE_DEV and AWS_IAM_ROLE_PROD with role arn as values configured in the CI/CD settings
#
# setup step is to setup working dir and pass role arn
# validate step is to validate terraform
# terraform plan step runs on any other branch except in main
# terraform apply step runs only on main branch
@tsoe77
tsoe77 / lambda.py
Created March 7, 2022 15:15
lambda dns test
import socket
import json
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': json.dumps(socket.gethostbyname('www.google.com'))
}
@tsoe77
tsoe77 / solarized-dark-for-slack.md
Created October 18, 2021 20:50
yet another solarized dark theme for slack
#002B36,#002B36,#073642,#FDF6E3,#657B83,#FDF6E3,#859900,#2AA198,#002B36,#FDF6E3
@tsoe77
tsoe77 / cognito-test.py
Created October 13, 2020 18:31 — forked from bgdnlp/cognito-test.py
Sign up and log in to Cognito, check tokens, then call an API. Details: https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html
#!/usr/bin/env python3
# Demonstrates the use of Python to work with Cognito.
# Create a new a user, log in, check tokens and call an API.
# The purpose was to learn about Cognito. Security has been
# circumvented in the interest of keeping it simple.
# Notably, the authentication procedure uses the most insecure
# method. This code is not intended for use in production.
#
# https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html