terraform depends without depends_on

Terraform depends pattern without depends_on. Or how to use hcl to leverage its interal dependancy handling, to to hard things for you. We are going to use an example of an aws sqs queue, dlq, and queue policy all strung together. The issue that I ran in to was I wanted to create all of these using a single list of words as my seed values. Then the issue arose around using a for_each with a dynamic resource group when terraform would need group 1 to be appied before it knew what to setup for group 2....

2023-02-10 · 3 min · 515 words · Mike Fettis

ec2, meta-data

Yea it has been a long time since I wrote notes and things but I feel like there are some things to take note on. EC2 things of interest reading the userdata of an instance There are plenty of times that I need to see what the userdata looks like of my instance. ssh into the box. curl http://169.254.169.254/latest/user-data simple as that curl http://169.254.169.254/latest/user-data #!/bin/bash .... rerunning userdata You should really never rerun userdata but if you are debugging things and need to do things....

2020-02-19 · 1 min · 98 words · Mike Fettis

git codeowners gpox

Some git notes I like git I user git a lot, I did not know about CODEOWNERS, this is a nice feature. automatic PR approver to a repo Adding codeowners can allow for automatic PR approvers for branches or all things github.com about-code-owners You can use a CODEOWNERS file to define individuals or teams that are responsible for code in a repository. To use a CODEOWNERS file, create a new file called CODEOWNERS in the root, docs/, or ....

2019-11-12 · 2 min · 318 words · Mike Fettis

ebs grow

need moar ebs AWS EBS volumes. Yes I know that everything in AWS should be immutable and disposable. But sometimes they aren’t. We don’t need to go into the philosophical rammifcations of that what we need is a fix. First we find the instance, then the volume, then we grow the volume in aws, then we grow the volume on the box Lets go and describe the instance $ aws ec2 describe-instances --filters Name=tag:Name,Values='MyMagicServer' | jq '....

2019-08-20 · 2 min · 359 words · Mike Fettis

2018-10-05 splunk-power-mains

splunking home power What happens when you take Splunk, a wireless smart meter and an api interface? Splunking your entire home’s power main, without touching a single power wire! This allows a whole house view of all the power being drawn in real time. The only requirements are raspberry pi on a network, a splunk instance somewhere and a usb adapter plugged into the PI. Hold on, hold on, whats a smart meter?...

2018-10-05 · 5 min · 1039 words · Mike Fettis

2018_10_03_splunk-things

splunk things windows event codes widnwos event codes are impossible to remember luckily there is a lookup out there https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/default.aspx Lookup from github windows event code stuff, there is also a ton of other windwos docs in there… https://github.com/MicrosoftDocs/windowsserverdocs/blob/master/WindowsServerDocs/identity/ad-ds/plan/Appendix-L--Events-to-Monitor.md splunk and docker https://github.com/splunk/docker-splunk https://github.com/splunk splunk and git https://github.com/Kintyre/ksconf http://www.kintyre.co/uploads/1/0/7/2/107288911/managing_splunk_deployment_with_git_-_philly_splunk_meetup_-_june_2018.pdf

2018-10-03 · 1 min · 49 words · Mike Fettis

2018_09_27_wifi_things_docker_things

wifi on mac Sometimes you want to know what wifi network you are on from the terminal or in bash for some reason. this can be done with airport and then a little bit of awk loc=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}') echo $loc docker env variables There are these things called build arguments in docker. Sometimes you will want to pass arguments based on your environment....

2018-09-27 · 1 min · 121 words · Mike Fettis

2018_09_18_wiping-git

removing git history sometimes you jsut want to wipe everything from a git repo but you want to hold on to the files. We can do this by following this pattern: – Remove history rm -rf .git – recreate the repos from the current content only git init git add . git commit -m “Initial commit” – push to the github remote repos ensuring you overwrite history git remote add origin git@github....

2018-09-18 · 1 min · 115 words · Mike Fettis

2018-08-28 kerberoasting

Kerberoasting! Lets talk about some old security here. Kerberos! This is a couple years old but sadly still works. Kerberos is the authentication system for windows and ad networks. There is an exploit that allows us to get back a poorly encrypted hash of valuable logins all directly from the domain controller, this is done once you have an authenticated user, so it isn’t the main way in but once you have a foothold you can pivot to a more useful account....

2018-08-28 · 3 min · 623 words · Mike Fettis

2018-08-27 router modding

router hacking These instructions are only intended for the purpose of being able to install legally licensed firmware on routers you own. Do not use this guide as instructions for violating any patents or copyright laws There is a router out there known as T-Mobile (AC-1900) which is a rebranded ASUS AC1900/68u. The tmobile router sells for $70 and the asus router sells for $130–$170. Whats the difference between these two?...

2018-08-27 · 6 min · 1140 words · Mike Fettis

2017-03-09 cia, hacking, , struts, ripgrep, z

cia hacking The cia had their hacking tools dumped on the web, no way who would have guessed they had these tools, of course they do and they have. schneier wikileaks_relea mkdir whole paths mkdir -p a/b/c makes the WHOLE path woooo!!! struts 0-day who likes 0-days 0-days happen this one looks fun apache-struts-framework z A tool to jump around directories easily in the terminal with this thing called z github repo z...

2017-03-09 · 1 min · 89 words · Mike Fettis

2017-03-06 git, splunk, lastpass-cli

git Git should know better and totally commit and add files that I was working on last night. I left an uncommited file sitting on a laptop at my house when I went to work today… Rookie mistake. for ALL the repos $ git config --global user.name "John Doe" $ git config --global user.email "john@doe.org" only for oen repo $ git config user.name "John Doe" $ git config user.email "john@doe.org" git aliases are cool add to your ....

2017-03-06 · 2 min · 233 words · Mike Fettis

2017-03-07 markdown, confluence, mac admin accounts

confluence confluence supports some version of markdown, however it is not super compatabiole with jekyll. There is a quick little ruby script that converts your .md files into a text that confluence can handle. markdown2confluence resetting admin passwords on a mac. I was reminded of this loophole topday and though I woudl write it down. how-to-create-a-new-administrator-account PROCEDURE 1. BOOT INTO SINGLE-USER MODE Turn on the computer. Upon hearing the startup chime, hold the key combination CMD+S....

2017-03-06 · 3 min · 595 words · Mike Fettis

2017-03-03 coffee roaster

roast Info using the kill-a-watt attached to the router for exact wattage measurements on my 1200 watt poppery II. full heat is 1000 watts with the heating coils fully isolated. Also there is a basic high temp thermometer that is simply dropped in the top ambient air temp is 68 degrees with 25% humidity preheat to 275 which is stable heat at 650 watts fan should be run at 100% but can dial down subtly in order to finely adjust the temps |—+—+—|...

2017-03-03 · 8 min · 1655 words · Mike Fettis

2017-03-02 docker, bash, coffee

docker reboot Every once and a while for prem docker installation a reboot is needed. There are some tools out there that can most likely do this, but today a quick and dirty bash script solved the problem. Step one dump all the running container IDS, today there were about 23 containers running. docker ps -q >>ids Next reboot sudo reboot Finally the bash script to quickly spin them all back up....

2017-03-02 · 1 min · 154 words · Mike Fettis

2017-03-03 ssh, bash

bash ssh keys Good to remember if you have ssh keys setup the .ssh folder is 700 and the authorized_keys file is 644 SSH keys are a public and private key that you store on a host that you are going to ssh in to. This key allwos fo r aecure login without having to relay a password through the terminal. It is a more secure form of authentication that the basic username and password....

2017-03-02 · 1 min · 107 words · Mike Fettis

2017-02-28 ELK? aws and openvpn

ELK There is this thing called elk, and I have no idea how to use it. I don’t even know where to being with ELK. I have been using splunk for years, I know how ot do all of this in splunk. But because the data I need is in elk and i cannot easily get it in to splunk I will have to at least start with elk and then go from there....

2017-02-28 · 1 min · 207 words · Mike Fettis

2017-03-01 js, karma, protractor, npm, bash, akamai

javascript and node No more just adding things to the package.json HA! To add an entry to your package.json's dependencies: npm install <package_name> --save To add an entry to your package.json's devDependencies: npm install <package_name> --save-dev version numbers and what they actually mean https://docs.npmjs.com/getting-started/semantic-versioning Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x testing How fast can I fill in all the holes for TDD… not fast enough apparently ;)...

2017-02-28 · 2 min · 330 words · Mike Fettis

2017-02-27 nginx, splunk, docker, git

Splunk and nginx Doing some splunkjs work from a docker container, and hosting it out of nginx, which means I needed to configure a proxy pass using some load balancing in order to access the splunk cluster, this was a little tricky because of session persistence and https. nginx load balancing Luckily there are some good pslunk blogs out there that help out configuring-nginx-with-splunk-rest-api-sdk-compatibility and some good reading about splunkjs read them both using-the-splunkjs-stack-part-1...

2017-02-27 · 1 min · 180 words · Mike Fettis

2017-02-26 google, analytics, fitbit, dod, open source

February in Chicago can be less than sunny, although the sun came out today google analytics seems pretty easy Log in to the google page and create a site google page. Then add the tracking code to the jekyll theme and bam site tracking. fitbit There has been research done around the accuracy of optical heart rate monitors. I knew they were not accurate up past 150 bpm. This is because the blood is flowing too fast for the sensor to keep up with....

2017-02-26 · 2 min · 384 words · Mike Fettis