Skip to content

Instantly share code, notes, and snippets.

Josh Padnick josh-padnick

View GitHub Profile
View gist:a0ae497d19508c9512018d8b2c9e17d8
=== RUN TestOsHardeningXFS
TestOsHardeningXFS 2018-11-21T06:02:13Z region.go:72: Looking up all AWS regions available in this account
TestOsHardeningXFS 2018-11-21T06:02:15Z region.go:57: Using region ap-northeast-2
TestOsHardeningXFS 2018-11-21T06:02:15Z key_pair.go:31: Generating new public/private key of size 2048
TestOsHardeningXFS 2018-11-21T06:02:20Z keypair.go:49: Creating new Key Pair in EC2 region ap-northeast-2 named AAsSgo
TestOsHardeningXFS 2018-11-21T06:03:08Z command.go:52: Running command ./packer-build.sh with args [-var ami_module_security_version_type="branch" -var vpc_id="vpc-32e3025b" -var should_create_keypair="0" -var aws_region="ap-northeast-2" -var ami_builder_source_ami="ami-0076ae0908f382581" -var ami_builder_source_ami_ssh_username="ec2-user" -var ami_ebs_volume_size="25" -var ami_github_oauth_token="<REDACTED>" -var ami_partition_fs_type="xfs" -var ami_module_security_version="master" -var ami_builder_keypair_private_key="-----BEGIN RSA PRIVATE KEY-----\nREDACTED\n-----END RSA PR
@josh-padnick
josh-padnick / example
Last active Nov 12, 2018
Terraform here doc syntax example
View example
user_data = <<-EOF
#!/bin/bash
echo "hello world" > index.html
nohup busybox httpd -f -p "8080" &
EOF
@josh-padnick
josh-padnick / confluent-main.tf
Created Jun 3, 2018
Terraform Module depends_on, Part Deux
View confluent-main.tf
# This file should be at /confluent/main.tf
variable "kafka_cluster_deployment_done" {}
module "confluent_tools" {
source = "../server-group/"
rolling_deployment_done = "${var.kafka_cluster_deployment_done}"
}
@josh-padnick
josh-padnick / tf-bar.tf
Last active May 31, 2018
Hack for Terraform Module depends_on
View tf-bar.tf
# This file would need to be in its own folder like /tf-bar/main.tf
variable "bar" {
default = "foo"
}
resource "null_resource" "bar" {
triggers {
bar = "${var.bar}"
}
View gist:ef1677c29600abfa1c87ef3060b737d7
josh@pad-mac ~/g/s/g/g/p/t/tf-modules (kafka-status-check)> terraform apply
2018/05/31 13:24:29 [INFO] Terraform version: 0.11.7 41e50bd32a8825a84535e353c3674af8ce799161
2018/05/31 13:24:29 [INFO] Go runtime version: go1.10.1
2018/05/31 13:24:29 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2018/05/31 13:24:29 [DEBUG] Attempting to open CLI config file: /Users/josh/.terraformrc
2018/05/31 13:24:29 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/05/31 13:24:29 [INFO] CLI command args: []string{"apply"}
2018/05/31 13:24:29 [TRACE] module source: "../tf-foo"
2018/05/31 13:24:29 [TRACE] module source: "../tf-bar"
2018/05/31 13:24:29 [INFO] command: empty terraform config, returning nil
View gist:4b2dc841475a482ce2d601df461e1c92
kafka-standalone-ubuntu 2018/03/30 11:35:29 Error: Error applying plan:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 2 error(s) occurred:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 * module.zookeeper.module.zookeeper_servers.aws_launch_configuration.server_group: aws_launch_configuration.server_group: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 Please include the following information in your report:
kafka-standalone-ubuntu 2018/03/30 11:35:29
kafka-standalone-ubuntu 2018/03/30 11:35:29 Terraform Version: 0.11.5
kafka-standalone-ubuntu 2018/03/30 11:35:29 Resource ID: aws_launch_configuration.server_group
View Schema Registry Log Output
[2018-02-04 23:26:47,636] DEBUG Selector loop woken up from select, 1/3 selected (org.eclipse.jetty.io.SelectorManager:603)
[2018-02-04 23:26:47,637] DEBUG Queued change org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept@3b32c022 (org.eclipse.jetty.io.SelectorManager:481)
[2018-02-04 23:26:47,637] DEBUG Running change org.eclipse.jetty.io.SelectorManager$ManagedSelector$Accept@3b32c022 (org.eclipse.jetty.io.SelectorManager:526)
[2018-02-04 23:26:47,637] DEBUG onOpen NetworkTrafficSelectChannelEndPoint@3711c20b{/127.0.0.1:53908<->8081,Open,in,out,-,-,0/30000,null}{io=0,kio=0,kro=0} (org.eclipse.jetty.io.AbstractEndPoint:99)
[2018-02-04 23:26:47,637] DEBUG NetworkTrafficSelectChannelEndPoint@3711c20b{/127.0.0.1:53908<->8081,Open,in,out,-,-,0/30000,null}{io=0,kio=0,kro=0} idle timeout check, elapsed: 0 ms, remaining: 30000 ms (org.eclipse.jetty.io.IdleTimeout:151)
[2018-02-04 23:26:47,638] DEBUG new HttpChannelOverHttp@61c8edba{r=0,c=false,a=IDLE,uri=} -> NetworkTrafficSelectChannelEndPoint@3711c20b{/12
@josh-padnick
josh-padnick / script.sh
Last active Aug 31, 2017
Compute the number of hours used by a customer for a given date range in Zendesk
View script.sh
#!/bin/bash
# 1. Make sure obtain an API Token
# 2. This has only been validated to work with ZenDesk agents, not end users
# 3. Look up the customer's org ID by querying https://gruntwork.zendesk.com/api/v2/organizations.json
# 4. Look up the ZenDesk custom Field ID that stores the number of hours used by querying a complete ticket and inspecting the JSON output
# 5. This script all automatically sum the total of all numbers in the given month and ignore empty numbers.
zendesk_username="josh@gruntwork.io/token"
zendesk_password="<enter-your-api-token>"
@josh-padnick
josh-padnick / README.md
Last active May 17, 2017
Manually Edit AWS Console "Switch Role" Configuration in Bash
View README.md

Manually Edit AWS Console "Switch Role" Configuration in Bash

Motivation

At Gruntwork, we work with multiple software teams. That means we have to modify the "Switch Role" history multiple times. But the only way to do that today is to delete your cookie and clear all AWS Console saved settings. That got old after a while, so these instructions enable you to modify the "Switch Roles" configuration directly.

The Big Picture

@josh-padnick
josh-padnick / README.md
Last active Apr 15, 2017
Healthline Gist
View README.md

HealthLine Temp AWS Infrastructure Instructions

We setup a limited version of the infrastructure needed by HealthLine in AWS using Terraform.

Environments

This infrastructure has two environments:

  • mgmt: Contains a Bastion Host where you SSH to get access to everything else
  • stage: Contains an ECS Cluster running the gruntwork-sample-app
You can’t perform that action at this time.