šŸ“¢ Use Case ExplanationĀ¶

I like to use a very specific domain name when I demo [CyberArk Conjur](https://conjur.org) because itā€™s easier for me to remember and it also looks better to the customer. Even so, if it doesnā€™t look good to them ā€“ it still looks better to me!

I noticed quickly that when Iā€™d set the public IPv4 address of my [AWS](https://aws.amazon.com) [EC2](https://aws.amazon.com/ec2/) instance that I demo from to an A record for cdemo.cybr.rocks in [Cloudflare](https://cloudflare.com)ā€™s DNS, itā€™d be good for that Instance running. However, after I stopped the EC2 instance and, eventually, restarted it again, it boots with a different public IPv4 address.

Now, Iā€™m sure I could just use an [Elastic IP](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) and assign it and call it a dayā€¦ but that costs money ā€“ even when itā€™s not being used! I can save money, even over the Elastic IP lease, triggering the [AWS Lambda](https://aws.amazon.com/lambda/) function only when my _Instance State_ changes.

Finally, to the use case: upon a defined Instanceā€™s _Instance State_ changing to ā€œRunningā€, grab the defined Instanceā€™s public IPv4 address and update a defined [A record](https://support.dnsimple.com/articles/a-record/) in Cloudflareā€™s DNS.