diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 06147d9..da7ba59 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -1,5 +1,5 @@ Getting Started - AsCode - Terraform Alternative Syntax

Getting Started

This page explains the basics of using AsCode to define your infrastructure in Terraform. It assumes that you have already installed Ascode.

> ascode --help
+

Getting Started

This page explains the basics of using AsCode to define your infrastructure in Terraform. It assumes that you have already installed AsCode.

> ascode --help
 Usage:
   ascode [OPTIONS] <repl | run | version>
 
@@ -23,7 +23,7 @@ resource "aws_instance" "web
   provider      = aws.id_01E4JV722PS2WPKK7WQ2NMZY6D
   instance_type = "t2.micro"
 }
-

The run command

The run command executes a valid Starlack program. Using the --print-hcl and --to-hcl, an HCL encoded version of the tf object will be printed or saved to a given file, respectively.

This is the first step to deploy any infrastructure d defined with AsCode, using run and generating a valid .tf file, we can use the standard Terraform tooling to deploy our infrastructure using terraform init, terraform plan and terraform apply.

To learn about writing Starlark programs, please refer to the Language definition and the API Reference sections of this documentation.

Basic Example

The goal of the example is create, in DigitalOcean, one s-1vcpu-1gb instance called web in the nyc2 region:

For running this example, you need terraform correctly installed on your system.

> mkdir example; cd example
+

The run command

The run command executes a valid Starlack program. Using the --print-hcl and --to-hcl, an HCL encoded version of the tf object will be printed or saved to a given file, respectively.

This is the first step to deploy any infrastructure defined with AsCode, using run and generating a valid .tf file, we can use the standard Terraform tooling to deploy our infrastructure using terraform init, terraform plan and terraform apply.

To learn about writing Starlark programs, please refer to the Language definition and the API Reference sections of this documentation.

Basic Example

The goal of the example is to create, in DigitalOcean, one s-1vcpu-1gb instance called web in the nyc2 region:

To run this example, you need terraform correctly installed on your system.

> mkdir example; cd example
 > echo 'do = tf.provider("digitalocean")' > main.star
 > echo 'web = do.resource.droplet("web", name="web", size="s-1vcpu-1gb")' >> main.star
 > echo 'web.region = "nyc2"' >> main.star
@@ -44,7 +44,7 @@ resource "digitalocean_droplet" 
 }
 
 
-

And now as it’s common in terraform we can run init, plan or/and apply

> terraform init
+

And now as it’s usual in terraform we can run init, plan or/and apply

> terraform init
 ...
 > terraform plan
 Terraform will perform the following actions:
diff --git a/docs/github-action/index.html b/docs/github-action/index.html
index 54968be..fd53546 100644
--- a/docs/github-action/index.html
+++ b/docs/github-action/index.html
@@ -1,5 +1,5 @@
 GitHub Action - AsCode - Terraform Alternative Syntax

GitHub Action

AsCode Github Action allows to execute AsCode run command in response to a GitHub event such as updating a pull request or pushing a new commit on a specific branch.

This used in combination with the Terraform GitHub Actions allows to execute the different terraform commands init, plan and apply inside of a GitHub Workflow.

Parameters

ParameterMandatory/OptionalDescription
fileMandatoryStarlark file to execute. Default value: main.star
hclMandatoryHCL output file. Default value: generated.tf
name: 'Terraform & AsCode'
+

GitHub Action

AsCode Github Action allows to execute AsCode run command in response to a GitHub event such as updating a pull request or pushing a new commit to a specific branch.

This used in combination with the Terraform GitHub Actions allows to execute the different terraform commands init, plan and apply inside of a GitHub Workflow.

Parameters

ParameterMandatory/OptionalDescription
fileMandatoryStarlark file to execute. Default value: main.star
hclMandatoryHCL output file. Default value: generated.tf
name: 'Terraform & AsCode'
 on:
   push:
     branches:
@@ -12,14 +12,14 @@
     runs-on: ubuntu-latest
     env:
         TF_VERSION: latest
-        TF_WORKING_DIR: . 
+        TF_WORKING_DIR: .
     steps:
       - name: 'Checkout'
         uses: actions/checkout@master
 
       - name: 'AsCode Run'
         uses: mcuadros/ascode@gh-action
-     
+
       - name: 'Terraform Init'
         uses: hashicorp/terraform-github-actions@master
         with:
diff --git a/docs/index.html b/docs/index.html
index 0627b7a..bbcb857 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,2 +1,2 @@
 Documentation - AsCode - Terraform Alternative Syntax
Overview

Documentation

AsCode - Terraform Alternative Syntax

AsCode is a tool to define infrastructure as code using the Starlark language on top of Terraform. It allows to describe your infrastructure using an expressive language in Terraform without writing a single line of HCL, meanwhile, you have the complete ecosystem of providers

Why?

Terraform is a great tool, with support for almost everything you can imagine, making it the industry leader. Terraform is based on HCL, a JSON-alike declarative language, with minimal control flow functionality. IMHO, to unleash the power of the IaC, a powerful, expressive language should be used, where basic elements like loops or functions are first-class citizens.

What is Starlark?

Starlark is a dialect of Python intended for use as a configuration language. A Starlark interpreter is typically embedded within a larger application, and this application may define additional domain-specific functions and data types beyond those provided by the core language. For example, Starlark is embedded within (and was originally developed for) the Bazel build tool, and Bazel’s build language is based on Starlark.

Overview

Documentation

AsCode - Terraform Alternative Syntax

AsCode is a tool to define infrastructure as code using the Starlark language on top of Terraform. It allows to describe your infrastructure using an expressive language in Terraform without writing a single line of HCL, meanwhile, you have the complete ecosystem of providers

Why?

Terraform is a great tool, with support for almost everything you can imagine, making it the industry leader. Terraform is based on HCL, a JSON-alike declarative language, with minimal control flow functionality. IMHO, to unleash the power of the IaC, a powerful, expressive language should be used, where basic elements like loops or functions are first-class citizens.

What is Starlark?

Starlark is a dialect of Python intended to be used as a configuration language. A Starlark interpreter is typically embedded within a larger application, and this application may define additional domain-specific functions and data types beyond those provided by the core language. For example, Starlark is embedded within (and was originally developed for) the Bazel build tool, and Bazel’s build language is based on Starlark.