1 00:00:08,870 --> 00:00:16,490 welcome back to part 2 of programming and deployment using AWS CloudFormation 2 00:00:16,910 --> 00:00:22,769 in this part we're going to look at using CloudFormer first of all we're 3 00:00:22,769 --> 00:00:29,670 going to look at creating the CloudFormer tool from a cloud formation 4 00:00:29,670 --> 00:00:35,640 template and the CloudFormer tool it's an ec2 instance and it has some code on 5 00:00:35,640 --> 00:00:41,340 there that can create it can create cloud formation templates from our 6 00:00:41,340 --> 00:00:47,640 existing resources so then we can use that CloudFormer template 7 00:00:47,640 --> 00:00:52,980 to create a snapshot of all of our instances or all of our Amazon Web 8 00:00:52,980 --> 00:00:57,690 Services resources that we want that could be a VPC configuration it could be 9 00:00:57,690 --> 00:01:03,239 an ec2 instance it could be anything so first thing we'll do is we'll go through 10 00:01:03,239 --> 00:01:09,390 and create a stack and we just call this CloudFormer and we're going to select 11 00:01:09,390 --> 00:01:14,310 it one of the sample templates so there will be a CloudFormer template so down 12 00:01:14,310 --> 00:01:22,380 here on the tools cloud form and we click on next so in the CloudFormer 13 00:01:22,380 --> 00:01:27,330 template obviously it has as we've got a section there to ask for parameters and 14 00:01:27,330 --> 00:01:30,840 so the parameters is to ask for a username and password so it's got the 15 00:01:30,840 --> 00:01:37,020 password so I'll just put something in there now and then username and click on 16 00:01:37,020 --> 00:01:42,180 next we won't worry about tagging this there are some Advanced Options there so 17 00:01:42,180 --> 00:01:46,320 we can again do a notification we won't worry about any notifications or 18 00:01:46,320 --> 00:01:52,079 anything like that so there we have it so it's a name CloudFormer the template 19 00:01:52,079 --> 00:01:56,040 URL is there we can have a look at that later if you'd like to see how the 20 00:01:56,040 --> 00:02:03,479 actual template is created we have the username and a password we've got here 21 00:02:03,479 --> 00:02:08,099 create I am I am resources which is saying false okay the reason it's saying 22 00:02:08,099 --> 00:02:11,790 false is because we haven't acknowledged here so I acknowledge that this template 23 00:02:11,790 --> 00:02:18,480 will be causing AWS CloudFormation to create a I am 24 00:02:18,480 --> 00:02:22,950 resources so just not advising you there that you're going to be creating I and 25 00:02:22,950 --> 00:02:28,470 resources and getting access so now changes to true we can see there and 26 00:02:28,470 --> 00:02:37,320 we've got rollback on failure so that's fine click on create and again we go 27 00:02:37,320 --> 00:02:40,980 through the creating progress and then that will eventually change to create 28 00:02:40,980 --> 00:02:50,640 complete ok so eventually after quite a bit of time it's not quick like the 29 00:02:50,640 --> 00:02:55,710 backspace lab template its as quick as that because that's only creating just 30 00:02:55,710 --> 00:02:58,620 one database is creating quite a few resources so it takes a little bit 31 00:02:58,620 --> 00:03:02,490 longer so you can see cloud former create complete there's a whole heap of 32 00:03:02,490 --> 00:03:06,480 stuff that's going on there whole lot of resources that have been created if we 33 00:03:06,480 --> 00:03:14,040 go into the outputs and it will tell us the website URL of our low cloud 34 00:03:14,040 --> 00:03:20,840 formation ec2 instance so we just click on that and we'll get us into CloudFormer 35 00:03:22,250 --> 00:03:32,810 ok so just a security warning there so we're just going to advanced and proceed 36 00:03:32,810 --> 00:03:39,050 ok so we put in our username and password that we created previously 37 00:03:46,420 --> 00:03:51,370 okay so there we are we've we've successfully created cloud form and 38 00:03:51,370 --> 00:03:56,800 we've successfully connected into it through the to the web interface so 39 00:03:56,800 --> 00:03:59,890 we're just going to go here route us this region and we're going to create a 40 00:03:59,890 --> 00:04:04,870 template based on resources in that region on our on our AWS account so 41 00:04:04,870 --> 00:04:09,760 quick create template and what it's doing now it's going through and 42 00:04:09,760 --> 00:04:14,530 analyzing the accounts or going through and checking what's what resources we 43 00:04:14,530 --> 00:04:19,269 have be it of VPC being an ec2 instance speed a DynamoDB database we're just 44 00:04:19,269 --> 00:04:29,070 going to pick up a dynamo DB database and use that so just put in there a 45 00:04:29,070 --> 00:04:37,240 description and click continue and we're not going to be putting any of 46 00:04:37,240 --> 00:04:40,810 these resources here into our template so we just key could make sure they're 47 00:04:40,810 --> 00:04:45,930 all deselected so can we just keep can just click and continue 48 00:05:03,849 --> 00:05:08,409 okay so we've come to storage and so this is what we want to replicate so 49 00:05:08,409 --> 00:05:13,240 we're just going to replicate that one that we made before so the backspace - 50 00:05:13,240 --> 00:05:17,529 lab table of products will replicate that one or will make a cloud former 51 00:05:17,529 --> 00:05:23,199 template of that and it should be very similar to the template that we created 52 00:05:23,199 --> 00:05:32,249 manually so again just keep continuing through and not selecting anything 53 00:05:38,650 --> 00:05:41,800 okay so what we're doing here is a summary and we're just going to be 54 00:05:41,800 --> 00:05:48,220 creating a table based upon that resource that we've already got and 55 00:05:48,220 --> 00:06:00,370 continue okay so it's now created our cloud formation template okay so we can 56 00:06:00,370 --> 00:06:08,919 say that template summary okay so it saves it to s3 so now we can go in and 57 00:06:08,919 --> 00:06:13,150 we can so to these we you have created an AWS cloud formation template and 58 00:06:13,150 --> 00:06:16,900 saved it to s3 so we can access that later on so just go into ear and we'll 59 00:06:16,900 --> 00:06:24,100 launch that stack okay so CloudFormer launch stack so it's 60 00:06:24,100 --> 00:06:29,139 already put that in there it's got the URL for that template that we created 61 00:06:29,139 --> 00:06:32,430 using cloud former 62 00:06:39,260 --> 00:06:47,030 okay so again we've got the options there we can click on next and okay that 63 00:06:47,030 --> 00:06:55,370 looks fine and we'll create that and if you refresh your screen we've got our 64 00:06:55,370 --> 00:06:59,420 three stacks there so it's doing the cloud former launched stack 65 00:06:59,420 --> 00:07:06,040 that's going through that and it's creating those resources 66 00:07:08,980 --> 00:07:17,300 okay so we're creating a dynamo DB table and this is going to be called table 67 00:07:17,300 --> 00:07:24,800 backspace lab table products and our stack is finished being completed 68 00:07:24,800 --> 00:07:28,910 there's a being created so to create complete so now we can go into DynamoDB 69 00:07:28,910 --> 00:07:33,470 and we'll have a look at that so just refresh the screen there and we can see 70 00:07:33,470 --> 00:07:40,460 there we've got our our databases being created and we can see there we've got 71 00:07:40,460 --> 00:07:51,560 in the details so we've got here ID with the primary hash key and the provision 72 00:07:51,560 --> 00:07:55,580 throughput capacity so the one difference is that it didn't ask us for 73 00:07:55,580 --> 00:08:00,050 the parameters so because it's created an exact copy of what we've got it 74 00:08:00,050 --> 00:08:03,950 doesn't ask for parameters so it's only puts in this only creates resources 75 00:08:03,950 --> 00:08:09,980 it doesn't copy parameters okay so in the US East region we've got our ARN 76 00:08:09,980 --> 00:08:13,330 there and that's fine so we're going to indexes 77 00:08:13,330 --> 00:08:19,430 again no local secondary index but it's it's copied the global secondary index 78 00:08:19,430 --> 00:08:22,610 which is product category price exactly the same and product category as 79 00:08:22,610 --> 00:08:28,100 the hash key and price as a range key all put all attributes are being 80 00:08:28,100 --> 00:08:32,030 projected and we've got the read capacity units and write capacity units 81 00:08:32,030 --> 00:08:37,280 so again it hasn't asked us for that it's just taken what we've created 82 00:08:37,280 --> 00:08:42,370 originally and I'll see you in the next lesson