Skip to content

Instantly share code, notes, and snippets.

View ashutoshkarna03's full-sized avatar
🎯
Focusing

ashutoshkarna03

🎯
Focusing
View GitHub Profile
# metric creation for the cloudwatch logs
resource "aws_cloudwatch_log_metric_filter" "cloudwatch_filter" {
name = "MyLogFilter"
log_group_name = "/aws/ecs/my-service"
pattern = "This text should trigger alarm"
metric_transformation {
name = "MyLogMetric"
namespace = "MyLogNamespace"
value = "1"
}
is_NaN = df.isnull()
row_has_NaN = is_NaN.any(axis=1)
rows_with_NaN = df[row_has_NaN]
print(rows_with_NaN)
console.log('hello')
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
resource "docker_container" "hello_world_app" {
image = "hello_world_app:latest"
name = "hello_world_app"
restart = "always"
volumes {
container_path = "/myapp"
# replace the host_path with full path for your project directory starting from root directory /
host_path = "/path/to/your/project/directory"
read_only = false
}
FROM node:10
RUN mkdir /myapp
# Create app directory
WORKDIR /myapp
COPY ./package.json /myapp/package.json
COPY ./package-lock.json /myapp/package-lock.json
import json
import pandas as pd
import numpy as np
import paramiko
import pysftp
def lambda_handler(event, context):
# test for pandas
data = {'name':["Tom", "John", "Andre", "Sam"],
#!/bin/bash
export LIB_DIR="python"
rm -rf ${LIB_DIR} && mkdir -p ${LIB_DIR}
docker run --rm -v $(pwd):/foo -w /foo lambci/lambda:build-python3.6 \
pip install -r requirements.txt -t ${LIB_DIR}
pandas==1.0.3
paramiko==2.7.1
pysftp==0.2.9
def get_instance_details(instance_id, client):
response = client.describe_instances(
InstanceIds=[
instance_id,
],
)
return dict(
instance_type = response['Reservations'][0]['Instances'][0]['InstanceType'],
state = response['Reservations'][0]['Instances'][0]['State']['Name'],
)