Skip to main content

Create and Publish Shared Infrastructure

You will find in this section:

  • How to create a Shared Infra.

It is similar to an Application, it is resources provisioning for the developer. But, here it only provides Cloud resources. It only applies Infrastructure Plugins and does not generate a microservice for the client.

Shared Infrastructure creates infrastructure resources for the environment you are in. This is easier to create applications and infrastructure in the Workspace.

You can create a Shared Infrastructure:

  1. On the StackSpot Website.
  2. Via STK CLI.

See the two options below:

1. Stackspot Website

Requirements

Follow the steps below:

Step 1. In your Workspace dashboard, click on the 'Create' button in the lower left corner of the screen.

Step 2. Click on the 'Shared Infrastructures' button;

Step 3. Select a Stack to be the Infrastructure basis. Choose the available Infrastructure Plugins and click on the 'Next' button.

info

This Infrastructure Stack has already been created. You need to configure it and upload it.
Check the list with the pre-selected Infrastructure Plugins of the Stack. Choose which you want to apply. This is a required field.

Step 4. On the Source Code Repository screen, select one of the available options: Create repository (to create a new repository) or I already have a repository (use an existing repository).

If you click the Create repository button, fill out the fields:

  • Name: Your repository name.
  • Visibility: The repository visibility. It can be public or private.
  • Description: The repository description.

In this option, an Action will create the repository.

If you select the I already have a repository button, fill out the fields:

  • Name: Your repository name.
  • Repository URL: The URL of your repository.
  • Description: The repository description.

Then, click on the 'Next step' button;

Step 5. Under Apply Infra Plugins, you will find the fields related to the Infra Plugins configured in the Stack. For example ECS-Cluster and VPC. Fill them out and click on 'Next'.

Step 6. On the Review and Publish screen, review the Infrastructure. Click on the 'Commit' button. The code commit happens to the repository you added during the setup.

After you finish the commit, a pipeline flow (Git Flow) happens. The infrastructure deployment is made along the Cloud resources provisioning.

When the deployment ends, the developer can use the Shared Infrastructure in the Application.

You can add external tools to a Shared Infrastructure through Links.

info
  • You can add Links to Stacks and Plugins.
  • If you add any Stack to your Shared Infrastructure that already has a Link, they are also added. You can't delete them. This scenario also happens with Links added to a Workspace where you created your Shared Infrastructure.

Follow the steps to add Links below:

Step 1. In your Workspace, go to the 'Shared Infrastructure' tab. Click on the Shared Infra you want to add a Link to;

Step 2. In the bar below the Shared Infrastructure name, click on the button to the right with the Add symbol;

info

If the Stack you used to create the Shared Infrastructure has a Link, you will see it on this bar after the deploy.

Step 3. Fill out the fields with the following information, see the example:

  • 'Link Name': Service Now.
  • 'URL': https://www.servicenow.com.br.
  • Logo: An image. It's optional.

Step 4. Click on the 'Add link' button;

Done!

You added a Link to your Shared Infrastructure. To view all the available Links, go to the Dashboard on the left side menu.

2. Via STK CLI

Requirements

Follow the steps below:

Step 1. In your terminal, select your Workspace. Execute the command:

 stk use workspace <WORKSPACE-NAME>

Step 2. To create a Shared Infrastructure, execute the command:

stk create infra <WORK-NAME> -s <STARTER>

Step 3. Choose which Infra Plugins you want to apply. You can choose the options:

  1. Select the Plugins in interactive mode. In this case, you cannot use the --plugin flag. See an example:
stk create infra my-infra02 -s studio-cli/stack-cli
  1. Apply a single Infra Plugin. Example:
stk create infra my-infra -s studio-cli/stack-cli --plugins "studio-cli/stack-demo/plugin-lambda@0.0.1"

  1. Apply several Infra Plugins with the --plugin flag. See the example:
stk create infra my-infra02 -s studio-cli/stack-cli --plugins "studio-cli/stack-cli/plugin-lambda@0.0.1,studio-cli/stack-cli/plugin-sm@1.0.2"

Step 4. Answer the questions in the terminal.

Step 5. Register your Shared Infra into the Account. Execute:

stk register infra

Step 6. Commit to a Git repository, follow the command sequence:

git init

git add .

git commit -m "first commit"

git push

Done!

You created a Shared Infrastructure.

  • You can track on the StackSpot website, the health of your infrastructure. For more information, see the Activities section.

Next step

Was this page helpful?