This document describes how to get started with GruCloud on AWS.
The following use case diagram depicts an overview of what a Solution Architect/DevOps can perform with GruCloud.
While the previous use case diagram shows a high-level description, the next flowchart diagram details the commands to perform to migrate an existing infrastructure to GruCloud, regardless of how the infrastructure was deployed: via the web interface, or via an IaC tool such as Terraform, pulumi or the AWS CDK.
- AWS Account
- AWS CLI
- Access and Secret Key
Ensure access to the Amazon Console and create an account if necessary.
Ensure the AWS CLI is installed and configured:
Access and Secret Key
Visit the security credentials
- Click on Access key (access key ID and secret access key).
- Click on the button Create New Access Key.
Write down the AWSAccessKeyId and AWSSecretKey
In a further episode, the access and secret key will be obtained from a dedicated IAM user with the correct role and policy.
Getting the GruCloud CLI
This chart describes the way to install gc, the GruCloud CLI:
node is present on your system
The version must be greater than 14
Install the GrucCloud command-line utility gc with npm
npm i -g @grucloud/core
Check the current version of gc:
gc new Create a new project
The new command guides you on how to create and configure a new project.
Below is the screencast of gc new:The boilerplate project is now created and configured.
gc list List the live resources
Visualize your current infrastructure with the list command:
gc list --graph
The following diagram is taken from the ec2-vpc example
gc gencode Generate the code
The gencode command fetches the live resources and generate the code in
The following flowchart explains in more detail the process of generating the code from the live infrastructure.
At this point, the target infrastructure matches the live infrastructure.
gc graph Target Graph
The graph command creates a dependency graph of the target resources:
graphcommand requires graphviz to convert the generated
artifacts/diagram-target.dotinto an image such as
gc tree Resource mind map
Given the target resources defined in resources.js, let's generate a mindmap of the target resources by group and type with the tree command.
gc apply Update
To update the infrastructure, either use the AWS console and run gc gencode, or modify directly the file resource.js. Once done, use the apply command to update the infrastructure:
For instance, let's change the EC2 InstanceType from t2.micro to t2.small. The machine will be stopped, its InstanceType changed, and finally, the machine will be started.
gc destroy Destroy
Resources can be destroyed in the right order with the destroy command: