Skip to content

Instantly share code, notes, and snippets.

name: 'Terraform Plan'
on:
- pull_request
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note
# https://gist.github.com/gbaman/b3137e18c739e0cf98539bf4ec4366ad#gistcomment-2963016
from requests import exceptions, request
class GitHubQuery:
BASE_URL = "https://api.github.com/graphql"
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
from github import Github
def get_members(token, organization):
github = Github(token)
org = github.get_organization(organization)
@dehio3
dehio3 / custom-domain-api-lambda-sample-serverless.yml
Last active July 11, 2020 03:42
カスタムドメインを利用したAPI Gatewayとlambda環境構成のサンプル
service:
name: ${self:custom.serviceName}
provider:
name: aws
apiName: ${self:custom.serviceName}-API
endpointType: REGIONAL
apiKeys:
- ${self:custom.serviceName}
runtime: python3.7
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from dotenv import load_dotenv
from pathlib import Path
from botocore.exceptions import ClientError
import boto3
import json
@dehio3
dehio3 / github-actions-sls-python-deploy.yml
Created February 19, 2020 08:47
Lambda(python)をserverless Frameworkを利用してデプロイする時のGitHubActionsの設定
name: serverless deploy
on: [push]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
name: 'Terraform GitHub Actions apply'
on:
push:
branches:
- master
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
steps:
version: 2
defaults: &defaults
docker:
- image: hashicorp/terraform:0.11.13
environment:
AWS_DEFAULT_REGION: ap-northeast-1
tfnotify_install: &tfnotify_install
name: tfnotify install
version: 2.1
executors:
default:
working_directory: ~/aws-terraform
docker:
- image: hashicorp/terraform:light
commands:
install_tfnotify:
module "ec2_test" {
source = "terraform-aws-modules/ec2-instance/aws"
version = "1.21.0"
name = "ec2-test"
instance_count = 1
ami = "ami-0b8d0d6ac70e5750c" #amzn2-ami-hvm-2.0.20181114-x86_64-ebs
instance_type = "t2.micro"
key_name = "test-key"
monitoring = false
vpc_security_group_ids = ["<vpc_security_group_ids>"]