Please enable JavaScript.
Coggle requires JavaScript to display documents.
Learn TERRAFORM - Coggle Diagram
Learn TERRAFORM
Terraform with AWS
-
-
-
Static IPs, DNS, Elastic IPs
private IPs are automatically assigned to EC2 instances and if not explicitly specified in terraform will be picked from the range of the subnet
-
-
-
IAM
-
Users, Groups and Roles
-
-
-
there are many AWS-managed policies that can be attached to roles/groups or a custom policy can be created
-
-
Load Balancers
-
ALB
routes traffic based on application-level information (e.g. route /api and /website to different instances - ELB cannot do that)
allows to define target groups and then attach instances to those target groups. Rules can be registered in listeners that usually have default action that re matched when no other rule applies
with ALB you can specify multiple rules to send traffic to another target and each rule will have a priority assigned
Elastic Beanstalk
AWS PaaS solution (don't manage underlying infra, though you are still responsible for the EC2 instances but AWS provides with updates to apply, either automatically or manually)
-
-
-
AWS CodePipeline
-
support many build tools (npm, maven, ..) and also offers docker support to build your own runtime support
integrates with CodeCommit (git repo), CodeBuild (to run build tooling), CodeDeploy (deploys on Lambda, EC2, ECS)
-
Basics
Provision machines
Terraform doesn't do configuration management, but works well with other tools meant install and configure software (e.g. Ansible)
HCL
Variables
Accessing variables
-
simple types: string, number, bool
complex types: list(type), set(type), map(type), object({<attr_name = <value>, ...}), tuple([<value>,...])
-
Resources
-
define a resource
-
-
-
-
-
Software Provisioning
-
launch a plain AMI and run software provisioning, optionally with tools like e.g. Chef / Ansible
-
-
-
Remote State
-
-
-
if the remote state differs from what specified in HCL, terraform apply will make the needed changes to establish the correct remote state
-
-
Data Sources
-
provide dynamic information e.g. list of AMIs, AZs
-
-
-
-
Advanced Terraform Usage
Interpolation
-
-
-
also some math can be used within interpolation: add, subtract, multiply, divide, modulo e.g. ${2*3 + 5}
Conditionals
-
equality operators: ==, !=
numerical comparison: , >, <, >=, <=
boolean operators: &&, ||, !
Built-in functions
${name(arg1, arg2, ...)} e.g. ${file("key.pub")}
-
-
-
-
-
-
-
-
-
-