Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to Get Your Website Into the Cloud

How to Get Your Website Into the Cloud

In this presentation, I explain how to use the GitHub API, AWS, and Terraform to deploy a website to the cloud in less than an hour.

This version of the talk was given at the 2023 Edition of Open Source 101 as part of the "Developer" track.

Kerim Satirli
PRO

March 23, 2023
Tweet

More Decks by Kerim Satirli

Other Decks in How-to & DIY

Transcript

  1. How to Get Your
    Website Into the Cloud

    View Slide

  2. Sr. Developer Advocate at HashiCorp
    he / him
    @ksatirli
    Kerim
    Satirli

    View Slide

  3. Infrastructure as Code
    01

    View Slide

  4. Challenge:
    Be a Lazy Engineer.

    View Slide

  5. resource "compute_instance" "os101_website" {
    count = 10
    image = "rhel-7.0"
    type = "small"
    has_public_ip = true
    region = "us-east-nc"
    }
    Infrastructure as Code
    server.tf

    View Slide

  6. resource "compute_instance" "os101_website" {
    count = 10
    image = var.image
    type = var.type
    has_public_ip = var.has_public_ip
    region = var.region
    }
    Infrastructure as Code
    server.tf

    View Slide

  7. your code is executable documentation
    versioned code supports collaboration
    workflows become safer and more predictable
    code is text and can be versioned
    Recap

    View Slide

  8. Let’s Build A Website
    02

    View Slide

  9. A Website
    https://opensource101.fun/

    View Slide

  10. A Website
    needs a place to put HTML, CSS, JS, images, etc.
    needs TLS certificate
    optionally: needs a CDN to handle all of the traffic
    needs a domain, DNS Zone, and DNS records

    View Slide

  11. terraform.io/downloads

    View Slide

  12. Install Terraform
    https://developer.hashicorp.com/terraform/downloads

    View Slide

  13. opensource101.fun/repo

    View Slide

  14. Clone the Repository
    https://github.com/ksatirli/get-your-website-into-the-cloud

    View Slide

  15. git clone [email protected]:ksatirli/get-your-website-into-the-cloud.git
    Clone the Repository
    Terminal
    Cloning into 'get-your-website-into-the-cloud'...
    remote: Enumerating objects: 36, done.
    remote: Counting objects: 100% (36/36), done.
    remote: Compressing objects: 100% (31/31), done.
    remote: Total 36 (delta 4), reused 29 (delta 2), pack-reused 0
    Receiving objects: 100% (36/36), 19.55 KiB | 2.79 MiB/s, done.
    Resolving deltas: 100% (4/4), done.

    View Slide

  16. cd get-your-website-into-the-cloud
    Inspect the Code
    Terminal

    View Slide

  17. Inspect the Code
    tree .
    .
    ├── LICENSE
    ├── README.md
    ├── dns.tf
    ├── github.tf
    ├── outputs.tf
    ├── providers.tf
    ├── templates
    ├── terraform.tf
    ├── terraform.tfvars.sample
    ├── variables.tf
    └── website.tf
    Terminal

    View Slide

  18. Initialize Terraform
    terraform init
    Terminal
    Initializing the backend...
    Initializing modules...
    Initializing provider plugins...
    - Installed go-gandi/gandi v2.2.3 (self-signed)
    - Installed integrations/github v5.18.3 (signed by a HashiCorp partner)
    - Installed hashicorp/local v2.4.0 (signed by HashiCorp)
    - Installed hashicorp/random v3.4.3 (signed by HashiCorp)
    - Installed hashicorp/aws v4.59.0 (signed by HashiCorp)
    Terraform has been successfully initialized!

    View Slide

  19. Terraform Registry
    https://registry.terraform.io/

    View Slide

  20. Hands-On
    Workshop

    View Slide

  21. Next Steps
    03

    View Slide

  22. HashiCorp Developer Zone
    https://developer.hashicorp.com/terraform/

    View Slide

  23. Thank you
    speakerdeck.com/ksatirli

    View Slide