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
for package in $(pkg info | awk '{print $1}'); do | |
if pkg info "${package}" | grep -qi "DEPRECATED"; then | |
echo "${package} is deprecated" | |
fi | |
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
# openapi2-functions.yaml | |
# This API once created will be found in APIs & Services console | |
swagger: '2.0' | |
info: | |
title: api-name description-goes-here | |
description: description-goes-here | |
version: 1.0.0 | |
schemes: | |
- https | |
produces: |
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
# Create an API resource. It will hold our API config and API | |
# gateway. API gateway will have a URL that we will be able to hit. | |
resource "google_api_gateway_api" "api" { | |
provider = google-beta | |
api_id = "api" | |
} | |
# Create an API config that points the API at various | |
# Cloud Functions, Cloud Run instances, and their | |
# configurations. The config will be in openapi2-functions.yaml |
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
/* | |
// If you get this error, ensure that your $GOOGLE_APPLICATION_DEFAULTS env | |
variable is set to a Service Account. Regular cloud identities are not | |
allowed to hit apikeys.googleapis.com because in the eyes of Google, API keys | |
are insecure compared to OAuth2 tokens. | |
│ Error: Error creating Key: failed to create a diff: failed to retrieve Key | |
| resource: googleapi: Error 403: Your application has authenticated using | |
| end user credentials from the Google Cloud SDK or Google Cloud Shell which | |
| are not supported by the apikeys.googleapis.com. We recommend configuring |
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/env python | |
import importlib | |
import importlib.util | |
import sys | |
from pathlib import Path | |
# Get our command | |
command = sys.argv[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
#!/usr/bin/env python | |
''' | |
Movie sorter | |
''' | |
import os | |
import shutil | |
import sys |
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
{ | |
"StartAt":"Invoke Lambda function", | |
"States":{ | |
"Invoke Lambda function":{ | |
"Type":"Task", | |
"Resource":"arn:aws:states:::lambda:invoke", | |
"Parameters":{ | |
"FunctionName":"arn:aws:lambda:::function:store-payload-to-s3", | |
"Payload":{ | |
"Input.$":"$" |
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/env python | |
import boto3 | |
import json | |
import logging | |
import requests | |
from aws_xray_sdk.core import xray_recorder | |
from aws_xray_sdk.core import patch_all | |
patch_all() |
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
{ | |
"Comment": "Simple example that gets status code and puts in SSM Parameter Store", | |
"StartAt": "process-input", | |
"States": { | |
"process-input": { | |
"Type": "Task", | |
"Resource": "arn:aws:states:::activity:process-input", | |
"ResultPath": "$", | |
"End": true | |
} |
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
curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq .accountId | sed 's/"//g' |