Skip to content

Instantly share code, notes, and snippets.

@MattHealy
MattHealy / apigateway-sqs-integration.yaml
Created May 22, 2019 02:53
Cloudformation Template for API Gateway AWS Service Integration to SQS Queue
Description: API Gateway to JSON payloads and send to SQS
Outputs:
ApiEndpoint:
Description: Endpoint for this stage of the api
Value: !Join
- ''
- - https://
- !Ref 'SQSProxy'
- .execute-api.ap-southeast-2.amazonaws.com/
- prod
@gbaman
gbaman / graphql_example.py
Created November 1, 2017 00:18
An example on using the Github GraphQL API with Python 3
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@tkuchiki
tkuchiki / data.tf
Last active July 17, 2020 02:20
terraform の external data source を使って外部コマンドの実行結果を variable として使用する
variable "foo" {
type = "string"
default = "baz"
}
data "external" "example" {
program = ["bash", "test.sh"]
query = {
foo = "${var.foo}"