Code Monkey home page Code Monkey logo

terraform-provider-cloudautomator's Introduction

Terraform Provider For Cloud Automator

Terraform provider for Cloud Automator

Requirements

Building The Provider

Clone repository to: $GOPATH/src/github.com/penta515/terraform-provider-cloudautomator

$ mkdir -p $GOPATH/src/github.com/penta515; cd $GOPATH/src/github.com/penta515
$ git clone [email protected]:penta515/terraform-provider-cloudautomator

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/penta515/terraform-provider-cloudautomator
$ make install VERSION=0.2.2

Authentication and Configuration

Cloud Automator Provider authentication settings are applied in the following order.

  1. Parameters in the provider configuration
  2. Environment variables

Provider Configuration

provider "cloudautomator" {
  api_key = "abcdefghijklmnopqrstuvwxyz"
}

Environment Variables

provider "cloudautomator" {}
$ export CLOUD_AUTOMATOR_API_KEY="abcdefghijklmnopqrstuvwxyz"
$ terraform plan

Custom Endpoint Configuration

Cloud Automator Provider can be customized to connect to non-default endpoints and is applied in the following order.

  1. Parameters in the provider configuration
  2. Environment variables

Provider Configuration

provider "cloudautomator" {
  ...

  endpoint = "http://localhost:3000/api/v1"
}

Environment Variables

provider "cloudautomator" {}
$ export CLOUD_AUTOMATOR_API_ENDPOINT="http://localhost:3000/api/v1"
$ terraform plan

Usage Example

# Configure the Cloud Automator Provider
terraform {
  required_providers {
    cloudautomator = {
      source = "penta515/cloudautomator"
      version = "0.2.2"
    }
  }
}

provider "cloudautomator" {}

resource "cloudautomator_job" "example-job" {
  name = "example-job"

  group_id       = 10
  aws_account_id = 20

  rule_type = "cron"
  cron_rule_value {
    hour          = "9"
    minutes       = "30"
    schedule_type = "weekly"
    weekly_schedule = [
      "monday",
      "sunday"
    ]
    time_zone                 = "Tokyo"
    dates_to_skip             = ["2022-12-31"]
    national_holiday_schedule = "true"
  }

  action_type = "delay"
  delay_action_value {
    delay_minutes = 1
  }

  completed_post_process_id = [100]
  failed_post_process_id    = [200]
}

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.