github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/website/source/intro/getting-started/infra.html.md (about)

     1  ---
     2  layout: "intro"
     3  page_title: "Infrastructure"
     4  sidebar_current: "gettingstarted-infra"
     5  description: |-
     6    Build the infrastructure to support your applications with Otto.
     7  ---
     8  
     9  # Infrastructure
    10  
    11  In the previous step, we got a development environment up and running with no
    12  configuration and a couple simple commands. Now, let's deploy that application.
    13  
    14  To deploy an application, Otto has three steps: start an infrastructure,
    15  build the application, and launch the application. We'll go over each of
    16  these steps on a separate page in the getting started guide.
    17  
    18  We'll deploy the application to [AWS](https://aws.amazon.com) for
    19  the getting started guide since it is popular and generally well understood, but
    20  Otto can deploy to many different infrastructure providers.
    21  
    22  If you don't have an AWS account, [create one now](https://aws.amazon.com/free/).
    23  For the getting started guide, we'll only be using resources which qualify
    24  under the AWS [free-tier](https://aws.amazon.com/free/), meaning it will be free.
    25  If you already have an AWS account, you may be charged some amount of money,
    26  but it shouldn't be more than a few dollars at most.
    27  
    28  ~> **Warning!** If you're not using an account that qualifies under the AWS
    29  free-tier, you may be charged to run these examples. The most you should be
    30  charged should only be a few dollars, but we're not responsible for any
    31  charges that may incur.
    32  
    33  ## Infrastructure
    34  
    35  The first step before an application is deployed is to build an
    36  infrastructure to deploy to. Within Otto, "infrastructure" refers to
    37  a target cloud platform and the minimum resources necessary to run
    38  applications.
    39  
    40  Using AWS as an example, Otto creates a VPC, subnets, proper routing tables,
    41  an internet gateway, and more. If you're not familiar with this, that's okay!
    42  That is the point of Otto: to codify infrastructure best practices so
    43  you don't have to know them on day one.
    44  
    45  For each cloud platform, Otto knows multiple "flavors" of that
    46  infrastructure. These flavors target different goals and users. In our AWS
    47  example, a couple available flavors are "simple" and "vpc-public-private."
    48  The "simple" flavor uses a minimal number of resources, sacrificing
    49  scalability and fault tolerance for simplicity and cost. But
    50  "vpc-public-private" automatically sets up private networks, bastion
    51  hosts, NAT instances, etc. and is more scalable for a real long term
    52  infrastructure.
    53  
    54  By default, Otto defaults to the "simple" flavor of AWS, and that is the
    55  flavor we'll use in this getting started guide. You can learn more about
    56  infrastructures and flavors in the [documentation](/docs).
    57  
    58  ## Launch
    59  
    60  To launch the infrastructure, run `otto infra`.
    61  
    62  This step is likely going to ask you for permission to install
    63  [Terraform](https://www.terraform.io). Otto uses Terraform under the covers
    64  to build and manage the infrastructure. If you say yes, Otto will install
    65  this for you. If you already have the latest version of Terraform installed,
    66  you won't be asked.
    67  
    68  After installing Terraform, Otto will ask you for your AWS access
    69  credentials. These are available from
    70  [this page](https://console.aws.amazon.com/iam/home?#security_credential).
    71  
    72  Next, Otto will go forward and build you an infrastructure. This will
    73  take a few minutes. During this time, you can attempt to read the output,
    74  which will be fairly verbose. You'll see Otto creating a lot of cloud
    75  resources.
    76  
    77  ```
    78  $ otto infra
    79  ...
    80  
    81  ==> Building main infrastructure...
    82  ==> Executing Terraform to manage infrastructure...
    83      Raw Terraform output will begin streaming in below. Otto
    84      does not create this output. It is mirrored directly from
    85      Terraform while the infrastructure is being created.
    86  
    87      Terraform may ask for input. For infrastructure provider
    88      credentials, be sure to enter the same credentials
    89      consistently within the same Otto environment.
    90  
    91  aws_vpc.main: Creating...
    92    cidr_block:                "" => "10.0.0.0/16"
    93    default_network_acl_id:    "" => "<computed>"
    94    default_security_group_id: "" => "<computed>"
    95    dhcp_options_id:           "" => "<computed>"
    96    enable_dns_hostnames:      "" => "1"
    97    enable_dns_support:        "" => "1"
    98    main_route_table_id:       "" => "<computed>"
    99    tags.#:                    "" => "1"
   100    tags.Name:                 "" => "otto"
   101  aws_vpc.main: Creation complete
   102  aws_internet_gateway.public: Creating...
   103    vpc_id: "" => "vpc-ac8f5ac8"
   104  
   105  ...
   106  ```
   107  
   108  The types and number of resources created are determined by the infrastructure
   109  flavor, as mentioned above. For flavors such as "vpc-public-private," the
   110  initial `infra` can take several minutes.
   111  
   112  **Congratulations!** You've just launched an infrastructure with the
   113  minimum necessary number of components to deploy one or many applications.
   114  
   115  If you've never used AWS before, or you don't consider yourself an operator,
   116  Otto just used industry best practices for simple applications to launch
   117  and configure a robust infrastructure for you.
   118  
   119  ## Status
   120  
   121  You can see the status of your infrastructure at any point by running
   122  `otto status`:
   123  
   124  ```
   125  $ otto status
   126  ==> App Info
   127      Application:    otto-getting-started (ruby)
   128      Project:        otto-getting-started
   129      Infrastructure: aws (simple)
   130  ==> Component Status
   131      Dev environment: CREATED
   132      Infra:           READY
   133      Build:           NOT BUILT
   134      Deploy:          NOT DEPLOYED
   135  ```
   136  
   137  You can see that the "Infra" is "READY." This means that step is complete.
   138  
   139  Note that even if an infrastructure is ready, you can always run `otto infra`
   140  multiple times. Otto will only create infrastructure resources that don't exist.
   141  
   142  ## Next
   143  
   144  In this step, you learned about how Otto manages infrastructures
   145  and built a simple infrastructure that we can deploy applications to.
   146  
   147  The goal of Otto is build real, production quality infrastructures
   148  for hobbyists or professionals. Otto codifies industry best practices
   149  and brings them to you in a single command.
   150  
   151  Next, we'll [build this application](/intro/getting-started/build.html)
   152  to prepare it for being deployed.