Skip to content

Instantly share code, notes, and snippets.

View jonesy1234's full-sized avatar

Stephen Jones jonesy1234

View GitHub Profile
---
name: 'Terraform GitHub Plan Shared Action'
# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
aws_region:
description: 'The target AWS Region for access to S3 & DynamoDB'
required: true
---
name: Terraform Plan
# yamllint disable-line rule:truthy
on:
pull_request:
branches: [master, main]
workflow_dispatch:
@jonesy1234
jonesy1234 / GitHub workflow_job Eventbridge rule
Last active February 21, 2023 10:00
EventBridge GitHub workflow_job Event Filter
{
"detail-type": ["workflow_job"]
}
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
github-webhook
Amazon EventBridge Inbound webhooks using lambda fURLs CFN Template.
Parameters:
GithubWebhookSecret:
Type: String
@jonesy1234
jonesy1234 / gist:5cb7cfa145e6e01e01e6db960e2eed8e
Created December 8, 2022 11:14
Transit Gateway Flow Logs
CREATE EXTERNAL TABLE IF NOT EXISTS `twgflowlogs`.`awslogs` (
version int,
resource_type string,
account_id string,
tgw_id string,
tgw_attachment_id string,
tgw_src_vpc_account_id string,
tgw_dst_vpc_account_id string,
tgw_src_vpc_id string,
tgw_dst_vpc_id string,
Type: AWS::IAM::ManagedPolicy
Properties:
Description: 'IAM Roles for Terraform State Resources'
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
@jonesy1234
jonesy1234 / gist:3e34f9f7d2904a3c84233ebe98564db8
Created September 13, 2022 12:34
GitHub Enterprise AWS OIDC
---
AWSTemplateFormatVersion: 2010-09-09
Description: GitHub Actions AWS Authentication with OIDC for GitHub Enterprise
Parameters:
GithubOrg: # can also be a regular user
Type: String
Default: mygithuborg
FullRepoName:
#!/usr/bin/env python
from diagrams import Cluster, Diagram
from diagrams.aws.network import Route53
from diagrams.aws.management import Cloudwatch, SSM, Cloudtrail, Config
from diagrams.aws.analytics import Analytics
from diagrams.aws.security import Detective, Guardduty, IAMAccessAnalyzer, SecurityHub, Inspector
from diagrams.aws.integration import Eventbridge
with Diagram("AWS Security Services Data Flow", show=False, direction="TB"):