This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import json | |
import pprint as pp | |
import pandas as pd | |
from IPython.display import display | |
#クライアントの生成 | |
client = boto3.client('iam') | |
#IAMRole一覧の取得 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "LimitedAttachmentPermissions", | |
"Effect": "Deny", | |
"Action": [ | |
"iam:DetachRolePolicy", | |
"iam:AttachGroupPolicy", | |
"iam:AttachUserPolicy", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import pprint as pp | |
import pandas as pd | |
from IPython.display import display | |
#====================== | |
# IAMロール名を渡すとIAMポリシーを返す関数 | |
#====================== | |
def check_iam_policy(role_name_list): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
lambda_client = boto3.client('lambda') | |
codepipeline_client = boto3.client('codepipeline') | |
def lambda_handler(event, context): | |
try: | |
### | |
# Get CodepipeLine Job ID | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import pprint as pp | |
import csv | |
################################### | |
# MAIN処理 | |
################################### | |
#--- 認証情報/環境識別子 | |
access_key = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import time | |
import pprint as pp | |
import json | |
#--- 変数定義 | |
cluster_name = 'arn:aws:ecs:ap-northeast-1:xxxxxx:cluster/xxxxxxx' | |
#--- クライアント生成 | |
ecs_client = boto3.client('ecs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import datetime as dt | |
import json | |
import pprint as pp | |
#--- クライアント生成 | |
ecs_client = boto3.client('ecs') | |
ssm_client = boto3.client('ssm') | |
#--- 変数定義 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redshift_connector | |
import pandas as pd | |
import itertools | |
# Redsift Connection Setting | |
conn = redshift_connector.connect( | |
host='host_name', | |
database='db_name', | |
user='db_user_name', | |
password="db_user_password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# != 4 ]; then | |
echo "+++ Argument Error +++" | |
echo Usage: ./s3select_cli.sh "<s3_bucket_name>" "<s3_Object_key>" "<file_format Parquet|CSV>" "<SQL>" | |
echo Example: ./s3select_cli.sh nyc-tlc misc/uber_nyc_data.csv CSV "select * from s3object limit 10" | |
exit 1 | |
fi | |
BucketName=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
import boto3 | |
import json | |
import calendar | |
from datetime import datetime, date | |
from linebot import (LineBotApi, WebhookHandler) | |
from linebot.models import (MessageEvent, TextMessage, TextSendMessage,) | |
from linebot.exceptions import (LineBotApiError, InvalidSignatureError) | |
ce_client = boto3.client('ce') |
OlderNewer