InfraCopilot

The Intelligent Infra-as-Code Editor

Meet the most advanced infrastructure design tool that understands how to define, connect, scale your infrastructure-as-code

Powered by KlothoEngine v0.72



Create Long Running Service (pgAdmin) using ALB, ECS, and RDS

Welcome! The purpose of this page is to create an architecture and deploy pgAdmin to it. We'll walk you through the steps to create a new deployable architecture on AWS using ALB, ECS, and RDS.

Architecture

If this is your first architecture, take a look at the Getting Started Guide. When we're done, we'll have created the following architecture:

full-arch

Step 1. Drag in a Load Balancer

  • Locate the Load Balancer resource in the left sidebar
  • Drag it onto the canvas

loadbalancer

Step 2. Drag in an ECS Service

  • Locate the ECS Service resource in the left sidebar
  • Drag it onto the canvas

ecs-service

Step 3. Drag in an RDS Instance

  • Locate the RDS Instance resource in the left sidebar, by default this will be a Postgres instance
  • Drag it onto the canvas

rds-instance

Step 4. Configure the Load Balancer

  • Select the Load Balancer by left-clicking it
  • On the right side-bar ensure that the config tab is selected

config-loadbalancer

  • Set the Scheme config to be the value internet-facing
  • Click Apply Changes in the lower right

Step 5. Connect the Load Balancer to the ECS Service

  • Hover over the Load Balancer and click and drag the purple arrow to the ECS Service icon

loadbalancer-ecs-connect

Step 6. Connect the ECS Service to the RDS Instance

  • Hover over the ECS Service and click and drag the purple arrow to the RDS Instance icon

full-arch

Step 7. Configure the ECS Service

  • Select the ECS Service by left-clicking it
  • On the right side-bar ensure that the config tab is selected

config-ecs-task

  • Set the base image to be dpage/pgadmin4
  • Add 2 additional environment variables by hitting the + at the bottom of the list. The key and values should be:PGADMIN_DEFAULT_EMAIL = <your email> and PGADMIN_DEFAULT_PASSWORD = <your temporary password>
  • Click Apply Changes in the lower right

Step 8. Configure Health Checks

  • Click the edge between the Load Balancer and ECS Service
  • On the right side-bar select the "Additional Resources" tab
  • Click on aws:target_group:<your load balancer name>
  • On the right side-bar select the config tab

config-healthchecks

  • Set the Health Check > Path field to be /login
  • Click Apply Changes in the lower right

Step 9. Export IaC (Pulumi)

  • Click the Export IaC button on the top of the screen, this will download a zip file with the name of your architecture containing all the IaC to deploy it.

export-iac

Step 10. Local Docker, Pulumi, and AWS Setup

  • Create an AWS user with admin permissions
  • Follow the Pulumi guide to setup Pulumi with AWS using your credentials
  • You'll also need to install Docker for building a container and fetching images from DockerHub

Step 11. Deploy to AWS

  • Extract the IaC from the zip file
  • Navigate to the directory
  • Run npm install
  • Run pulumi stack init
  • Give your stack a name
  • Optionally specify a passphrase
  • Specify your region pulumi config set aws:region us-east-1 change us-east-1 to whichever region you desire
  • Create a custom username and password for your first database by running: pulumi config set --secret klo:rds-instance-4-username <dbuser> and pulumi config set --secret klo:rds-instance-4-password <dbpassword> replacing <dbuser> and <dbpassword> with your desired values
  • Run pulumi up
  • Review the plan and type yes to deploy
  • Grab the load_balancer_0_DomainName as well as the rds_instance_4_Address that were reported after pulumi up completed
  • Although the stack is up it may take time for certain configuration and changes to propograte

Step 12. Access pgAdmin

  • Navigate the load_balancer_0_DomainName we captured in the previous step
  • Login using the email and password you specified in Step 7

pgadmin-login

Step 13. Connect pgAdmin to your database

  • Click on Add New Server
  • Set the Name to mydb in the general tab
  • Navigate to the Connection tab

pagadmin-connection

  • Set the hostname to the database hostname we captured in Step 11
  • Set the username to the username we specified in Step 11
  • Set the password to the password we specified in Step 11
  • Click Save
  • You should now see your database and can access it using pgAdmin

pgadmin-connected

Step 14. Tear down Infrastructure

  • From the same directory pulumi destroy
  • Confirm with yes

Step 15. Share Feedback

We look forward to seeing what amazing things you build. If you get stuck or want us to support a capability, please join our Community Discord, where the whole team hangs out and is happy to help.

Take your infrastructure copilot for a test flight

Frequently Asked Questions

We may have an answer for you. Here are some of our common FAQs:

How is the infrastructure-as-code being modified or generated?

InfraCopilot is powered by the Klotho engine, an adaptive architectures compiler that undertands cloud architectures and is able to reshape them. NLP is used only to interpret the user intent.

Klotho is the Wolfram Alpha of infrastructure.

What cloud services and providers do you support?

AWS support is now in early access, with Azure and Google Cloud support coming soon. For the latest up-to-date list of supported services, ask the Copilot!

How much does this cost?

We're focused on building a tool that makes your work more enjoyable. We haven't decided on a business model yet, but we do know InfraCopilot will always have a free tier. We'll have more to share in the coming months.

How can I contact you?

You can reach us on Twitter , Discord and LinkedIn !

Can I contribute to the project?

Yes! Klotho is open-source, join us on Discord and we'll help you get up and running!

Copyright © 2023 CloudCompiler Inc