I ran into a situation where I had a number of resources in a CloudFormation stack that may already exist, or I might want to make creation of those objects optional.

To achieve this it turns out that CloudFormation actually has a nice facility, although it is a bit awkward.

In this particular case, I have a stack that creates a CloudFront distribution for a wildcard domain. The stack includes creating the certificate, but I realized that when I go to production with this, I will have an existing certificate that will be used, so there won’t be a need to create a new one.

So in my stack, I added a parameter for the ARN of an existing certificate which looks like:

Notice that I set the default to an empty string, which implies my default scenario, I won’t use an existing certificate, but instead create one.

Then I need a condition statement which I can use later in the stack.

What this says is give me a condition that will be true if the parameter of ACMARN is equal to an empty string. I named it CreateCertificate to make it descriptive to the action that this will have. So if there is a value in ACMARN, then CreateCertificate will be false.

With that I update my certificate creation in the Resources section to be optional.

The “Condition” will only create the certificate if the ARN was not set.

So finally I also need to put a condition in the distribution creation that will use the ARN from the parameter, OR the new certificate, which I use an Fn::If for.


Rob Weaver

A few weeks back, I was walking to the store. It’s a short walk (about 3/4 of a mile) with a very slight grade. I walk a lot, usually a few miles a day, mostly by choosing to walk while waiting for the train, or when going to the market.

This time, when I got almost to the store, I started having some chest pain. I thought maybe I was feeling the precursor to a heart attack, or that maybe that bug from last week had turned into pneumonia. I hadn’t been walking that briskly, and I was really out of breath in addition to the pain (both of which were odd for me, especially since I had walked relatively slowly).

Naturally, I immediately made an appointment to see my doctor (although in hindsight I probably should have gone to the ER). He saw me, had an EKG machine brought in, and didn’t see anything, but referred me to cardiology to get a stress EKG.

Continue reading

Graph of coverage

Most of my career was spent in healthcare, working in IT for providers, coordinating third party payments, and being a consumer battling with crazy multi-layered payment systems. I was lucky enough to be healthy in my youth and get by without insurance (although my feet still point in different directions thanks to breaking my ankle and not going for treatment).  I have clear experience with seeing how the system is so badly broken, and it seems to me we’re not addressing the actual problems.

I feel like people miss the point of the ACA, which was a first draft at controlling costs and a start to healthcare reform. I also believe that repealing it will do more damage than simply starting to address the shortcomings and work on reforming the actual problem.

Continue reading

I occasionally run into weird permission problems after a restore of files and folders on my machine, I think it has to do with OSX trying to protect me from myself.

Today I needed to fire up my coding environment on my Mac Mini, so I jumped into the folder for the code that I wanted to update using SourceTree, and did (what I thought was going to be) a quick pull, only to get a weird error message.

I figured it was probably something goofy, so I went to the command line, only to get another weird error:

Well, I’ve seen that before, and knew that message was probably because I’ve updated the OS a few times since I last coded. Basically it means the XCode command line tools are missing. Fixing that is easy: just run:

This fires up the Xcode installer, which will ask you if you want to install Xcode, or just the command line tools. In this case I don’t need Xcode, so I chose the latter.

That took a pretty long time (it was on “about a minute left” for at least 10 minutes), which was a bit worrisome, but not all that unusual.

Going back to the command line, I tried to do my “git pull” only to get another error:

OK, weird – why can’t it write that. Found a few things online that suggested running “git gc” might fix it, so I tried that, but that just gave me this error:

More curious Googling, and finding the suggestion to look at the extended file permissions, so I tried that:

Wait, what’s this “group:everyone deny delete” ? Well, no wonder I can’t run stuff that updates these folders. More Googling and I find the right switch for chmod to clear out the extended permissions:

Note that I had the two flags reversed the first time and the command told me it couldn’t find a file named “-R”. After running the above, the folder permissions looked more normal:

And my commands worked as expected.

Sometimes I get my branch in a state where I need to reset things to what is on the server. Most of the time a simple switch of branches is enough to get everything back in shape, but once in a while I need to actually reset to what is in the parent repo.

To reset your local working copy to exactly what is in the remote (typically called origin) do the following:

These should be done in the root of your project.

I needed to do some work on an old Maven project I have that I’ve worked on for years, and when I fired up my handy Netbeans IDE and ran the obligatory “priming build”, I was surprised to get an error on one of the basic Maven plugins. Continue reading

For testing, sometimes I need to validate web behaviors like redirects on SSL, and one of the reasons I love the Mac is that it gives me a ready to roll Apache server. I actually run a local copy of my web site on my Mac, and have it set up as a virtual host so that I can just browse directly to it. Continue reading

Two years ago, I moved to Salt Lake City for work. After looking around a bit for a rental property close to my new work, it became clear that I would be better off trying to buy a new home than renting if I could afford to do so. At the time the interest rates and property values in Salt Lake City were very low, so monthly mortgage payments were often cheaper than rental prices.Screen Shot 2015-04-25 at 9.22.15 AM

Sitting at the Salt Lake Roasting Company after we first moved here, we found a really nice real estate agent (Jaral Ferwerda).  I worked with him diligently to find a home while my lovely wife was buttoning up our home in California.

After a while, I started to find it very difficult to keep track of all the homes I was seeing. They started to blur together, and I wasn’t really able to figure out which one I liked best.

Continue reading

I created a WordPress site for a client who needed to support both English and Español versions of their content, which involved using a plugin called MultilingualPress that creates relationships between sites for each language.

I developed the site locally on my server, and then after they created some content, migrated it to their hosting service.

Continue reading

I get a chuckle over this every time it happens. Something in one of the many synch tools I use does some sort of conversion of birth dates, and I end up with alerts on my Mac that tell me somebody is having a really great birthday:

Screen Shot 2015-01-25 at 10.46.55 AM

I also see the opposite where I’ll get a reminder that today is somebody’s second or third birthday.

In the case of the ones where they show up younger, it’s usually because wherever I got their birthdate from originally, they didn’t put in the year. So that usually ends up being the year that the contact was entered into my address book.

But in the case of the incredibly old dates, my address book typically has an 1800’s date, so my guess is it’s some system breaking on a date overrun. I’ve also noticed that sometimes these contacts have two birth dates in my address book (again, some symptom of a synch problem), so for instance Reinald has both a birthday in the 1800’s and one a littler more reasonable than that.

Screen Shot 2015-01-25 at 11.24.02 AM