Deploying infrastructure and applications can be complex, but using playbooks as step-by-step guides can standardize this process, albeit they are prone to human error. Declarative infrastructure, like Pulumi's Automation API, offers a solution by allowing users to declare the desired state of their infrastructure, which is then built by an infrastructure as code engine. This approach simplifies tasks such as application deployment and maintenance, areas where programming languages excel over templating languages. The article provides a hands-on demonstration of using Pulumi’s Automation API to automate infrastructure creation, application installation, and maintenance tasks, specifically showcasing a database migration example in Node.js. The example includes provisioning an AWS Aurora SQL database, performing database migrations, and adding functions for tasks like database backup and optimization while retrieving sensitive information securely from AWS Secrets Manager. By converting a playbook into code, the Automation API enables the use of modern software tools and practices, extending its functionality beyond the limitations of markup languages and proprietary CLI tools.