Giter Site home page Giter Site logo

geethasathyamurthy / configuration-discovery-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anilkumarnagaraj/configuration-discovery-1

0.0 0.0 0.0 1.13 MB

IBM Cloud Configuration Discovery

License: Apache License 2.0

Dockerfile 0.12% Makefile 0.92% Shell 0.79% Go 20.21% CSS 9.42% HTML 0.86% JavaScript 67.68%

configuration-discovery-1's Introduction

IBM Cloud Configuration Discovery

Use "Configuration Discovery" to import the existing Cloud resources (in your account) and its configuration settings - to auto-generate the terraform configuration file (.tf) and state file (.tfstate).  It makes it easy for you to adopt the Infrastructure-as-Code practices; it can reverse engineer the current IBM Cloud environment (that was provisioned using UI or CLI). 

Dependencies

Steps to use the Configuration Discovery project

Files

  • main.go

    This file contains the web server and handlers.

  • cmd/discovery

    Code for the executable.

Steps to use the project as an executable

  • Build and install the executable to your GOPATH

    make install-cli
    
  • Export the required env vars

    IC_API_KEY: Your ibm cloud api key. Imports resources in that account, for which user has access.
    DISCOVERY_CONFIG_DIR: Directory, where to generate and import the terraform code. discovery uses only this directory for any read/write op.
    
  • Example commands

    discovery config --config_name testfolder
    discovery import --services ibm_is_vpc --config_name testfolder --compact --merge
    

Steps to use the project as a server

  • Start the server

     cd /go/src/github.com
     git clone [email protected]:IBMTerraform/configuration-discovery/.git
     cd configuration-discovery/
     go run main.go docs.go
     http://localhost:8080
    
  • Or

    make run-mac <or make run-local for linux>
    

How to run the Configuration Discovery as a docker container

  • Or run as docker container

    make docker-build
    make docker-run
    

    First two need mongodb service running on localhost:27017. Third needs mongodb running as docker container. To run mongodb as docker container with 27017 exposed outside. This will work for all three methods above. Run this before any of the above steps

     make docker-run-mongo
    

How to run the terraform-ibmcloud-provider-api as a container

    cd /go/src/github.com
    git clone [email protected]:IBMTerraform/configuration-discovery/.git
    cd configuration-discovery/
    docker build -t configuration-discovery .
    docker images
    export API_IMAGE=configuration-discovery:latest
    docker-compose up --build -d

Contributing to Configuration Discovery

Please have a look at the CONTRIBUTING.md file for some guidance before submitting a pull request. Thank you for your help and interest!

Discovery executable

Install

Head over to the releases page and download the latest release and place it under the path. For example,

wget https://github.com/anilkumarnagaraj/terraform-provider-ibm-api/releases/download/v0.1.1/discovery_0.1.1_darwin_arm64.zip
untar discovery_0.1.1_darwin_arm64.zip
mv discovery <$GOPATH/bin or any other directory in path>

Install using go

If you have go installed, run this command

go install github.com/anilkumarnagaraj/terraform-provider-ibm-api/cmd/discovery

Commands

Below commands help you to import your resources into terraform configuration. For more detailed description, run discovery help. For help on a command, run discovery help <command>

Command Description
discovery version IBM Cloud Discovery CLI version. Gives you other dependency information. Shows all supported importable resources
discovery config Create a local configuration directory for importing the terrraform configuration.
discovery import Import TF config for resources in your ibm cloud account. Import all the resources for this service. Imports config and statefile. If a statefile is already present, merging will be done.

Start using discovery executable

Report a Issue / Feature request

  • Is something broken? Have a issue/bug to report? use the Bug report link. But before raising a issue, please check the issues list to see if the issue is already raised by someone
  • Do you have a new feature or enhancement you would like to see? use the Feature request link.

License

The project is licensed under the Apache 2.0 License. A copy is also available in the LICENSE file in this repository.

configuration-discovery-1's People

Contributors

anilkumarnagaraj avatar hkantare avatar

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.