Provisioning
Infrastructure To AWS
Using Terraform
Eero Lempiö
Introduction
So what is AWS?
Amazon Web Services, a subsidiary
of Amazon,
“offers reliable, scalable, and
inexpensive cloud computing
services”
A fancy way of saying “do
stuff in the cloud”
Broad range of services (over 160)
AWS services
Storage Compute Networking Database
S3 Lambda Api Gateway RDS
EFS EC2 Route 53 DynamoDB
... ... ... ...
Example
project
It needs to be:
● Authenticated
● Fetch and update customer
data
Implement a
REST API on
AWS
What we will need
● Lambda: Function as a service
○ The code for our API
● DynamoDB: AWS’s NoSQL database system
○ All of our data
● Api Gateway: Publish and maintain APIs
○ Connect to our Lambda and authenticate
● Route 53: Cloud Domain Name System
○ Routing to our Api Gateway from our domain
● IAM: Identity and Access Management
○ Manage access rights to the AWS-services in our use
But there is a
problem..
Graphical interfaces
So many interfaces...
Emerging issues
● At this point we need a complex readme for setup
● Changes require more clicking around in the
interface
● Deployment for different stages means redoing the
whole process
Who can save us now?
Terrafor
m
Terraform
● Infrastructure as code
● Define and provision infrastructure from files
● High-level configuration language
● Terraform will create an
execution plan based on
configuration files
● Terraform will adapt to
changes and create
incremental execution
plans which can be applied.
How does it work?
● We define our architecture
in modules
● Modules have input and
output values
○ Can be used for example to
control the deployment stage
with variables or to expose
parts of an other module
● Resource blocks describe
resources terraform will
create for us
● Data block reads from a
given source and exports
the data for our use
Structure of a module
With clever use of variables, we
can easily deploy to different
stages
● For example we can prefix
every resource with the
environment name
Deploying
And now we have
deployed !
Afterwords
Terraform can be difficult
● Something will break
● You will be angry
But it will all be worth it...
...with our finished API
FIN.

Provisioning infrastructure to AWS using Terraform – Exove

  • 1.
  • 2.
  • 3.
    So what isAWS? Amazon Web Services, a subsidiary of Amazon, “offers reliable, scalable, and inexpensive cloud computing services” A fancy way of saying “do stuff in the cloud”
  • 4.
    Broad range ofservices (over 160) AWS services Storage Compute Networking Database S3 Lambda Api Gateway RDS EFS EC2 Route 53 DynamoDB ... ... ... ...
  • 5.
  • 6.
    It needs tobe: ● Authenticated ● Fetch and update customer data Implement a REST API on AWS
  • 7.
    What we willneed ● Lambda: Function as a service ○ The code for our API ● DynamoDB: AWS’s NoSQL database system ○ All of our data ● Api Gateway: Publish and maintain APIs ○ Connect to our Lambda and authenticate ● Route 53: Cloud Domain Name System ○ Routing to our Api Gateway from our domain ● IAM: Identity and Access Management ○ Manage access rights to the AWS-services in our use
  • 8.
    But there isa problem..
  • 9.
  • 10.
  • 11.
    Emerging issues ● Atthis point we need a complex readme for setup ● Changes require more clicking around in the interface ● Deployment for different stages means redoing the whole process Who can save us now?
  • 12.
  • 13.
    Terraform ● Infrastructure ascode ● Define and provision infrastructure from files ● High-level configuration language
  • 14.
    ● Terraform willcreate an execution plan based on configuration files ● Terraform will adapt to changes and create incremental execution plans which can be applied. How does it work?
  • 15.
    ● We defineour architecture in modules ● Modules have input and output values ○ Can be used for example to control the deployment stage with variables or to expose parts of an other module
  • 16.
    ● Resource blocksdescribe resources terraform will create for us ● Data block reads from a given source and exports the data for our use Structure of a module
  • 17.
    With clever useof variables, we can easily deploy to different stages ● For example we can prefix every resource with the environment name Deploying And now we have deployed !
  • 18.
  • 19.
    Terraform can bedifficult ● Something will break ● You will be angry But it will all be worth it...
  • 20.
  • 21.