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
#!/usr/bin/python | |
import boto3 | |
iam = boto3.client('iam') | |
response = iam.list_groups() | |
group_name_list = [ response['GroupName'] for response in response['Groups'] ] | |
for group_name in group_name_list: | |
print(group_name) |
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 | |
ec2 = boto3.client('ec2') | |
response = ec2.describe_instances() | |
instance_id_list = [] | |
for reservations in response['Reservations']: | |
instance_id_list.append(reservations['Instances'][0]['InstanceId']) | |
print(instance_id_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
{ | |
"Version": "2012-10-17", | |
"Statement": [{ | |
"Effect": "Allow", | |
"Action": "sts:AssumeRole", | |
"Resource": "arn:aws:iam::*:role/*", | |
"Condition": { | |
"StringEquals": { | |
"iam:ResourceTag/environment": "dev" | |
} |
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 | |
height=${1} | |
weight=${2} | |
bmi=`echo "scale=6;(${weight} / ${height} ^2 * 10000)" | bc | awk '{print substr($1,0,5)}'` | |
echo ${bmi} |
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 | |
trap 'muda' SIGINT | |
function muda() { | |
while true; do | |
echo '何回閉じても無駄ですよ~' | |
sleep 1 | |
done | |
} |
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": [ | |
{ | |
"Effect": "Allow", | |
"Action": "*", | |
"Resource": "*" | |
} | |
] | |
} |
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 | |
sleep 5 & | |
sleep 6 & | |
sleep 4 & | |
wait | |
echo '待ち合わせ終わった' |
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
--- | |
- name: Create codepipeline policy | |
iam_managed_policy: | |
policy_name: CodepipelinePolicy | |
policy: "{{ lookup('file','../meta/iam_policy.json') }}" | |
state: present | |
register: policy_result | |
- name: Create codepipeline Role | |
iam_role: |
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
--- | |
# use the AWS CLI to create a (default) parameter group for Aurora clusters | |
- name: Create a role and attach a managed policy called AWSCodeDeployRole | |
iam_role: | |
name: "{{ iam_role_name }}" | |
assume_role_policy_document: "{{ lookup('file','../meta/policy.json') }}" | |
managed_policy: | |
- arn:aws:iam::aws:policy/service-role/AWSCodeDeployRole | |
register: iam_role_result |
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
- hosts: localhost | |
tasks: | |
- reboot: |