Working with AWS App Runner

Working with AWS App Runner
October 26, 2022
Working with AWS App Runner

Working with AWS App Runner

AWS App Runner is a service that provides customers with a fast, secure, and simple way to deploy their applications on AWS without managing the infrastructure. Customers only need to provide the container images or code, and the App runner will build, deploy, update the app on changes made to the code, load balance, and automatically scale up & down based on demand. It also monitors the health and delivery of encryption.

We use code sitting in the GitHub repo to deploy our application via App Runner.

Prerequisites:

Before continuing, we have some prerequisites to set up. First, fork the repo present here.

Here, we create a DynamoDB table to cache the data, which is fetched from the GitHub API and also present in the repo. The following table reduces the number of calls made to GitHub.

The template present in the repo also has an IAM role.

Setup App Runner Service with DynamoDB

1. Go to the AWS console and search for App Runner. If you don’t have any applications running, there will be a ‘Create an App Runner service’ button. Click on it.

service create appRunner

2. Next, we connect AWS App Runner to GitHub. Please confirm that you have set up prerequisites before continuing.

When completing the first step, in the console, you will be prompted to first select one of the two options for deployment, either to select a container registry-based deployment (‘Container registry’) or a code repository based (‘Source code repository’). Choose ‘Source code repository’.

source & deployment

3. Next, in the ‘Connect to GitHub’, click ‘Add new’. A popup window will appear, which will prompt you to input GitHub information or to connect to an existing repository. Install a GitHub app with access to the repository you forked previously with the same username.

service link github

4. Next, we move on to the Deployment settings. Here, we have two options: Manual and Automatic. With Manual, you start each deployment using the App Runner console or AWS CLI. With Automatic, every push to your main branch deploys a new version. We chose ‘Automatic’. Now, click Next.

deployment settings

5. Now we specify the Build Settings. In this section, you can see the level of control App Runner gives you. Alternatively, later we can provide a configuration file for these settings, which is present in the same repository forked earlier. To configure the settings via the App Runner console, choose ‘Configure all settings here’.

build and Deployment

Under the Build command, enter:

pip install pipenv && pipenv install

Under the Start command:

pipenv run flask run -h 0.0.0.0 -p 8080

And, for port:

8080

Click Next.

6. Now we Configure service.

configure Service

7. In the next security section, give the role name for that you get from the CloudFormation output which was launched from the prerequisites.

cft output

Click Next. Review and hit the Create & Deploy button.

8. Once the status of the service reaches completion, then to view the application, hit the ‘Default domain’.

9. Next, if you want to check if the changes made to the application code will be reflected in the application, change the code in the html and commit. Once the changes are committed, then you can see it in the Activity section.

10. Once the changes turn from Operation in progressto Running, you can go to https://[DOMAIN_HERE]/repo//repostatus-gh-demo in the browser and see the changes.

11. Clean up the environment after testing the environment more.

Cloud Computing Insights and Resources

Challenges Faced by Gaming Companies While Adopting Cloud Services

Challenges Faced by Gaming Companies While Adopting Cloud Services 

With the advancement in technology and the progress in cloud infrastructure, the cloud gaming industry is growing at a lightning …

Challenges Faced by Gaming Companies While Adopting Cloud Services  Read More »

5 Trends in Data Analytics Impacting the Cloud World 

5 Trends in Data Analytics Impacting the Cloud World 

What is Cloud data & analytics?  Cloud analytics is the process of analysing data stored in the cloud. It is …

5 Trends in Data Analytics Impacting the Cloud World  Read More »

How Microsoft Azure Cloud Services Different From Competitors

How Microsoft Azure Cloud Services is Different From its Competitors?

Microsoft Azure is one of the eminent cloud computing platforms in the market created by Microsoft for building, deploying, and …

How Microsoft Azure Cloud Services is Different From its Competitors? Read More »