Two of the most common requests in this job are "undo that" and "make it public." Both sound like a single action. Neither one is. Day 27 was the day both of those turned out to be several things wearing one word.
One Git task, one AWS task. Revert a commit that has already been pushed, then configure a VPC so an EC2 instance inside it can actually reach the internet. The tasks come from the KodeKloud Engineer platform.
Revert: the undo that leaves a record
Git gives you two ways to undo a commit, and picking the wrong one is how teams end up in a bad afternoon.
cd /usr/src/kodekloudrepos/<repo>
git log --oneline
git show <commit-id> # read it before you undo it
git revert <commit-id> --no-edit
git push origin master
git revert does not delete anything. It writes a new commit whose content is the exact inverse of the one you targeted. The original stays in the history, followed by a commit that undoes it. Two entries where you might have expected zero.
That feels wrong at first, and it is the entire point. Compare it to git reset, which moves the branch pointer backwards and rewrites what happened. Reset is genuinely useful and a local-only tool. The rule underneath both:
Never rewrite history you have already pushed.
Once a commit is on the remote, other people may have pulled it. Reset it away, force-push, and their next pull is a reconciliation problem they did not ask for. Revert is the version that is safe on shared history, because it only ever adds.
The history reads a little strangely afterwards β "did a thing", then "undid a thing" β and that honesty is the feature. Hiding the mistake is what the dangerous option does.
Two things that catch people. Reverting a merge commit fails unless you specify which parent is the mainline with -m 1. The error message reads like a bug the first time you hit it. And revert is itself revertible: revert the revert and you have reapplied the original change, with both moves on the record.
Public subnets: there is no public checkbox
The AWS task was making a VPC subnet genuinely reachable, and the first useful thing to internalise is that "public subnet" is not a setting. Nothing in the console is labelled public. A subnet is public if, and only if, its route table has a 0.0.0.0/0 route pointing to an Internet Gateway. That is the whole definition.
Which means it takes four separate pieces of wiring:
# 1. Create the gateway
IGW_ID=$(aws ec2 create-internet-gateway \
--query 'InternetGateway.InternetGatewayId' --output text)
# 2. ATTACH it β an unattached IGW does nothing and says nothing
aws ec2 attach-internet-gateway --internet-gateway-id $IGW_ID --vpc-id $VPC_ID
# 3. Route table with a default route to the gateway
aws ec2 create-route --route-table-id $RTB_ID \
--destination-cidr-block 0.0.0.0/0 --gateway-id $IGW_ID
# 4. Associate that route table with the subnet
aws ec2 associate-route-table --route-table-id $RTB_ID --subnet-id $SUBNET_ID
# and instances need an actual public address
aws ec2 modify-subnet-attribute --subnet-id $SUBNET_ID --map-public-ip-on-launch
Every VPC comes with a main route table that has only the local route and no path to the internet. A subnet you have not explicitly associated falls back to it, which is exactly why a freshly created subnet is silent.
Here is the part that makes this genuinely awkward to debug: miss any one of those steps and the symptom is identical. No error, no warning, just an instance that cannot reach anything. Creating an Internet Gateway and forgetting to attach it produces no complaint at all. Neither does a perfect route table that was never associated with your subnet.
So the only honest verification is from inside:
ssh ec2-user@<public-ip>
curl -I https://aws.amazon.com
Everything before that is configuration you believe is correct.
Worth knowing the mirror image: a private subnet that needs outbound-only access uses the same shape with a NAT Gateway as the route target instead of an IGW. Same four steps, different destination.
One word, several moving parts
"Undo it" is either an additive commit or a rewrite of shared history, and the difference decides whether your teammates have a good morning. "Make it public" is four separate resources that all have to agree, none of which is named public. In both cases, the word is a summary, and the summary is what hides the work.
So here is the Day 27 question. When someone asks you for a one-word change, do you know how many things that word is actually standing in for?
Day 27 down. Seventy-three to go.
Top comments (1)
Okay this was actually a pretty good read π The undo isnβt a switch part is so real, especially with AWS. The Git revert comparison made it super easy to get. Lowkey learned something new from this one π