Skip to content

Use the ok command-line tool to initialize our first environment

This guide is outdated

The guide is outdated due to us moving from PoC to using micro stacks. The new documentation is not ready yet.

If you are setting up something new, please contact team Kjøremiljø first so we can do this together ❤ For more up to date information about how to set up your infrastructure you can take sneak peek at our reference app pirates-iac.

This guide can still be used for trouble shooting purposes for teams that have not yet taken the micro stack structure in use.

If you don't have ok command-line tool installed you can get it from the tools section.

Learn more about the ok tool on the ok page.

Creating the environment definition file

Navigate to the directory where you checked out the repository in the previous step:

# Example command. 
# Replace <~/projects/our-repository-iac> with the location of your repository
cd ~/projects/our-repository-iac

Create a new directory for the environment you want to create. We will use dev as an example:

mkdir dev
cd dev/

Create a env.yml file in the newly created directory using the following command:

ok env

Open the file in editor of your choice:


Refer to the table below to get an understanding of the different parameters you will have to replace with your own values.

apiVersion: 1.0
kind: Environment

  team: "my-team"
  environment: "my-team-dev"

  accountID: "12345678910"
  region: "eu-west-1"
Parameter Description Validation
team The name of your team. This will be used as part of the name of the S3 bucket that will be created. Alpha-numeric and dashes
environment The name of the environment. This will be used as part of the name of the S3 bucket that will be created to store the remote_state. Note: We recommend that the name contains the environment in question, for example dev/prod/staging. Alpha-numeric and dashes
aws.accountID The AWS account ID where the environment will be created. How do I find my account ID?.
aws.region The AWS region where the environment will be created. Typically: eu-west-1.