{"id":18411,"date":"2022-08-02T09:54:37","date_gmt":"2022-08-02T07:54:37","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=18411"},"modified":"2023-06-23T15:33:25","modified_gmt":"2023-06-23T13:33:25","slug":"step-by-step-running-angular-applications-in-aws","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/","title":{"rendered":"Step by Step: Running Angular Applications in AWS"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-what-is-aws-amplify\">What Is AWS Amplify?<\/h2>\n\n\n\n<p>AWS Amplify is a platform that allows web and mobile developers to build full-stack applications, deploy them in the Amazon cloud, and allow them to <strong>easily integrate with other Amazon services<\/strong>. Amplify supports a variety of development platforms including Angular, React Native, Flutter, and Vue.&nbsp;<\/p>\n\n\n\n<p>Technically, <strong>AWS Amplify is a JavaScript library<\/strong> that makes it possible to build and deploy serverless applications. Amplify lets you configure a web or mobile back end, connect an application, use a visual builder to create the front end UI, and deploy the application to production.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-aws-amplify-components\">AWS Amplify Components<\/h3>\n\n\n\n<p>AWS Amplify has the following main components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Library<\/strong>\u2014allows your application to add AWS cloud services and interact with them<\/li>\n\n\n\n<li><strong>UI<\/strong>\u2014an interface that lets you assemble pre-built UI components, including authentication, that are compatible with cloud workflows in AWS Amplify.&nbsp;<\/li>\n\n\n\n<li><strong>CLI<\/strong>\u2014Amplify provides simple CLI commands that let you make changes to cloud services used by the application and modify the AWS-managed back end on the fly.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-key-features\">Key Features<\/h3>\n\n\n\n<p>Here are some of the key features <a href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/aws-vs-azure-cost-comparison\/\" target=\"_blank\" aria-label=\"AWS  (opens in a new tab)\" rel=\"noreferrer noopener\" class=\"ek-link\">AWS <\/a>Amplify provides for application developers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Authentication<\/strong>\u2014you can easily define onboarding flows for end users. Amplify offers a managed user directory with built sign-up, sign-in, forgot password, and multi-factor authorization capabilities.<\/li>\n\n\n\n<li><strong>Fast backend updates<\/strong>\u2014because AWS Amplify is serverless, you can make changes to the back end configuration easily and they are immediately updated in production applications.<\/li>\n\n\n\n<li><strong>Artificial intelligence and machine learning (AI\/ML)\u2014<\/strong>Amazon provides a wide range of AI\/ML services and capabilities. You can use AWS Amplify to quickly integrate your application with services like Amazon SageMaker.<\/li>\n\n\n\n<li><strong>Storage<\/strong>\u2014AWs Amplify provides managed storage both for application content and <a href=\"https:\/\/cloudinary.com\/blog\/file_upload_with_angular_or_angularjs_to_cloudinary\">user file uploads<\/a>, including photos and videos. Content can be securely stored on the end user\u2019s device and <a href=\"https:\/\/aws.amazon.com\/amplify\/storage\/\">synchronized to Amazon cloud storage<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-aws-amplify-costs\">AWS Amplify Costs<\/h2>\n\n\n\n<p>When you use the Amplify framework, which includes libraries, CLI, and UI components, you pay only for the underlying AWS resources you use. There are no additional charges for the Amplify framework itself.<\/p>\n\n\n\n<p>However, there is a cost to building, deploying, and hosting your applications. Build and Deploy operations cost $0.01 per minute, Hosting costs $0.15 per GB, and cloud storage for your applications is priced at the standard Amazon S3 rate, $0.023 per GB.<\/p>\n\n\n\n<p>As a new AWS Free Tier customer, you get 1,000 free builds and deployments per month, 15 GB of bandwidth per month, and 5 GB of writable data storage per month. However, keep in mind that cloud costs can quickly get out of control. You can use the Amazon Cost Calculator to <a href=\"https:\/\/cloud.netapp.com\/blog\/aws-cvo-blg-aws-cost-management-9-free-tools-to-help-cut-your-costs\">manage your AWS costs<\/a> and determine the cost of AWS Amplify and other services or resources required for your application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-tutorial-building-and-testing-an-angular-app-with-aws-amplify\">Tutorial: Building and Testing an Angular App with AWS Amplify<\/h2>\n\n\n\n<p>This tutorial is abbreviated from the official <a href=\"https:\/\/docs.amplify.aws\/start\/getting-started\/installation\/q\/integration\/angular\/\">AWS Amplify tutorial<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-building-an-angular-app\">Building an Angular App<\/h3>\n\n\n\n<p>Before starting, make sure the following technologies are installed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Node.js (v14.x or higher)&nbsp;<\/li>\n\n\n\n<li>npm (v14.4 or higher)&nbsp;<\/li>\n\n\n\n<li>git (v2.14.1 or higher)<\/li>\n<\/ul>\n\n\n\n<p>Ensure you have an AWS account with which you can sign in. Create an account if you don\u2019t have one.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-install-aws-amplify-cli\">Install AWS Amplify CLI<\/h4>\n\n\n\n<p><strong>To install and configure AWS Amplify:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the terminal and use the following command to install Amplify CLI:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">-g<\/span> <span class=\"hljs-keyword\">@aws-amplify<\/span>\/cli<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Use the following command to configure AWS Amplify for this demo:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">amplify configure<\/code><\/span><\/pre>\n\n\n<p>The terminal will ask for the preferred AWS region and the username for a new IAM user.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Head to the AWS Console to complete the IAM user creation process through the <strong>Add User <\/strong>option. Copy down the <strong>Access Key ID<\/strong> and <strong>Secret Access Key<\/strong> once the user is created.<\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>When the prompt asks, put in Access Key ID and Secret Access Key.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-set-up-the-angular-app-and-its-aws-amplify-backend\">Set up the Angular App and Its AWS Amplify Backend<\/h4>\n\n\n\n<p><strong>To create a demo Angular app:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Use the following command to bootstrap a new Angular app in Amplify CLI and go to the main directory:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">npx -p @angular\/cli ng <span class=\"hljs-keyword\">new<\/span> amplify-app\ncd amplify-app\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When prompted, type Y to the question about adding Angular routing.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>This tutorial creates an Angular demo app that stores a to-do list of tasks. Add the following module imports and declarations for the Angular app in src\/app\/app.module.ts:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> { BrowserModule } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@angular\/platform-browser'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { NgModule } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@angular\/core'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { AmplifyUIAngularModule } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@aws-amplify\/ui-angular'<\/span>;\n\n<span class=\"hljs-keyword\">import<\/span> { FormsModule, ReactiveFormsModule } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@angular\/forms'<\/span>;\n\n<span class=\"hljs-keyword\">import<\/span> { AppRoutingModule } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'.\/app-routing.module'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { DemoAppComponent } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'.\/app.component'<\/span>;\n\n@NgModule({\n  <span class=\"hljs-attr\">declarations<\/span>: &#91;DemoAppComponent],\n  <span class=\"hljs-attr\">imports<\/span>: &#91;\n    BrowserModule,\n    AppRoutingModule,\n    AmplifyUIAngularModule,\n    FormsModule,\n    ReactiveFormsModule\n  ],\n  <span class=\"hljs-attr\">providers<\/span>: &#91;],\n  <span class=\"hljs-attr\">bootstrap<\/span>: &#91;DemoAppComponent]\n})\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">DemoAppModule<\/span> <\/span>{}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Add the following Amplify imports for the Angular app in src\/main.ts:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> { Amplify } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'aws-amplify'<\/span>;\n<span class=\"hljs-keyword\">import<\/span> aws_exports <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'.\/aws-exports'<\/span>;\nAmplify.configure(aws_exports);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>Add the following Amplify imports for the Angular app in tsconfig.app.json:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-string\">\"compilerOptions\"<\/span>: {\n  <span class=\"hljs-string\">\"types\"<\/span> : &#91;<span class=\"hljs-string\">\"node\"<\/span>]\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>     5. Add the following code for the demo Angular app\u2019s functionality to<br><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">src\/app\/app.component.ts:\n\n<span class=\"hljs-keyword\">import<\/span> { Component, OnInit, OnDestroy } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@angular\/core\"<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { FormBuilder, FormGroup, Validators } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\"@angular\/forms\"<\/span>;\n<span class=\"hljs-keyword\">import<\/span> { APIService, Task } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">\".\/API.service\"<\/span>;\n\n@Component({\n  <span class=\"hljs-attr\">selector<\/span>: <span class=\"hljs-string\">\"demo-app-root\"<\/span>,\n  <span class=\"hljs-attr\">templateUrl<\/span>: <span class=\"hljs-string\">\".\/app.component.html\"<\/span>,\n  <span class=\"hljs-attr\">styleUrls<\/span>: &#91;<span class=\"hljs-string\">\".\/app.component.css\"<\/span>],\n})\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">DemoAppComponent<\/span> <span class=\"hljs-title\">implements<\/span> <span class=\"hljs-title\">OnInit<\/span>, <span class=\"hljs-title\">OnDestroy<\/span> <\/span>{\n  title = <span class=\"hljs-string\">\"demo-angular\u2013amplify-app\"<\/span>;\n  public createForm: FormGroup;\n\n  public tasks: <span class=\"hljs-built_in\">Array<\/span>&lt;Task&gt; = &#91;];\n\n  ngOnDestroy() {\n    <span class=\"hljs-keyword\">if<\/span> (<span class=\"hljs-keyword\">this<\/span>.subscription) {\n      <span class=\"hljs-keyword\">this<\/span>.subscription.unsubscribe();\n    }\n    <span class=\"hljs-keyword\">this<\/span>.subscription = <span class=\"hljs-literal\">null<\/span>;\n  }\n\n  <span class=\"hljs-keyword\">constructor<\/span>(private api: APIService, private fb: FormBuilder) {\n    <span class=\"hljs-keyword\">this<\/span>.createForm = <span class=\"hljs-keyword\">this<\/span>.fb.group({\n      <span class=\"hljs-attr\">taskName<\/span>: &#91;<span class=\"hljs-string\">\"\"<\/span>, Validators.required],\n    });\n  }\n\n  private appSubscription: Subscription | <span class=\"hljs-literal\">null<\/span> = <span class=\"hljs-literal\">null<\/span>;\n\n  <span class=\"hljs-keyword\">async<\/span> ngOnInit() {\n    <span class=\"hljs-keyword\">this<\/span>.api.ListTasks().then(<span class=\"hljs-function\">(<span class=\"hljs-params\">event<\/span>) =&gt;<\/span> {\n      <span class=\"hljs-keyword\">this<\/span>.tasks = event.items;\n    });\n\n    <span class=\"hljs-keyword\">this<\/span>.appSubscription = <span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Subscription<\/span>&gt;<\/span>(\n      this.api.OnCreateTaskListener.subscribe((event: any) =&gt; {\n        const newTask = event.value.data.onCreateTask;\n        this.tasks = &#91;newTask, ...this.tasks];\n      })\n    );\n  }\n\n  public onCreate(task: Task) {\n    this.api\n      .CreateTask(task)\n      .then((event) =&gt; {\n        console.log(\"task created!\");\n        this.createForm.reset();\n      })\n      .catch((e) =&gt; {\n        console.log(\"error creating task...\", e);\n      });\n  }\n}\n<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>6. Add the following HTML code for the frontend in the src\/app\/app.component.html file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">&lt;div <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span><\/span>=<span class=\"hljs-string\">\"form-body\"<\/span>&gt;\n\t<span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">form<\/span> <span class=\"hljs-attr\">autocomplete<\/span>=<span class=\"hljs-string\">\"off\"<\/span> &#91;<span class=\"hljs-attr\">formGroup<\/span>]=<span class=\"hljs-string\">\"createForm\"<\/span> (<span class=\"hljs-attr\">ngSubmit<\/span>)=<span class=\"hljs-string\">\"onCreateTask(createForm.value)\"<\/span>&gt;<\/span>\n\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\t\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">label<\/span>&gt;<\/span>Task Name: <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">label<\/span>&gt;<\/span>\n\t\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\"<\/span> <span class=\"hljs-attr\">formControlName<\/span>=<span class=\"hljs-string\">\"name\"<\/span> <span class=\"hljs-attr\">autocomplete<\/span>=<span class=\"hljs-string\">\"off\"<\/span> \/&gt;<\/span> <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\t<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">form<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n<span class=\"xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> *<span class=\"hljs-attr\">ngFor<\/span>=<span class=\"hljs-string\">\"let task of tasks\"<\/span>&gt;<\/span>\n\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>{{ task.name }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>To create a backend on AWS Amplify for the demo Angular app:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>From the root directory, put in the following command and initialize Amplify:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">amplify init\n<\/code><\/span><\/pre>\n\n\n<p>     2. Type in the following inputs for the respective prompts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Source directory path: <\/strong>src<\/li>\n\n\n\n<li><strong>Distribution directory path: <\/strong>dist<\/li>\n\n\n\n<li><strong>Build command:<\/strong> npm run-script build<\/li>\n\n\n\n<li><strong>Start command:<\/strong> npm start<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Run the following command to Install the Amplify Angular library and run the Angular app:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">--save<\/span> <span class=\"hljs-selector-tag\">aws-amplify<\/span> <span class=\"hljs-keyword\">@aws-amplify<\/span>\/ui-angular<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">npm start<\/code><\/span><\/pre>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-deploy-and-connect-api-and-database\">Deploy and Connect API and Database<\/h4>\n\n\n\n<p>This tutorial uses GraphQL as the data language for the Angular app. It will set up and use an API that allows interaction with a provided database.<\/p>\n\n\n\n<p><strong>To install and configure GraphQL API:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Use the following command to add a GraphQL API to the Angular app:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">amplify add api<\/code><\/span><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Type in the following inputs for the respective prompts:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>API Name: <\/strong>todo-demoAPI<\/li>\n\n\n\n<li><strong>Default authorization type of API: <\/strong>API Key<\/li>\n\n\n\n<li><strong>Description of API: <\/strong>Angular demo<\/li>\n\n\n\n<li><strong>API expiration time period: <\/strong>7<\/li>\n\n\n\n<li><strong>Configure advanced settings for GraphQL:<\/strong> no<\/li>\n\n\n\n<li><strong>Annotated GraphQL schema:<\/strong> no<\/li>\n\n\n\n<li><strong>Schema template<\/strong>: \u201cTask\u201d with ID, name<\/li>\n\n\n\n<li><strong>Edit this schema now: <\/strong>yes<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Replace the schema in amplify\/backend\/api\/todo-demoAPI\/schema.graphql with the following:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\">\t<span class=\"hljs-selector-tag\">type<\/span> <span class=\"hljs-selector-tag\">Task<\/span> <span class=\"hljs-keyword\">@model<\/span> {\n  <span class=\"hljs-selector-tag\">id<\/span>: <span class=\"hljs-selector-tag\">ID<\/span>!\n  <span class=\"hljs-selector-tag\">taskName<\/span>: <span class=\"hljs-selector-tag\">String<\/span>!\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>      4. Create the backend resources for the API using the following command:<\/p>\n\n\n\n<p>amplify push<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li>Type in the following inputs for the respective prompts:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Sure want to continue: <\/strong>Y<\/li>\n\n\n\n<li><strong>Generate code GraphQL API: <\/strong>Y<\/li>\n\n\n\n<li><strong>Code generation language target: <\/strong>angular<\/li>\n\n\n\n<li><strong>API expiration time period: <\/strong>7<\/li>\n\n\n\n<li><strong>File name pattern for GraphQL<\/strong>: src\/demo-graphql\/**\/*.graphql<\/li>\n\n\n\n<li><strong>Generate\/update all possible GraphQL operations:<\/strong> Y<\/li>\n\n\n\n<li><strong>Maximum statement depth<\/strong>: 2<\/li>\n\n\n\n<li><strong>File name for generated code<\/strong>: src\/app\/API.service.ts<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>Run the app with the following command:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">npm start<\/code><\/span><\/pre>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-deploy-your-angular-app\">Deploy Your Angular App<\/h4>\n\n\n\n<p><strong>To publish and deploy your Angular app through Amplify:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the root directory and run the following command:<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">amplify add hosting<\/code><\/span><\/pre>\n\n\n<p>Select the bolded options for the prompts that follow.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Use the following command to publish your Angular app.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">amplify publish<\/code><\/span><\/pre>\n\n\n<p>The app is hosted at the URL that the terminal displays once the command above is run.<\/p>\n\n\n\n<p><strong>Note: <\/strong>If you have an existing Angular app running on-premises and want to migrate it to Amazon, there may be some additional considerations not covered in this tutorial. <a href=\"https:\/\/faddom.com\/cloud-migration-checklist\/\">See this cloud migration checklist<\/a> to make sure your migration goes smoothly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-testing-the-app\">Testing the App<\/h3>\n\n\n\n<p><strong>To test the Angular app created with Amplify backend:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Update the amplify.yml app with the following code:<br><\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">test<\/span>:\n  <span class=\"hljs-selector-tag\">phases<\/span>:\n    <span class=\"hljs-selector-tag\">preTest<\/span>:\n      <span class=\"hljs-selector-tag\">commands<\/span>:\n       \u2014<span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">ci<\/span>\n       \u2014<span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">wait-on<\/span>\n       \u2014<span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">pm2<\/span>\n       \u2014<span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">mocha<\/span><span class=\"hljs-keyword\">@5<\/span>.2.0 mochawesome mochawesome-merge mochawesome-report-generator\n       \u2014npx pm2 start npm -- start\n       \u2014<span class=\"hljs-string\">'npx wait-on --timeout 60 http:\/\/localhost:3000'<\/span>\n    <span class=\"hljs-attribute\">test:<\/span>\n      <span class=\"hljs-attribute\">commands:<\/span>\n       \u2014<span class=\"hljs-string\">'npx cypress run --reporter mochawesome --reporter-options \"reportDir=cypress\/demoTestReports\/mochawesome-report,overwrite=false,html=false,json=true,timestamp=mmddyyyy_HHMMss\"'<\/span>\n    <span class=\"hljs-attribute\">postTest:<\/span>\n      <span class=\"hljs-attribute\">commands:<\/span>\n       \u2014npx mochawesome-merge cypress\/report\/mochawesome-report\/mochawesome*.json &gt; cypress\/report\/mochawesome.json\n       \u2014npx pm2 kill\n  <span class=\"hljs-attribute\">artifacts:<\/span>\n    <span class=\"hljs-attribute\">baseDirectory:<\/span> cypress\n    <span class=\"hljs-attribute\">configFilePath:<\/span> <span class=\"hljs-string\">'**\/mochawesome.json'<\/span>\n    <span class=\"hljs-attribute\">files:<\/span>\n     \u2014<span class=\"hljs-string\">'**\/*.png'<\/span>\n     \u2014<span class=\"hljs-string\">'**\/*.mp4'<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The test step specifies that Amplify runs tests every time it builds the Angular app. It will generate a JSON report of output from running the tests.&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Create and store the Cypress tests for the Angular app in the cypress directory.&nbsp;<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>In this article, I explained the basics of AWS Amplify and showed how to run an Angular application in the Amazon cloud. This involves:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installing the AWS Amplify CLI<\/li>\n\n\n\n<li>Setting up the Angular app and an AWS Amplify Backend<\/li>\n\n\n\n<li>Deploying and connecting the API and database<\/li>\n\n\n\n<li>Deploying the Angular app to Amazon<\/li>\n\n\n\n<li>Testing the app<\/li>\n<\/ul>\n\n\n\n<p>We hope this will be useful as you consider migrating your Angular applications to the cloud.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Is AWS Amplify? AWS Amplify is a platform that allows web and mobile developers to build full-stack applications, deploy them in the Amazon cloud, and allow them to easily integrate with other Amazon services. Amplify supports a variety of development platforms including Angular, React Native, Flutter, and Vue.&nbsp; Technically, AWS Amplify is a JavaScript&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/\">Read more<\/a><\/p>\n","protected":false},"author":100,"featured_media":18416,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":5,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[5244],"tags":[4141,71],"collections":[],"class_list":{"0":"post-18411","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-cloud","8":"tag-angular","9":"tag-aws","10":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Run Angular Applications in AWS - Codemotion<\/title>\n<meta name=\"description\" content=\"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step by Step: Running Angular Applications in AWS\" \/>\n<meta property=\"og:description\" content=\"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-02T07:54:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-23T13:33:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png\" \/>\n\t<meta property=\"og:image:width\" content=\"6000\" \/>\n\t<meta property=\"og:image:height\" content=\"3375\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Gilad David Maayan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gilad_maayan\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gilad David Maayan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/\"},\"author\":{\"name\":\"Gilad David Maayan\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/b332cfa429cd83ccb5840d43315f28c5\"},\"headline\":\"Step by Step: Running Angular Applications in AWS\",\"datePublished\":\"2022-08-02T07:54:37+00:00\",\"dateModified\":\"2023-06-23T13:33:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/\"},\"wordCount\":1242,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/fc23638c-16f6-4437-8662-213f37f2a1dc.png\",\"keywords\":[\"Angular\",\"AWS\"],\"articleSection\":[\"Cloud\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/\",\"name\":\"How to Run Angular Applications in AWS - Codemotion\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/fc23638c-16f6-4437-8662-213f37f2a1dc.png\",\"datePublished\":\"2022-08-02T07:54:37+00:00\",\"dateModified\":\"2023-06-23T13:33:25+00:00\",\"description\":\"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/fc23638c-16f6-4437-8662-213f37f2a1dc.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/fc23638c-16f6-4437-8662-213f37f2a1dc.png\",\"width\":6000,\"height\":3375,\"caption\":\"AWS amplify, angular, AWS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/step-by-step-running-angular-applications-in-aws\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cloud\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Step by Step: Running Angular Applications in AWS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Codemotion.Italy\\\/\",\"https:\\\/\\\/x.com\\\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/b332cfa429cd83ccb5840d43315f28c5\",\"name\":\"Gilad David Maayan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g\",\"caption\":\"Gilad David Maayan\"},\"description\":\"Gilad David Maayan is a technology writer who has worked with over 150 technology companies including SAP, Imperva, Samsung NEXT, NetApp and Ixia, producing technical and thought leadership content that elucidates technical solutions for developers and IT leadership. Today he heads Agile SEO, the leading marketing agency in the technology industry.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/giladdavidmaayan\\\/\",\"https:\\\/\\\/x.com\\\/gilad_maayan\"],\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/author\\\/gilad-david-maayan\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Run Angular Applications in AWS - Codemotion","description":"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/","og_locale":"en_US","og_type":"article","og_title":"Step by Step: Running Angular Applications in AWS","og_description":"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.","og_url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2022-08-02T07:54:37+00:00","article_modified_time":"2023-06-23T13:33:25+00:00","og_image":[{"width":6000,"height":3375,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png","type":"image\/png"}],"author":"Gilad David Maayan","twitter_card":"summary_large_image","twitter_creator":"@gilad_maayan","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Gilad David Maayan","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/"},"author":{"name":"Gilad David Maayan","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/b332cfa429cd83ccb5840d43315f28c5"},"headline":"Step by Step: Running Angular Applications in AWS","datePublished":"2022-08-02T07:54:37+00:00","dateModified":"2023-06-23T13:33:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/"},"wordCount":1242,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png","keywords":["Angular","AWS"],"articleSection":["Cloud"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/","url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/","name":"How to Run Angular Applications in AWS - Codemotion","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png","datePublished":"2022-08-02T07:54:37+00:00","dateModified":"2023-06-23T13:33:25+00:00","description":"Useful code for getting started with AWS Amplify. Run your Angular applications on AWS in no time with this complete guide.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png","width":6000,"height":3375,"caption":"AWS amplify, angular, AWS"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/step-by-step-running-angular-applications-in-aws\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.codemotion.com\/magazine\/devops\/"},{"@type":"ListItem","position":3,"name":"Cloud","item":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/"},{"@type":"ListItem","position":4,"name":"Step by Step: Running Angular Applications in AWS"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/b332cfa429cd83ccb5840d43315f28c5","name":"Gilad David Maayan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/aa7da1b7504794509c4f9347d4e7ea17f0b9ae2a84233ec171434f7c8511daf7?s=96&d=mm&r=g","caption":"Gilad David Maayan"},"description":"Gilad David Maayan is a technology writer who has worked with over 150 technology companies including SAP, Imperva, Samsung NEXT, NetApp and Ixia, producing technical and thought leadership content that elucidates technical solutions for developers and IT leadership. Today he heads Agile SEO, the leading marketing agency in the technology industry.","sameAs":["https:\/\/www.linkedin.com\/in\/giladdavidmaayan\/","https:\/\/x.com\/gilad_maayan"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/gilad-david-maayan\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-600x400.png","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-600x600.png","author_info":{"display_name":"Gilad David Maayan","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/gilad-david-maayan\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png",6000,3375,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-150x150.png",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-300x169.png",300,169,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-768x432.png",768,432,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-1024x576.png",1024,576,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-1536x864.png",1536,864,true],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-2048x1152.png",2048,1152,true],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc.png",100,56,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-180x128.png",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-896x504.png",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-400x225.png",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-600x400.png",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2022\/08\/fc23638c-16f6-4437-8662-213f37f2a1dc-600x600.png",600,600,true]},"uagb_author_info":{"display_name":"Gilad David Maayan","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/gilad-david-maayan\/"},"uagb_comment_info":0,"uagb_excerpt":"What Is AWS Amplify? AWS Amplify is a platform that allows web and mobile developers to build full-stack applications, deploy them in the Amazon cloud, and allow them to easily integrate with other Amazon services. Amplify supports a variety of development platforms including Angular, React Native, Flutter, and Vue.&nbsp; Technically, AWS Amplify is a JavaScript&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/18411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=18411"}],"version-history":[{"count":4,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/18411\/revisions"}],"predecessor-version":[{"id":21579,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/18411\/revisions\/21579"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/18416"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=18411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=18411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=18411"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=18411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}