GithubHelp home page GithubHelp logo

jason-zhang9309 / terraform-provider-flexibleengine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flexibleenginecloud/terraform-provider-flexibleengine

0.0 1.0 0.0 24.91 MB

Terraform flexibleengine provider

Home Page: https://www.terraform.io/docs/providers/flexibleengine/

License: Mozilla Public License 2.0

Makefile 0.05% Go 99.88% Shell 0.07%

terraform-provider-flexibleengine's Introduction

Terraform FlexibleEngine Provider

Quick Start

When using the FlexibleEngineCloud Provider with Terraform 0.13 and later, the recommended approach is to declare Provider versions in the root module Terraform configuration, using a required_providers block as per the following example. For previous versions, please continue to pin the version within the provider block.

  1. Add FlexibleEngineCloud/flexibleengine to your required_providers.

    # provider.tf
    terraform {
      required_version = ">= 0.13"
    
      required_providers {
        flexibleengine = {
          source = "FlexibleEngineCloud/flexibleengine"
          version = ">= 1.30.0"
        }
      }
    }
  2. Run terraform init -upgrade to download/upgrade the provider.

  3. Add the provider and Authenticate.

    • AK/SK Authenticate
    # provider.tf
    
    # Configure the FlexibleEngine Provider with AK/SK
    provider "flexibleengine" {
      access_key  = "access key"
      secret_key  = "secret key"
      domain_name = "domain name"
      region      = "eu-west-0"
    }
    • Username/Password Authenticate
    # provider.tf
    
    # Configure the FlexibleEngine Provider with Username/Password 
    provider "flexibleengine" {
      user_name   = "user name"
      password    = "password"
      domain_name = "domain name"
      region      = "eu-west-0"
    }
  4. Create your first resource.

    # main.tf
    
    # Create an Elastic Cloud Server resource
    resource "flexibleengine_compute_instance_v2" "test-server" {
      name        = "test-server"
      image_name  = "OBS Ubuntu 18.04"
      flavor_name = "t2.micro"
      key_pair    = "kp_ecs"
      security_groups = ["default"]
      network {
        uuid = "55534eaa-533a-419d-9b40-ec427ea7195a"
      }
    }

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.18+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

Building the Provider

  1. Clone repository to $GOPATH/src/github.com/FlexibleEngineCloud/terraform-provider-flexibleengine with go get or git clone.

    go get github.com/FlexibleEngineCloud/terraform-provider-flexibleengine
    cd $GOPATH/src/github.com/FlexibleEngineCloud/terraform-provider-flexibleengine
    git clone [email protected]:FlexibleEngineCloud/terraform-provider-flexibleengine.git
  2. Enter the provider directory and build the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

    cd $GOPATH/src/github.com/FlexibleEngineCloud/terraform-provider-flexibleengine
    make build
  3. In order to test the provider, you can simply run make test.

    make test

Acceptance Testing

Before making a Pull Request or a release, the resources and data sources shoule be tested with acceptance tests.

The following environment variables are required before running the acceptance testing:

export OS_ACCESS_KEY=xxx
export OS_SECRET_KEY=xxx
export OS_REGION_NAME=xxx
export OS_IMAGE_ID=xxx
export OS_FLAVOR_ID=xxx
export OS_NETWORK_ID=xxx

Then we can run the acceptance tests with make testacc.

make testacc TEST='./flexibleengine' TESTARGS='-run TestAccXXXX'

Note: Acceptance tests create real resources, and often cost money to run.

Add the TF_LOG and TF_LOG_PATH environment variables to the system, and then you can view detailed logs. For example, in a Linux operating system, run the following commands:

export TF_LOG=TRACE
export TF_LOG_PATH="./terraform.log"

License

Terraform-Provider-FlexibleEngine is under the Mozilla Public License 2.0. See the LICENSE file for details.

terraform-provider-flexibleengine's People

Contributors

jtopjian avatar niuzhenguo avatar shichangkuo avatar khdegraaf avatar jrperritt avatar fatmcgav avatar jason-zhang9309 avatar garyxia avatar grubernaut avatar ggiamarchi avatar freesky-edward avatar zippo-wang avatar zengchen1024 avatar azrod avatar mitchellh avatar edisonxiang avatar radeksimko avatar zhongjun2 avatar appilon avatar dupuy avatar chengxiangdong avatar julienvey avatar mcanevet avatar sheile avatar stack72 avatar takaishi avatar berendt avatar hmbig2 avatar dependabot[bot] avatar savasw avatar

Watchers

James Cloos 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.