diff --git a/demos/README.md b/demos/README.md new file mode 100644 index 0000000..cbd3f97 --- /dev/null +++ b/demos/README.md @@ -0,0 +1,150 @@ +## IaaS and PaaS - Demo + +1. Create VPC using "VPC Wizard" + - Use 10.0.0.16 for CIDR block + - Use "launch-demo-vpc" for VPC name + - Use 10.0.1.0/24 for public subnet CIDR block; reference link for CIDR translation/calculation + - Talk about availability zone and choose one + - Use "launch-demo-subnet1" for subnet name + - Leave the rest at the defaults + - Review after creation, including public subnet allowing routing out through IG +2. Create second public subnet + - Use 10.0.2.0/24 for public subnet CIDR block + - Choose a different availability zone + - Use "launch-demo-subnet2" for subnet name + - Talk about how availability zones provide redundancy at the region level (split across multiple data centers within the same region - high-speed connectivity between; for EC2 instances, might create multiple copies of the same instance config - for RDS, requires a subnet group across at least 2 availability zones) + - Add route for igw to route table +3. Create new EC2 (Elastic Cloud Compute) instance - Ubuntu instance + - Select AMI (free tier) + - Select instance type - talk about various characteristics including purpose of EBS + - 1 instance - talk about purpose of Auto Scaling Group + - No public IP (for now) + - Configure a new Security Group - uses 5-tuple format + * Name it "launch-demo-linux-sg" | "Security Group for demo Linux VMs" + * Talk about addition of new rule + * Talk about wide open SSH (port 22) in production usually not a good idea - use bastion host (or jump box) instead typically (Hub & Spoke) with peering and IP restrictions + * Update for my IP address only + - Create new key pair for ssh and download ("launch-demo-linux-key") - manages secure access over SSH + - While instance is building, build out Windows VM +4. Create new EC2 instance - Windows instance + - Select AMI (free tier) + - Select instance type - talk about various characteristics + - 1 instance + - Add public IP at time of creation + - Could use existing Security Group - however, will create new for separate Windows settings (principle of "least privilege") + * Name is "launch-demo-windows-sg" | "Security Group for demo Windows VMs" + * Talk about wide open RDP (port 3389) in production usually not a good idea - use bastion host (or jump box) instead typically with peering and IP restrictions + - Create new key pair and download ("launch-demo-windows-key") - used for secure access to admin password +5. While second instance is building, walk through IaaS demo diagram - route tables, ACL's and VPC/subnets +6. After creation of both instances completes + - Assign name "launch-demo-linux-vm01" to Linux VM - makes it easier to find in dropdowns later + - Assign name "launch-demo-windows-vm01" to Windows VM + - Review properties of Linux VM - no public IP, security group, etc. + - Review properties of Windows VM - public IP, security group, etc. +7. Create new Elastic IP and assign to Linux VM + - Allocate from Amazon pool + - Associate address to Linux VM + - Review properties of Linux VM again +8. Use WSL to connect to Linux VM over SSH + - Copy .pem file from /mnt/c/Downloads... to ~ in WSL session + - Run `chmod 0400 ~/launch-demo-linux-key.pem` - changes permissions to make readable by our WSL session + - Execute `ssh -i ~/launch-demo-linux-key.pem ubuntu@` (other default user names depending on OS) + - Execute `cd /etc` and `ls` to show interaction + - Demonstrate `sudo apt-get update` + - Demonstrate `sudo apt-get upgrade` + - After, in Management Console, stop instance +9. Connect to Windows VM using Remote Desktop + - Use "Connect" button in Management Console + - Use .pem key file to pull secure password + - Click "Download Remote Desktop File" and run + - Enter secure password (copy/paste) +10. Build RDS (SQL Server) + - Use name "launch-demo-mssql-dbserver01" + - Use Standard configuration + - Use 2017 + free tier + - Attach to VPC with new subnet group (associated to 2 public subnets) + - Additional connectivity --> public access +11. While RDS is being built out + - Login to Windows VM + - Unblock Internet for admins (Server Manager) + - Install Chrome + - Install Git (https://git-scm.com/) + - Install .NET Core SDK (https://dotnet.microsoft.com/download/dotnet-core) + - Clone code repository for demo app + - Review PaaS demo diagram +12. After RDS instance creation completes + - Click on DB and security group --> add my IP for access (1433) + - Connect via SSMS + - Create new database ("launch-demo-db") + - Run T-SQL script to create new table and populate with demo data +13. On Windows VM, demo web API locally + - **Update connection string to point to new RDS instance - usually not stored in source code (security risk); instead will be saved in a secrets management solution like Hashicorp Vault, Azure Key Vault or AWS Key Management Service (KMS)** + - From web app project location (in an Administrator command prompt), run `C:\Program Files\dotnet\dotnet.exe build` + - From web app project location (in an Administrator command prompt), run `C:\Program Files\dotnet\dotnet.exe run` + - Try accessing list of projects, see that fails + - Grant Windows VM Security Group access to port 1433 in RDS Security Group + - Try accessing list of projects again - on success, retrieve specific, create one, edit one and delete one +14. Demonstrate ability to access Web App remotely from local machine + - Add port 30000 to Windows VM Security Group (use `0.0.0.0/0`) but talk about security risk (Hub & Spoke) + - Add Windows Firewall Rule for port 30000 (demo web app) + - Test Web App through VM remotely - list projects and list specific project + +## Lambda - Demo + +Under AWS services, search for "Lambda" and highlight AWS "tagline" + +1. Create new Lambda function using "Use a blueprint" +2. Under "Blueprints", search for "hello-world" +3. Choose the nodejs starter and click "Configure" +4. Use "launch-demo-lambda" for function name +5. Select "Create new role with basic Lambda permissions": +6. Leave function code as-is and click "Create function" +7. Replace lambda function code with "index.js" code in repo; talk about how you can modify code right in this window +8. Also talk about how you can add additional .js files, etc. in the "Function code" area to build out a more complex program +9. Do a quick walkthrough of code +10. Highlight some of the other available configuration options with the lambda function +11. Click "Save"; talk about ability to test right from here +12. Click "Add trigger" and choose API Gateway +13. Create an API using the REST API option +14. Under security, set API key +15. Click "Add" +16. Quickly highlight options for "Add destination"; click "Cancel" +17. Highlight the API configuration and function code views in the lambda integration +18. Click the "API Gateway" name to navigate to the service; also talk about accessing using "API Gateway" service in Management Console +19. Drill into available method +20. Review diagram outlining flow and steps through the proxy to the lambda function +21. Talk about purpose of API Keys --> subscription +22. Click "Resources", select root ("/") and under "Actions", select "Deploy API"; deploy to "default" stage and note "Invoke URL" - copy/paste to Notepad +23. Click "API Keys", click "launch-demo-lambda-Key", click "Show" and copy/paste key to Notepad +24. In POSTMan, choose POST, use "Invoke URL" + "/launch-demo-lambda" and use `{ "key1": "Value 1", "key2": "Value 2", "key3": "Value 3" }` for request body +25. Attempt to send and see the "Forbidden" response +26. Add the "x-api-key" header with API Key copied previously +27. Attempt POST again - see success +28. Talk about ability to send combo of query strings and body +29. Quickly highlight throttling settings, and others + +## Containers - Demo + +1. In WSL, create new folder called "launch-demo-containers" +2. Change to "launch-demo-containers" folder and run `dotnet new mvc` +3. Run `dotnet build` +4. Run `dotnet run` and navigate to http://localhost:5000 in a browser window to test +5. From directory, execute `code .` and create a new Dockerfile in the root of the app folder and copy contents from repo +6. Execute `docker build -t demo-image .` to build a new Docker image for the app +7. Execute `docker run -it --rm -p 8000:5000 -e ASPNETCORE_URLS=http://+:5000 --name demo-container demo-image` +8. Navigate to http://localhost:8000 in a browser window to test (running in container) +9. Create a new docker-compose.yml file in the root of the app folder and copy contents from repo +10. Execute `docker-compose build` and then `docker-compose up` +11. Navigate to http://localhost:8020 in a browser window to test (running in container) +12. Review images and containers in VS Code +13. From WSL, run `docker exec -it launch-demo-containers_db_1 /bin/bash` +14. Navigate to `/opt/mssql-tools/bin` on interactive container shell +15. Execute `./sqlcmd -S . -d master -U sa -P Passw0rd123!` +16. Run `CREATE TABLE Person (FirstName nvarchar(50), LastName nvarchar(50));GO` +17. Run `INSERT INTO Person (FirstName, LastName) VALUES ('Melissa', 'Testing');` +18. Run `INSERT INTO Person (FirstName, LastName) VALUES ('Bob', 'Roberts');GO` +19. Run `SELECT * FROM Person;GO` +20. Ctrl+C to leave sqlcmd and run `exit` to leave container shell +21. In VS Code, delete containers +22. In VS Code, delete images +23. Exit VS Code and delete /launch-demo-containers folder \ No newline at end of file diff --git a/demos/iaas-paas/DB Scripts/Product-Table.sql b/demos/iaas-paas/DB Scripts/Product-Table.sql new file mode 100644 index 0000000..0ad294e --- /dev/null +++ b/demos/iaas-paas/DB Scripts/Product-Table.sql @@ -0,0 +1,24 @@ +USE [launch-demo-db] +GO + +/****** Object: Table [dbo].[Product] Script Date: 8/21/2020 2:47:21 PM ******/ +SET ANSI_NULLS ON +GO + +SET QUOTED_IDENTIFIER ON +GO + +CREATE TABLE [dbo].[Product]( + [Id] [int] IDENTITY(1,1) NOT NULL, + [Name] [nvarchar](50) NOT NULL, + [Description] [nvarchar](125) NOT NULL, + CONSTRAINT [PK_Product] PRIMARY KEY CLUSTERED +( + [Id] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] +GO + +INSERT INTO [dbo].[Product] (Name, Description) VALUES ('Widget', 'Standard widget product') +INSERT INTO [dbo].[Product] (Name, Description) VALUES ('Thing-a-ma-Bob', 'Standard thing-a-ma-bob product') +INSERT INTO [dbo].[Product] (Name, Description) VALUES ('Big Ticket Item', 'Standard "big ticket item" product') diff --git a/demos/iaas-paas/launch-demo-api/Controllers/ProductsController.cs b/demos/iaas-paas/launch-demo-api/Controllers/ProductsController.cs new file mode 100644 index 0000000..c89c48f --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Controllers/ProductsController.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using launch_demo_api.Models; + +namespace launch_demo_api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class ProductsController : ControllerBase + { + private readonly LaunchDemoContext _context; + + public ProductsController(LaunchDemoContext context) + { + _context = context; + } + + // GET: api/Products + [HttpGet] + public async Task>> GetProduct() + { + return await _context.Product.ToListAsync(); + } + + // GET: api/Products/5 + [HttpGet("{id}")] + public async Task> GetProduct(int id) + { + var product = await _context.Product.FindAsync(id); + + if (product == null) + { + return NotFound(); + } + + return product; + } + + // PUT: api/Products/5 + // To protect from overposting attacks, enable the specific properties you want to bind to, for + // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. + [HttpPut("{id}")] + public async Task PutProduct(int id, Product product) + { + if (id != product.Id) + { + return BadRequest(); + } + + _context.Entry(product).State = EntityState.Modified; + + try + { + await _context.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException) + { + if (!ProductExists(id)) + { + return NotFound(); + } + else + { + throw; + } + } + + return NoContent(); + } + + // POST: api/Products + // To protect from overposting attacks, enable the specific properties you want to bind to, for + // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. + [HttpPost] + public async Task> PostProduct(Product product) + { + _context.Product.Add(product); + await _context.SaveChangesAsync(); + + return CreatedAtAction("GetProduct", new { id = product.Id }, product); + } + + // DELETE: api/Products/5 + [HttpDelete("{id}")] + public async Task> DeleteProduct(int id) + { + var product = await _context.Product.FindAsync(id); + if (product == null) + { + return NotFound(); + } + + _context.Product.Remove(product); + await _context.SaveChangesAsync(); + + return product; + } + + private bool ProductExists(int id) + { + return _context.Product.Any(e => e.Id == id); + } + } +} diff --git a/demos/iaas-paas/launch-demo-api/Data/LaunchDemoContext.cs b/demos/iaas-paas/launch-demo-api/Data/LaunchDemoContext.cs new file mode 100644 index 0000000..d73047e --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Data/LaunchDemoContext.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using launch_demo_api.Models; + + public class LaunchDemoContext : DbContext + { + public LaunchDemoContext (DbContextOptions options) + : base(options) + { + } + + public DbSet Product { get; set; } + } diff --git a/demos/iaas-paas/launch-demo-api/Models/Product.cs b/demos/iaas-paas/launch-demo-api/Models/Product.cs new file mode 100644 index 0000000..f93e0f1 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Models/Product.cs @@ -0,0 +1,9 @@ +namespace launch_demo_api.Models +{ + public class Product + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + } +} diff --git a/demos/iaas-paas/launch-demo-api/Program.cs b/demos/iaas-paas/launch-demo-api/Program.cs new file mode 100644 index 0000000..9cb4fac --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Program.cs @@ -0,0 +1,21 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Hosting; + +namespace launch_demo_api +{ + public class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + webBuilder.UseUrls("https://*:30000"); + }); + } +} diff --git a/demos/iaas-paas/launch-demo-api/Properties/launchSettings.json b/demos/iaas-paas/launch-demo-api/Properties/launchSettings.json new file mode 100644 index 0000000..c1c3c2c --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51241/", + "sslPort": 44365 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "launch-demo-api": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.json b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.json new file mode 100644 index 0000000..0397909 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "mssql1": { + "type": "mssql", + "connectionId": "LaunchDemoContext" + } + } +} \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json new file mode 100644 index 0000000..dce1984 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "mssql1": { + "type": "mssql.local", + "connectionId": "LaunchDemoContext" + } + } +} \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json.user b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json.user new file mode 100644 index 0000000..d49d1a6 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Properties/serviceDependencies.local.json.user @@ -0,0 +1,9 @@ +{ + "dependencies": { + "mssql1": { + "restored": true, + "restoreTime": "2020-08-21T20:35:28.4304424Z" + } + }, + "parameters": {} +} \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/Startup.cs b/demos/iaas-paas/launch-demo-api/Startup.cs new file mode 100644 index 0000000..604b8d7 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/Startup.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.EntityFrameworkCore; +using Microsoft.OpenApi.Models; + +namespace launch_demo_api +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + public void ConfigureServices(IServiceCollection services) + { + services.AddControllers(); + + services.AddDbContext(options => + options.UseSqlServer(Configuration.GetConnectionString("LaunchDemoContext"))); + + services.AddSwaggerGen(c => + { + c.SwaggerDoc("v1", new OpenApiInfo + { + Title = "Launch Demo API", + Version = "v1", + Description = "Test API for LAUNCH demo" + }); + }); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseHttpsRedirection(); + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + app.UseSwagger(); + + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "Launch Demo API V1"); + c.RoutePrefix = string.Empty; + }); + } + } +} diff --git a/demos/iaas-paas/launch-demo-api/appsettings.Development.json b/demos/iaas-paas/launch-demo-api/appsettings.Development.json new file mode 100644 index 0000000..8983e0f --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/appsettings.Development.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + } +} diff --git a/demos/iaas-paas/launch-demo-api/appsettings.json b/demos/iaas-paas/launch-demo-api/appsettings.json new file mode 100644 index 0000000..f72143d --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/appsettings.json @@ -0,0 +1,13 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "LaunchDemoContext": "Server=launch-demo-db.cguvf7srcy3k.us-east-2.rds.amazonaws.com,1433;Database=launch-demo-db;User Id=admin;Password=Pa$$w0rd123$;MultipleActiveResultSets=true" + } +} \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj b/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj new file mode 100644 index 0000000..f2b33e2 --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.1 + launch_demo_api + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + diff --git a/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj.user b/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj.user new file mode 100644 index 0000000..25db2ca --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/launch-demo-api.csproj.user @@ -0,0 +1,18 @@ + + + + ApiControllerWithContextScaffolder + root/Controller + 600 + 600 + <_SelectedScaffolderID>ApiControllerWithContextScaffolder + <_SelectedScaffolderCategoryPath>root/Common + True + False + True + + LaunchDemoContext + False + IIS Express + + \ No newline at end of file diff --git a/demos/iaas-paas/launch-demo-api/launch-demo-api.sln b/demos/iaas-paas/launch-demo-api/launch-demo-api.sln new file mode 100644 index 0000000..1dc128b --- /dev/null +++ b/demos/iaas-paas/launch-demo-api/launch-demo-api.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30413.136 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "launch-demo-api", "launch-demo-api.csproj", "{0E182F77-4CB6-4303-8883-C0E323EEF772}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0E182F77-4CB6-4303-8883-C0E323EEF772}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E182F77-4CB6-4303-8883-C0E323EEF772}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E182F77-4CB6-4303-8883-C0E323EEF772}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E182F77-4CB6-4303-8883-C0E323EEF772}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FA51CB10-F0DB-429A-9357-4A515C3F7A12} + EndGlobalSection +EndGlobal diff --git a/demos/lambda/index.js b/demos/lambda/index.js new file mode 100644 index 0000000..a807316 --- /dev/null +++ b/demos/lambda/index.js @@ -0,0 +1,58 @@ +'use strict'; + +exports.handler = async (event) => { + let key1 = ''; + let key2 = ''; + let key3 = ''; + let responseCode = 200; + + console.log("request: " + JSON.stringify(event)); + + if (event.queryStringParameters) { + if (event.queryStringParameters.key1) { + console.log("Received key1 as query string parameter: " + event.queryStringParameters.key1); + key1 = event.queryStringParameters.key1; + } + + if (event.queryStringParameters.key2) { + console.log("Received key2 as query string parameter: " + event.queryStringParameters.key2); + key2 = event.queryStringParameters.key2; + } + + if (event.queryStringParameters.key3) { + console.log("Received key3 as query string parameter: " + event.queryStringParameters.key3); + key3 = event.queryStringParameters.key3; + } + } + + if (event.body) { + let body = JSON.parse(event.body) + key1 = body.key1 || key1; + key2 = body.key2 || key2; + key3 = body.key3 || key3; + } + + let responseMessage = `Given data was ${key1}, ${key2}, ${key3}`; + + let responseBody = { + message: responseMessage + }; + + // The output from a Lambda proxy integration must be + // in the following JSON object. The 'headers' property + // is for custom response headers in addition to standard + // ones. The 'body' property must be a JSON string. For + // base64-encoded payload, you must also set the 'isBase64Encoded' + // property to 'true'. + let response = { + statusCode: responseCode, + headers: { + "x-custom-header" : "my custom header value" + }, + body: JSON.stringify(responseBody) + }; + + console.log("response: " + JSON.stringify(response)) + + return response; +}; \ No newline at end of file diff --git a/labs/lab00/README.md b/labs/lab00/README.md new file mode 100644 index 0000000..9c997ea --- /dev/null +++ b/labs/lab00/README.md @@ -0,0 +1,12 @@ +# Lab 00 - Getting Set up for Exercises + +In this first exercise we'll make sure that we're all set up with our AWS credentials and access to AWS. + +## Log into the AWS Console + +1. Log in to AWS using the link, username, and password provided to you +1. In the top bar, near the right, you'll see your username/alias @ tf-intro - clicking on that will display a dropdown +1. In the dropdown, click on "My Security Credentials" +1. This will take you to your security credentials screen/tab; feel free to change your password if you like; the account will remain active throughout class today + +Having done that, we should be ready to move on! diff --git a/labs/lab01/README.md b/labs/lab01/README.md new file mode 100644 index 0000000..9a1f9a6 --- /dev/null +++ b/labs/lab01/README.md @@ -0,0 +1,16 @@ +# Lab 01 + +This lab provides you with the opportunity to practice creating and configuring an EC2 instance in AWS. + +**NOTE: When naming resources, include your initials in the names used (to ensure no name collision with other LAUNCH attendees)** + +## Option 1 + +Execute the tutorial at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html to practice creating a new EC2 instance in AWS, confirming connectivity to that instance, and cleanup. + +## Option 2 (for a little more challenge) + +1. Following https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html, create a new Amazon Linux 2 EC2 instance +2. **Do not execute step 3 yet (the cleanup step)** +3. After confirming connectivity to your instance, follow the steps outlined at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html to install the LAMP stack on your new instance +4. Upon completion, follow step 3 in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html to terminate the test instance created for the lab \ No newline at end of file diff --git a/slides/Moving to the Cloud.pdf b/slides/Moving to the Cloud.pdf new file mode 100644 index 0000000..3692a3c Binary files /dev/null and b/slides/Moving to the Cloud.pdf differ