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