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
pipeline { | |
agent { | |
docker { | |
image 'hashicorp/terraform:latest' | |
label 'LINUX-SLAVE' | |
args '--entrypoint="" -u root -v /opt/jenkins/.aws:/root/.aws' | |
} | |
} | |
options { | |
ansiColor('xterm') |
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 | |
''' | |
Update/create a page containing a table w/ Confluence REST API | |
''' | |
import requests | |
import json | |
# Get api credentials from local config file |
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
provider "cloudflare" { | |
api_token = var.cf_api_token | |
} | |
variable "cf_api_token" {} | |
variable "account_id" {} | |
resource "random_id" "tunnel_secret" { | |
byte_length = 35 | |
} |
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
locals { | |
eks_oidc_issuer_url = "https://${module.eks_blueprints.eks_oidc_issuer_url}" | |
name = "external-dns" | |
} | |
data "tls_certificate" "eks_cluster" { | |
url = local.eks_oidc_issuer_url | |
} | |
resource "aws_iam_openid_connect_provider" "eks_provider" { |
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 sys | |
import os | |
import time | |
from watchdog.observers import Observer | |
from watchdog.events import FileModifiedEvent, FileCreatedEvent | |
import boto3 | |
import mimetypes | |
from botocore.exceptions import ClientError | |
# Create an S3 client |
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: trigger jenkins job | |
shell: "{{ lookup('template', 'trigger-jenkins.j2') }}" | |
delegate_to: localhost | |
- name: wait for job to complete | |
wait_for: | |
path: {{ lockfile }} | |
timeout: 600 |
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
# Find the IAM username belonging to the TARGET_ACCESS_KEY | |
import boto3 | |
from botocore.exceptions import ClientError | |
iam = boto3.client('iam') | |
def find_user(key): | |
try: | |
key_info = iam.get_access_key_last_used(AccessKeyId=key) |
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
## Meant to be scheudled on a cron/timer of 90 days (CIS Benchmark) | |
## The target keys need permissions to rotate themselves | |
import boto3 | |
from botocore.exceptions import ClientError | |
import os | |
from datetime import datetime | |
import shutil | |
from ConfigParser import SafeConfigParser |
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
{ | |
"processors": [ | |
{ | |
"remove": { | |
"field": [ | |
"agent.ephemeral_id", | |
"agent.hostname", | |
"agent.id", | |
"agent.type", | |
"agent.version", |
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
data "aws_caller_identity" "current" {} | |
resource "aws_s3_bucket" "terraform_state" { | |
bucket = "${data.aws_caller_identity.current.account_id}-tfstate" | |
versioning { | |
enabled = true | |
} | |
policy = <<POLICY | |
{ | |
"Version": "2012-10-17", |
NewerOlder