Git Product home page Git Product logo

instana-terraform-scripts's Introduction

instana-terraform-scripts

The script in this repository creates a Resource group, VPC, Subnet, Public Gateway and VM (Virtual Server Instance) with essential security groups, required for Instana installation in the target IBM Cloud account and installs Instana in it.

Clone the repository

git clone https://github.com/vksuktha/instana-terraform-scripts

Generate SSH key

Instana VM requires an SSH Key, so run the following command to generate it:

cd instana-terraform-scripts
chmod 755 create-ssh-keys.sh
./create-ssh-keys.sh

Public and private ssh key pair files ssh-instana.pub and ssh-instana get generated in the project directory.

Provide variable values

Rename the variable template file terraform.tfvars.tmpl to terraform.tfvars file and assign values to all variables.

cp terraform.tfvars.tmpl terraform.tfvars

Then edit the terraform.tfvars file to define the following keys:

ibmcloud_api_key=""                             # IBM Cloud Account API Key
RESOURCE_PREFIX="instana"                       # Prefix value which will be added to all resources
region="us-south"                               # IBM Cloud region 
zone="us-sount-1"                               # IBM Cloud zone
sales_id="xxxx"                                 # Instana license sales_id
agent_key="xxxxxxxx"                            # Instana license agent_key
name="instana-vm"                               # The name for instana VM to be created"
ssh_instana_public_key_file="ssh-instana.pub"   # SSH PUBLIC KEY file path
ssh_instana_private_key_file="ssh-instana"      # SSH PRIVARTE KEY file path

Install Instana

To create VM and install Instana execute following command:

terraform init
terraform plan
terraform apply -auto-approve

Instana credentials and IP address of the VM would be displayed after VM is provisioned and Instana setup is complete.

Note: The user of the provided API key, needs to have privileges to create resource-group, vpc, sunet, ssh-key and VSI instances and also IP-spoofing Operator in IBM Cloud. For enabling IP-Spoofing Operator privilege check IAM prerequisites section in this blog.

Access Instana

Instana can be accessed though the browser https://<IP_Address>. Credentials to access Instana can also be found in the VM at /instana/instana_credentials.txt

Instana VM can be accessed using the SSH private key file generated in the project directory earlier.

ssh -i ssh_instana root@<IP_Address>

Module details

The code available in this repository can be invoked as a module from external terraform script as follows:

module "instana_instance" {
  source = "github.com/vksuktha/instana-terraform-scripts?ref=v1.0.2"

  name                 = var.name
  RESOURCE_PREFIX      = var.RESOURCE_PREFIX
  ibmcloud_api_key     = var.ibmcloud_api_key
  region               = var.region
  zone                 = var.zone
  sales_id             = var.sales_id
  agent_key            = var.agent_key
  ssh_instana_public_key_file = var.ssh_instana_public_key_file
  ssh_instana_private_key_file = var.ssh_instana_private_key_file
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.