Coder Social home page Coder Social logo

erikvanbrakel / terraform-provider-sumologic Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 9.0 9.9 MB

This project is done. It has been integrated into https://github.com/SumoLogic/sumologic-terraform-provider

License: MIT License

Go 94.00% Ruby 4.70% Shell 1.30%
terraform sumologic terraform-provider

terraform-provider-sumologic's Introduction

terraform-provider-sumologic

Build Status

Terraform provider for https://sumologic.com

Building the provider

In this section you will learn how to build and run terraform-provider-sumologic locally. Please follow the steps below:

Requirements

  • Terraform 0.9.x
  • Go 1.8 (to build the provider plugin)
  • Sumologic Must have an account to be able to get access id and key.

Setting your environment

Create the couple environment variables below:

$GOROOT = $HOME/go

$GOPATH = $GOROOT/bin

The GOPATH can be set wherever you want but please read this topic to understand how they work.

Clone repository to: $GOPATH/src/github.com/erikvanbrakel/terraform-provider-sumologic Terraform provider for https://sumologic.com

Installation

Download the binary for your platform and architecture from the releases page. Unpack the zip, and place the terraform-provider-sumologic binary in the same directory as terraform binary or add a .terraformrc file with the provider stanza:

providers {
  sumologic = "/PATH/TO/MODULE/ARCH/terraform-provider-sumologic"
}

Usage

See the documentation.

terraform-provider-sumologic's People

Contributors

bjweaver avatar g-wattz avatar josacar avatar jreslock avatar shinitiandrei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-provider-sumologic's Issues

Update releases

0.2.3 release happened a while ago and some good stuff was added since then.

Could you create a new release? Thanks

The provider is not saving its state

Hi! @erikvanbrakel

I've been using your provider for a while now and everything is working really good! ๐Ÿ˜ƒ
I just wanna ask you if you're planning to add the function that saves the state of Sumologic.
For example, I just created a new Collector with a Polling Source and they're created successfully. However, any changes made in my terraform code, in sumologic resources, are not saved in the terraform.tfstate. So, whenever I run terraform plan it says that there are no changes in my code.

Another question, are you also planning to make a pull request to terraform to add this provider in a near future?

Thank you again!

Improve error handling

When something goes wrong, the current error messages don't really point you in any direction. In general, it just complains about JSON format or something....

exits without any error

The plan goes without an issue , but when trying to apply it just dies without any exception

{code}
Error: Error applying plan:

1 error(s) occurred:

  • module.cluster_bootstrap.sumologic_collector.collector: 1 error(s) occurred:

  • sumologic_collector.collector:

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
{code}

config is pretty standard as per the readme

Thanks
NIro

permission denied / file does not exist

Hi!
Sorry if this is considered a silly question since I'm a bit new to Terraform, but I've been cracking my head with this for a while so...
I followed your tutorial step by step, word by word and I tried in both Windows and Ubuntu.
In both cases when I try to run "terraform plan" I'm always getting this error message:
Ubuntu: provider.sumologic: fork/exec /github/terraform/terraform-provider-sumologic: permission denied
(+ I tried moving the .terraformrc file to terraform's folder and my project's folder)
Windows: provider.sumologic: exec: "C:\\HashiCorp\\Terraform\\terraform-provider-sumologic": file does not exist
In Ubuntu I've granted 777 permission to the folder & files and still same
My code is basically one terraform file as you see below:
`provider "aws" {
access_key = {my-access-key}
secret_key = {my secret key}
region = "us-west-2"
}

resource "aws_instance" "sumologic_terraform" {
ami = "ami-db6bf3bb"
instance_type = "t2.micro"
}

provider "sumologic" {
access_id = {my-access-id}
access_key = {my-access-key}
environment = "us-west-2"
}

resource "sumologic_collector" "collector" {
name = "redhat_collector"
description = "redhat generated by terraform with sumo"
category = "collector-container"
}`
Is there any other documentation that I should follow? I read this https://www.terraform.io/docs/plugins/basics.html but it didn't work as well...
If I got it wrong, really sorry about that, otherwise can you update your documentation with more details?
Thank you!

problem with the `linux-amd64` binary

While trying to use the linux-amd64 binary for the 0.3.0 release here

I get the following error when trying to execute the binary:

/tmp # ls -l
total 21056
-rwxr-xr-x    1 root     root      16859366 Apr  6 20:59 terraform-provider-sumologic
-rw-r--r--    1 root     root       4695025 Apr  6 20:59 terraform-provider-sumologic.zip
/tmp # ./terraform-provider-sumologic
sh: ./terraform-provider-sumologic: not found

This inside an alpine:3.7 docker container.

Add polling source

Description

In order to support:

Suggested syntax:

resource "sumologic_collector" "AWS" {
    name = "AWS"
}

resource "sumologic_polling_source" "s3_audit" {
    collector_id = "${sumologic_collector.AWS.id}"
    name = "Amazon S3 Audit"
    content_type = "AwsS3AuditBucket"
    category = "aws/s3audit"
    scan_interval = 1
    paused = false

    authentication {
        access_key = "AKIAIOSFODNN7EXAMPLE"
        secret_key = "******"
    }

    path {
        bucket_name = "Bucket1"
        path_expression = "*"
    }
}

Issue refreshing state when deleting sumologic module

Hey there, I was experimenting with this provider inside of a module and ran into an issue when trying to remove the module I had instantiated. The error was not very clear:

Error refreshing state: 1 error(s) occurred:

* module.sumologic.sumologic_collector.cloudformation: sumologic_collector.cloudformation:

The module itself is quite simple:

main.tf

provider "sumologic" {
  environment = "${var.sumologic_environment}"
}

resource "sumologic_collector" "cloudformation" {
  name        = "${var.environment}-cloudformation"
  description = "Cloudformation logs for ${var.environment}"
}

resource "sumologic_http_source" "cloudformation" {
  name         = "HTTP"
  category     = "aws/cloudformation"
  collector_id = "${sumologic_collector.cloudformation.id}"

  # SumoLogic lambda batches messages into a single request
  messagePerRequest = "false"
}

outputs.tf

output "cloudformation_http_url" {
  description = "URL for the sumologic cloudformation http endpoint."

  value = "${sumologic_http_source.cloudformation.url}"
}

variables.tf

variable "environment" {
  description = "The environment name"
}

variable "sumologic_environment" {
  description = "The sumologic API endpoint to use. Default is us2."

  default = "us2"
}

I was eventually able to clean it up by removing the two resources defined inside the module from the module, plan + apply, and then remove the module instantiation. Any idea if there's an issue with the provider or possibly how I was using it?

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.