ladderlore
  • S3 や IAM などのサービス名を入力してください。

概念

Infrastructure as code (IaC)

Describing your infrastructure in files, so that a tool can build it the same way every time.

このレッスンはまだ翻訳されていないため、英語で表示しています。

テンプレート
CloudFormation
Development
Test
Production
  1. 1You describe the environment once, in a template.
  2. 2CloudFormation builds an identical copy wherever you need one.
One template, three identical environments.

流れ

  1. 1You describe the environment once, in a template.
  2. 2CloudFormation builds an identical copy wherever you need one.
  • The first build

    By hand in the console
    Quick: a few clicks
    Infrastructure as code
    Slower: you write the template first
  • Building it again

    By hand in the console
    Every step again, by hand
    Infrastructure as code
    Run the same template
  • Risk of mistakes

    By hand in the console
    Steps get missed or done differently
    Infrastructure as code
    Low: the same result every time
  • Tracking changes

    By hand in the console
    Hard to see what changed and why
    Infrastructure as code
    Every version is saved, reviewed and can be restored
  • Best for

    By hand in the console
    One-time tasks and learning
    Infrastructure as code
    Anything you will build or change again
One-time work by hand, or a repeatable process as code.

1 / 3

  • The first build

    By hand in the console
    Quick: a few clicks
    Infrastructure as code
    Slower: you write the template first
  • Building it again

    By hand in the console
    Every step again, by hand
    Infrastructure as code
    Run the same template

2 / 3

  • Risk of mistakes

    By hand in the console
    Steps get missed or done differently
    Infrastructure as code
    Low: the same result every time
  • Tracking changes

    By hand in the console
    Hard to see what changed and why
    Infrastructure as code
    Every version is saved, reviewed and can be restored

3 / 3

  • Best for

    By hand in the console
    One-time tasks and learning
    Infrastructure as code
    Anything you will build or change again
One-time work by hand, or a repeatable process as code.

概要

Infrastructure as code means you describe the resources you need, such as a network, servers and a database, in a text file instead of creating them by hand. A tool reads the file, called a template, and builds everything for you. On AWS, the main tool for this is AWS CloudFormation.

Because the template is a file, you can keep it in version control, review a change before it is made, and go back to an earlier version. The same template builds identical environments for development, testing and production, or a copy in another Region for disaster recovery.

概要

Writing a template takes more effort than a few clicks, so a one-time experiment is fine in the console. IaC pays off whenever you must build or change the same thing more than once. Developers can also define infrastructure in a programming language with the AWS Cloud Development Kit (AWS CDK), which deploys through CloudFormation.

覚えること

  • Repeatable: the same template builds the same environment every time.
  • Fewer mistakes: no forgotten steps or typing errors.
  • Changes are reviewed and versioned like application code, and can be rolled back.
  • Fast recovery: rebuild a whole environment, even in another Region.

覚えること

  • On AWS, the main IaC service is AWS CloudFormation.

試験では

  • “Repeatable”, “consistent across environments” or “keep infrastructure in version control” points to infrastructure as code, with AWS CloudFormation.
  • “A one-time task” or “try out a service” points to the console. IaC is for things you will do again.