├── vendor └── github.com │ ├── aws │ └── aws-sdk-go │ │ ├── NOTICE.txt │ │ ├── service │ │ ├── s3 │ │ │ ├── platform_handlers.go │ │ │ ├── platform_handlers_go1.6.go │ │ │ ├── statusok_error.go │ │ │ ├── content_md5.go │ │ │ ├── bucket_location.go │ │ │ ├── sse.go │ │ │ └── customizations.go │ │ └── sts │ │ │ └── customizations.go │ │ ├── aws │ │ ├── request │ │ │ ├── request_1_8.go │ │ │ ├── http_request.go │ │ │ ├── request_1_7.go │ │ │ └── offset_reader.go │ │ ├── version.go │ │ ├── credentials │ │ │ └── example.ini │ │ ├── client │ │ │ └── metadata │ │ │ │ └── client_info.go │ │ ├── signer │ │ │ └── v4 │ │ │ │ └── uri_path.go │ │ ├── errors.go │ │ ├── corehandlers │ │ │ └── param_validator.go │ │ └── awsutil │ │ │ └── equal.go │ │ └── private │ │ └── protocol │ │ ├── unmarshal.go │ │ ├── rest │ │ └── payload.go │ │ └── query │ │ ├── build.go │ │ └── unmarshal.go │ ├── hashicorp │ ├── terraform │ │ ├── config │ │ │ ├── module │ │ │ │ ├── module.go │ │ │ │ ├── inode_windows.go │ │ │ │ ├── inode_freebsd.go │ │ │ │ ├── inode.go │ │ │ │ ├── testing.go │ │ │ │ └── tree_gob.go │ │ │ ├── resource_mode.go │ │ │ ├── testing.go │ │ │ ├── lang.go │ │ │ ├── resource_mode_string.go │ │ │ ├── provisioner_enums.go │ │ │ └── config_tree.go │ │ ├── helper │ │ │ ├── schema │ │ │ │ ├── equal.go │ │ │ │ ├── field_writer.go │ │ │ │ ├── valuetype.go │ │ │ │ ├── README.md │ │ │ │ ├── valuetype_string.go │ │ │ │ ├── resource_data_get_source.go │ │ │ │ ├── testing.go │ │ │ │ └── getsource_string.go │ │ │ ├── hashcode │ │ │ │ └── hashcode.go │ │ │ ├── config │ │ │ │ └── decode.go │ │ │ ├── experiment │ │ │ │ └── id.go │ │ │ ├── resource │ │ │ │ ├── id.go │ │ │ │ └── resource.go │ │ │ ├── encryption │ │ │ │ └── encryption.go │ │ │ ├── hilmapstructure │ │ │ │ └── hilmapstructure.go │ │ │ └── shadow │ │ │ │ └── ordered_value.go │ │ ├── terraform │ │ │ ├── ui_output.go │ │ │ ├── eval_noop.go │ │ │ ├── ui_output_callback.go │ │ │ ├── graph_interface_subgraph.go │ │ │ ├── graph_dot.go │ │ │ ├── instancetype.go │ │ │ ├── node_provider.go │ │ │ ├── eval_resource.go │ │ │ ├── ui_output_mock.go │ │ │ ├── graph_walk_operation.go │ │ │ ├── testing.go │ │ │ ├── ui_output_provisioner.go │ │ │ ├── node_count_boundary.go │ │ │ ├── node_root_variable.go │ │ │ ├── edge_destroy.go │ │ │ ├── eval_if.go │ │ │ ├── instancetype_string.go │ │ │ ├── ui_input_prefix.go │ │ │ ├── graphtype_string.go │ │ │ ├── eval_error.go │ │ │ ├── eval_interpolate.go │ │ │ ├── eval_sequence.go │ │ │ ├── walkoperation_string.go │ │ │ ├── node_data_destroy.go │ │ │ ├── path.go │ │ │ ├── transform_config_old.go │ │ │ ├── transform_transitive_reduction.go │ │ │ ├── eval_count_computed.go │ │ │ ├── ui_input_mock.go │ │ │ ├── node_module_destroy.go │ │ │ ├── transform_count_boundary.go │ │ │ ├── node_output_orphan.go │ │ │ ├── transform_root.go │ │ │ ├── ui_input.go │ │ │ ├── graph_builder_input.go │ │ │ ├── eval_filter.go │ │ │ ├── transform_variable.go │ │ │ ├── node_provider_disabled.go │ │ │ ├── context_graph_type.go │ │ │ ├── version.go │ │ │ ├── transform_import_provider.go │ │ │ ├── graph_builder_validate.go │ │ │ ├── node_provisioner.go │ │ │ ├── eval_check_prevent_destroy.go │ │ │ ├── transform_vertex.go │ │ │ ├── eval_refresh.go │ │ │ ├── transform_resource_count.go │ │ │ ├── eval_provisioner.go │ │ │ ├── shadow.go │ │ │ ├── eval_filter_operation.go │ │ │ ├── transform_provider_disable.go │ │ │ ├── node_resource_plan_destroy.go │ │ │ ├── node_resource_plan_orphan.go │ │ │ ├── transform_expand.go │ │ │ ├── eval_count.go │ │ │ ├── transform_output.go │ │ │ └── transform.go │ │ ├── plugin │ │ │ ├── plugin.go │ │ │ ├── ui_output.go │ │ │ └── ui_input.go │ │ └── dag │ │ │ └── edge.go │ ├── go-getter │ │ ├── helper │ │ │ └── url │ │ │ │ ├── url_unix.go │ │ │ │ ├── url.go │ │ │ │ └── url_windows.go │ │ ├── appveyor.yml │ │ ├── storage.go │ │ ├── get_file.go │ │ ├── client_mode.go │ │ ├── source.go │ │ ├── decompress_bzip2.go │ │ ├── decompress.go │ │ ├── decompress_gzip.go │ │ ├── get_mock.go │ │ └── netrc.go │ ├── hcl │ │ ├── Makefile │ │ ├── hcl │ │ │ ├── parser │ │ │ │ └── error.go │ │ │ ├── token │ │ │ │ └── position.go │ │ │ └── ast │ │ │ │ └── walk.go │ │ ├── appveyor.yml │ │ ├── hcl.go │ │ ├── lex.go │ │ ├── parse.go │ │ └── json │ │ │ └── token │ │ │ └── position.go │ ├── hil │ │ ├── eval_type.go │ │ ├── appveyor.yml │ │ ├── ast │ │ │ ├── stack.go │ │ │ ├── arithmetic_op.go │ │ │ ├── unknown.go │ │ │ ├── variable_access.go │ │ │ ├── arithmetic.go │ │ │ ├── conditional.go │ │ │ ├── call.go │ │ │ ├── type_string.go │ │ │ └── variables_helper.go │ │ ├── parser │ │ │ ├── fuzz.go │ │ │ ├── error.go │ │ │ └── binary_op.go │ │ ├── transform_fixed.go │ │ ├── evaltype_string.go │ │ ├── parse.go │ │ └── scanner │ │ │ └── peeker.go │ ├── go-uuid │ │ ├── README.md │ │ └── uuid.go │ ├── go-plugin │ │ ├── stream.go │ │ ├── process_posix.go │ │ ├── process.go │ │ ├── error.go │ │ ├── process_windows.go │ │ ├── discover.go │ │ ├── server_mux.go │ │ └── plugin.go │ ├── go-version │ │ └── version_collection.go │ ├── yamux │ │ ├── util.go │ │ └── addr.go │ ├── go-multierror │ │ ├── flatten.go │ │ ├── format.go │ │ ├── Makefile │ │ ├── prefix.go │ │ ├── append.go │ │ └── multierror.go │ ├── logutils │ │ └── README.md │ └── go-cleanhttp │ │ ├── doc.go │ │ └── README.md │ ├── go-ini │ └── ini │ │ ├── Makefile │ │ └── error.go │ ├── jmespath │ └── go-jmespath │ │ ├── README.md │ │ ├── LICENSE │ │ ├── toktype_string.go │ │ ├── astnodetype_string.go │ │ ├── Makefile │ │ └── api.go │ ├── keybase │ └── go-crypto │ │ ├── openpgp │ │ ├── patch.sh │ │ └── canonical_text.go │ │ ├── curve25519 │ │ ├── const_amd64.s │ │ └── doc.go │ │ ├── PATENTS │ │ └── LICENSE │ ├── mitchellh │ ├── reflectwalk │ │ ├── README.md │ │ ├── location.go │ │ ├── location_string.go │ │ └── LICENSE │ ├── copystructure │ │ ├── copier_time.go │ │ ├── README.md │ │ └── LICENSE │ ├── hashstructure │ │ ├── include.go │ │ └── LICENSE │ ├── go-homedir │ │ ├── README.md │ │ └── LICENSE │ └── mapstructure │ │ ├── LICENSE │ │ ├── error.go │ │ └── README.md │ ├── davecgh │ └── go-spew │ │ └── LICENSE │ ├── apparentlymart │ └── go-cidr │ │ ├── cidr │ │ └── wrangling.go │ │ └── LICENSE │ ├── satori │ └── go.uuid │ │ └── LICENSE │ ├── bgentry │ └── go-netrc │ │ └── LICENSE │ └── agl │ └── ed25519 │ └── LICENSE ├── main.go ├── .gitignore ├── docs ├── README.md └── r │ ├── sumologic_collector.md │ ├── sumologic_cloudsyslog_source.md │ └── sumologic_http_source.md ├── .travis.yml ├── provider ├── provider_test.go ├── resource_sumologic_cloudsyslog_source_test.go ├── resource_sumologic_http_source_test.go ├── resource_sumologic_collector_test.go ├── resource_sumologic_polling_source_test.go └── provider.go └── LICENSE /vendor/github.com/aws/aws-sdk-go/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS SDK for Go 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Copyright 2014-2015 Stripe, Inc. 4 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/module.go: -------------------------------------------------------------------------------- 1 | package module 2 | 3 | // Module represents the metadata for a single module. 4 | type Module struct { 5 | Name string 6 | Source string 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package s3 4 | 5 | import "github.com/aws/aws-sdk-go/aws/request" 6 | 7 | func platformRequestHandlers(r *request.Request) { 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/equal.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | // Equal is an interface that checks for deep equality between two objects. 4 | type Equal interface { 5 | Equal(interface{}) bool 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_output.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // UIOutput is the interface that must be implemented to output 4 | // data to the end user. 5 | type UIOutput interface { 6 | Output(string) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/helper/url/url_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package url 4 | 5 | import ( 6 | "net/url" 7 | ) 8 | 9 | func parse(rawURL string) (*url.URL, error) { 10 | return url.Parse(rawURL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/inode_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package module 4 | 5 | // no syscall.Stat_t on windows, return 0 for inodes 6 | func inode(path string) (uint64, error) { 7 | return 0, nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_noop.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalNoop is an EvalNode that does nothing. 4 | type EvalNoop struct{} 5 | 6 | func (EvalNoop) Eval(EvalContext) (interface{}, error) { 7 | return nil, nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_output_callback.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | type CallbackUIOutput struct { 4 | OutputFn func(string) 5 | } 6 | 7 | func (o *CallbackUIOutput) Output(v string) { 8 | o.OutputFn(v) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/README.md: -------------------------------------------------------------------------------- 1 | # go-jmespath - A JMESPath implementation in Go 2 | 3 | [![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath) 4 | 5 | 6 | 7 | See http://jmespath.org for more info. 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package request 4 | 5 | import "net/http" 6 | 7 | // Is a http.NoBody reader instructing Go HTTP client to not include 8 | // and body in the HTTP request. 9 | var noBodyReader = http.NoBody 10 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/erikvanbrakel/terraform-provider-sumologic/provider" 5 | "github.com/hashicorp/terraform/plugin" 6 | ) 7 | 8 | func main() { 9 | plugin.Serve(&plugin.ServeOpts { 10 | ProviderFunc: provider.Provider, 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/resource_mode.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | //go:generate stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go 4 | type ResourceMode int 5 | 6 | const ( 7 | ManagedResourceMode ResourceMode = iota 8 | DataResourceMode 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graph_interface_subgraph.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // GraphNodeSubPath says that a node is part of a graph with a 4 | // different path, and the context should be adjusted accordingly. 5 | type GraphNodeSubPath interface { 6 | Path() []string 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/version.go: -------------------------------------------------------------------------------- 1 | // Package aws provides core functionality for making requests to AWS services. 2 | package aws 3 | 4 | // SDKName is the name of this AWS SDK 5 | const SDKName = "aws-sdk-go" 6 | 7 | // SDKVersion is the version of this SDK 8 | const SDKVersion = "1.6.19" 9 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/openpgp/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | patch < sig-v3.patch 4 | patch < s2k-gnu-dummy.patch 5 | find . -type f -name '*.go' -exec sed -i'' -e 's/golang.org\/x\/crypto\/openpgp/github.com\/keybase\/go-crypto\/openpgp/' {} \; 6 | find . -type f -name '*.go-e' -exec rm {} \; 7 | go test ./... 8 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/reflectwalk/README.md: -------------------------------------------------------------------------------- 1 | # reflectwalk 2 | 3 | reflectwalk is a Go library for "walking" a value in Go using reflection, 4 | in the same way a directory tree can be "walked" on the filesystem. Walking 5 | a complex structure can allow you to do manipulations on unknown structures 6 | such as those decoded from JSON. 7 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/field_writer.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | // FieldWriters are responsible for writing fields by address into 4 | // a proper typed representation. ResourceData uses this to write new data 5 | // into existing sources. 6 | type FieldWriter interface { 7 | WriteField([]string, interface{}) error 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/copystructure/copier_time.go: -------------------------------------------------------------------------------- 1 | package copystructure 2 | 3 | import ( 4 | "reflect" 5 | "time" 6 | ) 7 | 8 | func init() { 9 | Copiers[reflect.TypeOf(time.Time{})] = timeCopier 10 | } 11 | 12 | func timeCopier(v interface{}) (interface{}, error) { 13 | // Just... copy it. 14 | return v.(time.Time), nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/reflectwalk/location.go: -------------------------------------------------------------------------------- 1 | package reflectwalk 2 | 3 | //go:generate stringer -type=Location location.go 4 | 5 | type Location uint 6 | 7 | const ( 8 | None Location = iota 9 | Map 10 | MapKey 11 | MapValue 12 | Slice 13 | SliceElem 14 | Array 15 | ArrayElem 16 | Struct 17 | StructField 18 | WalkLoc 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini: -------------------------------------------------------------------------------- 1 | [default] 2 | aws_access_key_id = accessKey 3 | aws_secret_access_key = secret 4 | aws_session_token = token 5 | 6 | [no_token] 7 | aws_access_key_id = accessKey 8 | aws_secret_access_key = secret 9 | 10 | [with_colon] 11 | aws_access_key_id: accessKey 12 | aws_secret_access_key: secret 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graph_dot.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import "github.com/hashicorp/terraform/dag" 4 | 5 | // GraphDot returns the dot formatting of a visual representation of 6 | // the given Terraform graph. 7 | func GraphDot(g *Graph, opts *dag.DotOpts) (string, error) { 8 | return string(g.Dot(opts)), nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/testing.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | // TestRawConfig is used to create a RawConfig for testing. 8 | func TestRawConfig(t *testing.T, c map[string]interface{}) *RawConfig { 9 | cfg, err := NewRawConfig(c) 10 | if err != nil { 11 | t.Fatalf("err: %s", err) 12 | } 13 | 14 | return cfg 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/instancetype.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | //go:generate stringer -type=InstanceType instancetype.go 4 | 5 | // InstanceType is an enum of the various types of instances store in the State 6 | type InstanceType int 7 | 8 | const ( 9 | TypeInvalid InstanceType = iota 10 | TypePrimary 11 | TypeTainted 12 | TypeDeposed 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | // ClientInfo wraps immutable data from the client.Client structure. 4 | type ClientInfo struct { 5 | ServiceName string 6 | APIVersion string 7 | Endpoint string 8 | SigningName string 9 | SigningRegion string 10 | JSONVersion string 11 | TargetPrefix string 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go: -------------------------------------------------------------------------------- 1 | package sts 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | func init() { 6 | initRequest = func(r *request.Request) { 7 | switch r.Operation.Name { 8 | case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: 9 | r.Handlers.Sign.Clear() // these operations are unsigned 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/Makefile: -------------------------------------------------------------------------------- 1 | TEST?=./... 2 | 3 | default: test 4 | 5 | fmt: generate 6 | go fmt ./... 7 | 8 | test: generate 9 | go get -t ./... 10 | go test $(TEST) $(TESTARGS) 11 | 12 | generate: 13 | go generate ./... 14 | 15 | updatedeps: 16 | go get -u golang.org/x/tools/cmd/stringer 17 | 18 | .PHONY: default generate test updatedeps 19 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/parser/error.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/token" 7 | ) 8 | 9 | // PosError is a parse error that contains a position. 10 | type PosError struct { 11 | Pos token.Pos 12 | Err error 13 | } 14 | 15 | func (e *PosError) Error() string { 16 | return fmt.Sprintf("At %s: %s", e.Pos, e.Err) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_provider.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // NodeApplyableProvider represents a provider during an apply. 4 | type NodeApplyableProvider struct { 5 | *NodeAbstractProvider 6 | } 7 | 8 | // GraphNodeEvalable 9 | func (n *NodeApplyableProvider) EvalTree() EvalNode { 10 | return ProviderEvalTree(n.NameValue, n.ProviderConfig()) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "build-{branch}-{build}" 2 | image: Visual Studio 2015 3 | clone_folder: c:\gopath\github.com\hashicorp\go-getter 4 | environment: 5 | GOPATH: c:\gopath 6 | install: 7 | - cmd: >- 8 | echo %Path% 9 | 10 | go version 11 | 12 | go env 13 | 14 | go get -d -v -t ./... 15 | build_script: 16 | - cmd: go test -v ./... 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/eval_type.go: -------------------------------------------------------------------------------- 1 | package hil 2 | 3 | //go:generate stringer -type=EvalType eval_type.go 4 | 5 | // EvalType represents the type of the output returned from a HIL 6 | // evaluation. 7 | type EvalType uint32 8 | 9 | const ( 10 | TypeInvalid EvalType = 0 11 | TypeString EvalType = 1 << iota 12 | TypeBool 13 | TypeList 14 | TypeMap 15 | TypeUnknown 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/lang.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/hashicorp/hil/ast" 5 | ) 6 | 7 | type noopNode struct{} 8 | 9 | func (n *noopNode) Accept(ast.Visitor) ast.Node { return n } 10 | func (n *noopNode) Pos() ast.Pos { return ast.Pos{} } 11 | func (n *noopNode) Type(ast.Scope) (ast.Type, error) { return ast.TypeString, nil } 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/plugin/plugin.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "github.com/hashicorp/go-plugin" 5 | ) 6 | 7 | // See serve.go for serving plugins 8 | 9 | // PluginMap should be used by clients for the map of plugins. 10 | var PluginMap = map[string]plugin.Plugin{ 11 | "provider": &ResourceProviderPlugin{}, 12 | "provisioner": &ResourceProvisionerPlugin{}, 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | .idea 27 | 28 | dist 29 | pkg 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_resource.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalInstanceInfo is an EvalNode implementation that fills in the 4 | // InstanceInfo as much as it can. 5 | type EvalInstanceInfo struct { 6 | Info *InstanceInfo 7 | } 8 | 9 | // TODO: test 10 | func (n *EvalInstanceInfo) Eval(ctx EvalContext) (interface{}, error) { 11 | n.Info.ModulePath = ctx.Path() 12 | return nil, nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/helper/url/url.go: -------------------------------------------------------------------------------- 1 | package url 2 | 3 | import ( 4 | "net/url" 5 | ) 6 | 7 | // Parse parses rawURL into a URL structure. 8 | // The rawURL may be relative or absolute. 9 | // 10 | // Parse is a wrapper for the Go stdlib net/url Parse function, but returns 11 | // Windows "safe" URLs on Windows platforms. 12 | func Parse(rawURL string) (*url.URL, error) { 13 | return parse(rawURL) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "build-{branch}-{build}" 2 | image: Visual Studio 2015 3 | clone_folder: c:\gopath\src\github.com\hashicorp\hcl 4 | environment: 5 | GOPATH: c:\gopath 6 | init: 7 | - git config --global core.autocrlf true 8 | install: 9 | - cmd: >- 10 | echo %Path% 11 | 12 | go version 13 | 14 | go env 15 | 16 | go get -t ./... 17 | 18 | build_script: 19 | - cmd: go test -v ./... 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "build-{branch}-{build}" 2 | image: Visual Studio 2015 3 | clone_folder: c:\gopath\src\github.com\hashicorp\hil 4 | environment: 5 | GOPATH: c:\gopath 6 | init: 7 | - git config --global core.autocrlf true 8 | install: 9 | - cmd: >- 10 | echo %Path% 11 | 12 | go version 13 | 14 | go env 15 | 16 | go get -d -v -t ./... 17 | build_script: 18 | - cmd: go test -v ./... 19 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid [![Build Status](https://travis-ci.org/hashicorp/go-uuid.svg?branch=master)](https://travis-ci.org/hashicorp/go-uuid) 2 | 3 | Generates UUID-format strings using high quality, purely random bytes. It can also parse UUID-format strings into their component bytes. 4 | 5 | Documentation 6 | ============= 7 | 8 | The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/go-uuid). 9 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_output_mock.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // MockUIOutput is an implementation of UIOutput that can be used for tests. 4 | type MockUIOutput struct { 5 | OutputCalled bool 6 | OutputMessage string 7 | OutputFn func(string) 8 | } 9 | 10 | func (o *MockUIOutput) Output(v string) { 11 | o.OutputCalled = true 12 | o.OutputMessage = v 13 | if o.OutputFn != nil { 14 | o.OutputFn(v) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package v4 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func getURIPath(u *url.URL) string { 11 | var uri string 12 | 13 | if len(u.Opaque) > 0 { 14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") 15 | } else { 16 | uri = u.EscapedPath() 17 | } 18 | 19 | if len(uri) == 0 { 20 | uri = "/" 21 | } 22 | 23 | return uri 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/stream.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "io" 5 | "log" 6 | ) 7 | 8 | func copyStream(name string, dst io.Writer, src io.Reader) { 9 | if src == nil { 10 | panic(name + ": src is nil") 11 | } 12 | if dst == nil { 13 | panic(name + ": dst is nil") 14 | } 15 | if _, err := io.Copy(dst, src); err != nil && err != io.EOF { 16 | log.Printf("[ERR] plugin: stream copy '%s' error: %s", name, err) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-version/version_collection.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // Collection is a type that implements the sort.Interface interface 4 | // so that versions can be sorted. 5 | type Collection []*Version 6 | 7 | func (v Collection) Len() int { 8 | return len(v) 9 | } 10 | 11 | func (v Collection) Less(i, j int) bool { 12 | return v[i].LessThan(v[j]) 13 | } 14 | 15 | func (v Collection) Swap(i, j int) { 16 | v[i], v[j] = v[j], v[i] 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/process_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package plugin 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | // _pidAlive tests whether a process is alive or not by sending it Signal 0, 11 | // since Go otherwise has no way to test this. 12 | func _pidAlive(pid int) bool { 13 | proc, err := os.FindProcess(pid) 14 | if err == nil { 15 | err = proc.Signal(syscall.Signal(0)) 16 | } 17 | 18 | return err == nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graph_walk_operation.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | //go:generate stringer -type=walkOperation graph_walk_operation.go 4 | 5 | // walkOperation is an enum which tells the walkContext what to do. 6 | type walkOperation byte 7 | 8 | const ( 9 | walkInvalid walkOperation = iota 10 | walkInput 11 | walkApply 12 | walkPlan 13 | walkPlanDestroy 14 | walkRefresh 15 | walkValidate 16 | walkDestroy 17 | walkImport 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/testing.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | ) 7 | 8 | // TestStateFile writes the given state to the path. 9 | func TestStateFile(t *testing.T, path string, state *State) { 10 | f, err := os.Create(path) 11 | if err != nil { 12 | t.Fatalf("err: %s", err) 13 | } 14 | defer f.Close() 15 | 16 | if err := WriteState(state, f); err != nil { 17 | t.Fatalf("err: %s", err) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_output_provisioner.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // ProvisionerUIOutput is an implementation of UIOutput that calls a hook 4 | // for the output so that the hooks can handle it. 5 | type ProvisionerUIOutput struct { 6 | Info *InstanceInfo 7 | Type string 8 | Hooks []Hook 9 | } 10 | 11 | func (o *ProvisionerUIOutput) Output(msg string) { 12 | for _, h := range o.Hooks { 13 | h.ProvisionOutput(o.Info, o.Type, msg) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Table of Contents 2 | 3 | - [Sumologic Provider][0] 4 | 5 | - Data Sources 6 | + _None so far_ 7 | 8 | - Resources 9 | + [sumologic_collector][20] 10 | + [sumologic_http_source][21] 11 | + [sumologic_polling_source][22] 12 | + [sumologic_cloudsyslog_source][23] 13 | 14 | 15 | [0]: sumologic-provider.md 16 | [20]: r/sumologic_collector.md 17 | [21]: r/sumologic_http_source.md 18 | [22]: r/sumologic_polling_source.md 19 | [23]: r/sumologic_cloudsyslog_source.md 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/process.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // pidAlive checks whether a pid is alive. 8 | func pidAlive(pid int) bool { 9 | return _pidAlive(pid) 10 | } 11 | 12 | // pidWait blocks for a process to exit. 13 | func pidWait(pid int) error { 14 | ticker := time.NewTicker(1 * time.Second) 15 | defer ticker.Stop() 16 | 17 | for range ticker.C { 18 | if !pidAlive(pid) { 19 | break 20 | } 21 | } 22 | 23 | return nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/inode_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd 2 | 3 | package module 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // lookup the inode of a file on posix systems 12 | func inode(path string) (uint64, error) { 13 | stat, err := os.Stat(path) 14 | if err != nil { 15 | return 0, err 16 | } 17 | if st, ok := stat.Sys().(*syscall.Stat_t); ok { 18 | return uint64(st.Ino), nil 19 | } 20 | return 0, fmt.Errorf("could not determine file inode") 21 | } 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8 5 | 6 | go_import_path: github.com/erikvanbrakel/terraform-provider-sumologic 7 | 8 | install: 9 | - go get -u github.com/mitchellh/gox 10 | - chmod +x ./build/cross-compile.sh 11 | 12 | script: 13 | # Testing scripts etc 14 | 15 | after_success: ./build/cross-compile.sh 16 | 17 | deploy: 18 | provider: releases 19 | file_glob: true 20 | api_key: "$GITHUB_TOKEN" 21 | file: "pkg/*" 22 | skip_cleanup: true 23 | on: 24 | tags: true 25 | go: 1.8 26 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | ) 8 | 9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { 10 | req := new(http.Request) 11 | *req = *r 12 | req.URL = &url.URL{} 13 | *req.URL = *r.URL 14 | req.Body = body 15 | 16 | req.Header = http.Header{} 17 | for k, v := range r.Header { 18 | for _, vv := range v { 19 | req.Header.Add(k, vv) 20 | } 21 | } 22 | 23 | return req 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/inode.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin openbsd solaris 2 | 3 | package module 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // lookup the inode of a file on posix systems 12 | func inode(path string) (uint64, error) { 13 | stat, err := os.Stat(path) 14 | if err != nil { 15 | return 0, err 16 | } 17 | if st, ok := stat.Sys().(*syscall.Stat_t); ok { 18 | return st.Ino, nil 19 | } 20 | return 0, fmt.Errorf("could not determine file inode") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_count_boundary.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // NodeCountBoundary fixes any "count boundarie" in the state: resources 4 | // that are named "foo.0" when they should be named "foo" 5 | type NodeCountBoundary struct{} 6 | 7 | func (n *NodeCountBoundary) Name() string { 8 | return "meta.count-boundary (count boundary fixup)" 9 | } 10 | 11 | // GraphNodeEvalable 12 | func (n *NodeCountBoundary) EvalTree() EvalNode { 13 | return &EvalCountFixZeroOneBoundaryGlobal{} 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/stack.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | // Stack is a stack of Node. 4 | type Stack struct { 5 | stack []Node 6 | } 7 | 8 | func (s *Stack) Len() int { 9 | return len(s.stack) 10 | } 11 | 12 | func (s *Stack) Push(n Node) { 13 | s.stack = append(s.stack, n) 14 | } 15 | 16 | func (s *Stack) Pop() Node { 17 | x := s.stack[len(s.stack)-1] 18 | s.stack[len(s.stack)-1] = nil 19 | s.stack = s.stack[:len(s.stack)-1] 20 | return x 21 | } 22 | 23 | func (s *Stack) Reset() { 24 | s.stack = nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/storage.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | // Storage is an interface that knows how to lookup downloaded directories 4 | // as well as download and update directories from their sources into the 5 | // proper location. 6 | type Storage interface { 7 | // Dir returns the directory on local disk where the directory source 8 | // can be loaded from. 9 | Dir(string) (string, bool, error) 10 | 11 | // Get will download and optionally update the given directory. 12 | Get(string, string, bool) error 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl.go: -------------------------------------------------------------------------------- 1 | // Package hcl decodes HCL into usable Go structures. 2 | // 3 | // hcl input can come in either pure HCL format or JSON format. 4 | // It can be parsed into an AST, and then decoded into a structure, 5 | // or it can be decoded directly from a string into a structure. 6 | // 7 | // If you choose to parse HCL into a raw AST, the benefit is that you 8 | // can write custom visitor implementations to implement custom 9 | // semantic checks. By default, HCL does not perform any semantic 10 | // checks. 11 | package hcl 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/hashcode/hashcode.go: -------------------------------------------------------------------------------- 1 | package hashcode 2 | 3 | import ( 4 | "hash/crc32" 5 | ) 6 | 7 | // String hashes a string to a unique hashcode. 8 | // 9 | // crc32 returns a uint32, but for our use we need 10 | // and non negative integer. Here we cast to an integer 11 | // and invert it if the result is negative. 12 | func String(s string) int { 13 | v := int(crc32.ChecksumIEEE([]byte(s))) 14 | if v >= 0 { 15 | return v 16 | } 17 | if -v >= 0 { 18 | return -v 19 | } 20 | // v == MinInt 21 | return 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/valuetype.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | //go:generate stringer -type=ValueType valuetype.go 4 | 5 | // ValueType is an enum of the type that can be represented by a schema. 6 | type ValueType int 7 | 8 | const ( 9 | TypeInvalid ValueType = iota 10 | TypeBool 11 | TypeInt 12 | TypeFloat 13 | TypeString 14 | TypeList 15 | TypeMap 16 | TypeSet 17 | typeObject 18 | ) 19 | 20 | // NOTE: ValueType has more functions defined on it in schema.go. We can't 21 | // put them here because we reference other files. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/reflectwalk/location_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Location location.go; DO NOT EDIT 2 | 3 | package reflectwalk 4 | 5 | import "fmt" 6 | 7 | const _Location_name = "NoneMapMapKeyMapValueSliceSliceElemStructStructFieldWalkLoc" 8 | 9 | var _Location_index = [...]uint8{0, 4, 7, 13, 21, 26, 35, 41, 52, 59} 10 | 11 | func (i Location) String() string { 12 | if i+1 >= Location(len(_Location_index)) { 13 | return fmt.Sprintf("Location(%d)", i) 14 | } 15 | return _Location_name[_Location_index[i]:_Location_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_root_variable.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | ) 8 | 9 | // NodeRootVariable represents a root variable input. 10 | type NodeRootVariable struct { 11 | Config *config.Variable 12 | } 13 | 14 | func (n *NodeRootVariable) Name() string { 15 | result := fmt.Sprintf("var.%s", n.Config.Name) 16 | return result 17 | } 18 | 19 | // GraphNodeReferenceable 20 | func (n *NodeRootVariable) ReferenceableName() []string { 21 | return []string{n.Name()} 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/README.md: -------------------------------------------------------------------------------- 1 | # Terraform Helper Lib: schema 2 | 3 | The `schema` package provides a high-level interface for writing resource 4 | providers for Terraform. 5 | 6 | If you're writing a resource provider, we recommend you use this package. 7 | 8 | The interface exposed by this package is much friendlier than trying to 9 | write to the Terraform API directly. The core Terraform API is low-level 10 | and built for maximum flexibility and control, whereas this library is built 11 | as a framework around that to more easily write common providers. 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/arithmetic_op.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | // ArithmeticOp is the operation to use for the math. 4 | type ArithmeticOp int 5 | 6 | const ( 7 | ArithmeticOpInvalid ArithmeticOp = 0 8 | 9 | ArithmeticOpAdd ArithmeticOp = iota 10 | ArithmeticOpSub 11 | ArithmeticOpMul 12 | ArithmeticOpDiv 13 | ArithmeticOpMod 14 | 15 | ArithmeticOpLogicalAnd 16 | ArithmeticOpLogicalOr 17 | 18 | ArithmeticOpEqual 19 | ArithmeticOpNotEqual 20 | ArithmeticOpLessThan 21 | ArithmeticOpLessThanOrEqual 22 | ArithmeticOpGreaterThan 23 | ArithmeticOpGreaterThanOrEqual 24 | ) 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/edge_destroy.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/dag" 7 | ) 8 | 9 | // DestroyEdge is an edge that represents a standard "destroy" relationship: 10 | // Target depends on Source because Source is destroying. 11 | type DestroyEdge struct { 12 | S, T dag.Vertex 13 | } 14 | 15 | func (e *DestroyEdge) Hashcode() interface{} { return fmt.Sprintf("%p-%p", e.S, e.T) } 16 | func (e *DestroyEdge) Source() dag.Vertex { return e.S } 17 | func (e *DestroyEdge) Target() dag.Vertex { return e.T } 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_if.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalIf is an EvalNode that is a conditional. 4 | type EvalIf struct { 5 | If func(EvalContext) (bool, error) 6 | Then EvalNode 7 | Else EvalNode 8 | } 9 | 10 | // TODO: test 11 | func (n *EvalIf) Eval(ctx EvalContext) (interface{}, error) { 12 | yes, err := n.If(ctx) 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | if yes { 18 | return EvalRaw(n.Then, ctx) 19 | } else { 20 | if n.Else != nil { 21 | return EvalRaw(n.Else, ctx) 22 | } 23 | } 24 | 25 | return nil, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/yamux/util.go: -------------------------------------------------------------------------------- 1 | package yamux 2 | 3 | // asyncSendErr is used to try an async send of an error 4 | func asyncSendErr(ch chan error, err error) { 5 | if ch == nil { 6 | return 7 | } 8 | select { 9 | case ch <- err: 10 | default: 11 | } 12 | } 13 | 14 | // asyncNotify is used to signal a waiting goroutine 15 | func asyncNotify(ch chan struct{}) { 16 | select { 17 | case ch <- struct{}{}: 18 | default: 19 | } 20 | } 21 | 22 | // min computes the minimum of two values 23 | func min(a, b uint32) uint32 { 24 | if a < b { 25 | return a 26 | } 27 | return b 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/instancetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=InstanceType instancetype.go"; DO NOT EDIT. 2 | 3 | package terraform 4 | 5 | import "fmt" 6 | 7 | const _InstanceType_name = "TypeInvalidTypePrimaryTypeTaintedTypeDeposed" 8 | 9 | var _InstanceType_index = [...]uint8{0, 11, 22, 33, 44} 10 | 11 | func (i InstanceType) String() string { 12 | if i < 0 || i >= InstanceType(len(_InstanceType_index)-1) { 13 | return fmt.Sprintf("InstanceType(%d)", i) 14 | } 15 | return _InstanceType_name[_InstanceType_index[i]:_InstanceType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_input_prefix.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // PrefixUIInput is an implementation of UIInput that prefixes the ID 8 | // with a string, allowing queries to be namespaced. 9 | type PrefixUIInput struct { 10 | IdPrefix string 11 | QueryPrefix string 12 | UIInput UIInput 13 | } 14 | 15 | func (i *PrefixUIInput) Input(opts *InputOpts) (string, error) { 16 | opts.Id = fmt.Sprintf("%s.%s", i.IdPrefix, opts.Id) 17 | opts.Query = fmt.Sprintf("%s%s", i.QueryPrefix, opts.Query) 18 | return i.UIInput.Input(opts) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/resource_mode_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go"; DO NOT EDIT. 2 | 3 | package config 4 | 5 | import "fmt" 6 | 7 | const _ResourceMode_name = "ManagedResourceModeDataResourceMode" 8 | 9 | var _ResourceMode_index = [...]uint8{0, 19, 35} 10 | 11 | func (i ResourceMode) String() string { 12 | if i < 0 || i >= ResourceMode(len(_ResourceMode_index)-1) { 13 | return fmt.Sprintf("ResourceMode(%d)", i) 14 | } 15 | return _ResourceMode_name[_ResourceMode_index[i]:_ResourceMode_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/errors.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import "github.com/aws/aws-sdk-go/aws/awserr" 4 | 5 | var ( 6 | // ErrMissingRegion is an error that is returned if region configuration is 7 | // not found. 8 | // 9 | // @readonly 10 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) 11 | 12 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be 13 | // resolved for a service. 14 | // 15 | // @readonly 16 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/valuetype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=ValueType valuetype.go"; DO NOT EDIT. 2 | 3 | package schema 4 | 5 | import "fmt" 6 | 7 | const _ValueType_name = "TypeInvalidTypeBoolTypeIntTypeFloatTypeStringTypeListTypeMapTypeSettypeObject" 8 | 9 | var _ValueType_index = [...]uint8{0, 11, 19, 26, 35, 45, 53, 60, 67, 77} 10 | 11 | func (i ValueType) String() string { 12 | if i < 0 || i >= ValueType(len(_ValueType_index)-1) { 13 | return fmt.Sprintf("ValueType(%d)", i) 14 | } 15 | return _ValueType_name[_ValueType_index[i]:_ValueType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | // ValidateParametersHandler is a request handler to validate the input parameters. 6 | // Validating parameters only has meaning if done prior to the request being sent. 7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { 8 | if !r.ParamsFilled() { 9 | return 10 | } 11 | 12 | if v, ok := r.Params.(request.Validator); ok { 13 | if err := v.Validate(); err != nil { 14 | r.Error = err 15 | } 16 | } 17 | }} 18 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 James Saryerwinnie 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graphtype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=GraphType context_graph_type.go"; DO NOT EDIT. 2 | 3 | package terraform 4 | 5 | import "fmt" 6 | 7 | const _GraphType_name = "GraphTypeInvalidGraphTypeLegacyGraphTypeRefreshGraphTypePlanGraphTypePlanDestroyGraphTypeApplyGraphTypeInputGraphTypeValidate" 8 | 9 | var _GraphType_index = [...]uint8{0, 16, 31, 47, 60, 80, 94, 108, 125} 10 | 11 | func (i GraphType) String() string { 12 | if i >= GraphType(len(_GraphType_index)-1) { 13 | return fmt.Sprintf("GraphType(%d)", i) 14 | } 15 | return _GraphType_name[_GraphType_index[i]:_GraphType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/copystructure/README.md: -------------------------------------------------------------------------------- 1 | # copystructure 2 | 3 | copystructure is a Go library for deep copying values in Go. 4 | 5 | This allows you to copy Go values that may contain reference values 6 | such as maps, slices, or pointers, and copy their data as well instead 7 | of just their references. 8 | 9 | ## Installation 10 | 11 | Standard `go get`: 12 | 13 | ``` 14 | $ go get github.com/mitchellh/copystructure 15 | ``` 16 | 17 | ## Usage & Example 18 | 19 | For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/copystructure). 20 | 21 | The `Copy` function has examples associated with it there. 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_error.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalReturnError is an EvalNode implementation that returns an 4 | // error if it is present. 5 | // 6 | // This is useful for scenarios where an error has been captured by 7 | // another EvalNode (like EvalApply) for special EvalTree-based error 8 | // handling, and that handling has completed, so the error should be 9 | // returned normally. 10 | type EvalReturnError struct { 11 | Error *error 12 | } 13 | 14 | func (n *EvalReturnError) Eval(ctx EvalContext) (interface{}, error) { 15 | if n.Error == nil { 16 | return nil, nil 17 | } 18 | 19 | return nil, *n.Error 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_interpolate.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import "github.com/hashicorp/terraform/config" 4 | 5 | // EvalInterpolate is an EvalNode implementation that takes a raw 6 | // configuration and interpolates it. 7 | type EvalInterpolate struct { 8 | Config *config.RawConfig 9 | Resource *Resource 10 | Output **ResourceConfig 11 | } 12 | 13 | func (n *EvalInterpolate) Eval(ctx EvalContext) (interface{}, error) { 14 | rc, err := ctx.Interpolate(n.Config, n.Resource) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | if n.Output != nil { 20 | *n.Output = rc 21 | } 22 | 23 | return nil, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_sequence.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalSequence is an EvalNode that evaluates in sequence. 4 | type EvalSequence struct { 5 | Nodes []EvalNode 6 | } 7 | 8 | func (n *EvalSequence) Eval(ctx EvalContext) (interface{}, error) { 9 | for _, n := range n.Nodes { 10 | if n == nil { 11 | continue 12 | } 13 | 14 | if _, err := EvalRaw(n, ctx); err != nil { 15 | return nil, err 16 | } 17 | } 18 | 19 | return nil, nil 20 | } 21 | 22 | // EvalNodeFilterable impl. 23 | func (n *EvalSequence) Filter(fn EvalNodeFilterFunc) { 24 | for i, node := range n.Nodes { 25 | n.Nodes[i] = fn(node) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/resource_data_get_source.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | //go:generate stringer -type=getSource resource_data_get_source.go 4 | 5 | // getSource represents the level we want to get for a value (internally). 6 | // Any source less than or equal to the level will be loaded (whichever 7 | // has a value first). 8 | type getSource byte 9 | 10 | const ( 11 | getSourceState getSource = 1 << iota 12 | getSourceConfig 13 | getSourceDiff 14 | getSourceSet 15 | getSourceExact // Only get from the _exact_ level 16 | getSourceLevelMask getSource = getSourceState | getSourceConfig | getSourceDiff | getSourceSet 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/walkoperation_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=walkOperation graph_walk_operation.go"; DO NOT EDIT. 2 | 3 | package terraform 4 | 5 | import "fmt" 6 | 7 | const _walkOperation_name = "walkInvalidwalkInputwalkApplywalkPlanwalkPlanDestroywalkRefreshwalkValidatewalkDestroywalkImport" 8 | 9 | var _walkOperation_index = [...]uint8{0, 11, 20, 29, 37, 52, 63, 75, 86, 96} 10 | 11 | func (i walkOperation) String() string { 12 | if i >= walkOperation(len(_walkOperation_index)-1) { 13 | return fmt.Sprintf("walkOperation(%d)", i) 14 | } 15 | return _walkOperation_name[_walkOperation_index[i]:_walkOperation_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/hashstructure/include.go: -------------------------------------------------------------------------------- 1 | package hashstructure 2 | 3 | // Includable is an interface that can optionally be implemented by 4 | // a struct. It will be called for each field in the struct to check whether 5 | // it should be included in the hash. 6 | type Includable interface { 7 | HashInclude(field string, v interface{}) (bool, error) 8 | } 9 | 10 | // IncludableMap is an interface that can optionally be implemented by 11 | // a struct. It will be called when a map-type field is found to ask the 12 | // struct if the map item should be included in the hash. 13 | type IncludableMap interface { 14 | HashIncludeMap(field string, k, v interface{}) (bool, error) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/lex.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "unicode" 5 | "unicode/utf8" 6 | ) 7 | 8 | type lexModeValue byte 9 | 10 | const ( 11 | lexModeUnknown lexModeValue = iota 12 | lexModeHcl 13 | lexModeJson 14 | ) 15 | 16 | // lexMode returns whether we're going to be parsing in JSON 17 | // mode or HCL mode. 18 | func lexMode(v []byte) lexModeValue { 19 | var ( 20 | r rune 21 | w int 22 | offset int 23 | ) 24 | 25 | for { 26 | r, w = utf8.DecodeRune(v[offset:]) 27 | offset += w 28 | if unicode.IsSpace(r) { 29 | continue 30 | } 31 | if r == '{' { 32 | return lexModeJson 33 | } 34 | break 35 | } 36 | 37 | return lexModeHcl 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_data_destroy.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // NodeDestroyableDataResource represents a resource that is "plannable": 4 | // it is ready to be planned in order to create a diff. 5 | type NodeDestroyableDataResource struct { 6 | *NodeAbstractResource 7 | } 8 | 9 | // GraphNodeEvalable 10 | func (n *NodeDestroyableDataResource) EvalTree() EvalNode { 11 | addr := n.NodeAbstractResource.Addr 12 | 13 | // stateId is the ID to put into the state 14 | stateId := addr.stateId() 15 | 16 | // Just destroy it. 17 | var state *InstanceState 18 | return &EvalWriteState{ 19 | Name: stateId, 20 | State: &state, // state is nil here 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/config/decode.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/mitchellh/mapstructure" 5 | ) 6 | 7 | func Decode(target interface{}, raws ...interface{}) (*mapstructure.Metadata, error) { 8 | var md mapstructure.Metadata 9 | decoderConfig := &mapstructure.DecoderConfig{ 10 | Metadata: &md, 11 | Result: target, 12 | WeaklyTypedInput: true, 13 | } 14 | 15 | decoder, err := mapstructure.NewDecoder(decoderConfig) 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | for _, raw := range raws { 21 | err := decoder.Decode(raw) 22 | if err != nil { 23 | return nil, err 24 | } 25 | } 26 | 27 | return &md, nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/error.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | // This is a type that wraps error types so that they can be messaged 4 | // across RPC channels. Since "error" is an interface, we can't always 5 | // gob-encode the underlying structure. This is a valid error interface 6 | // implementer that we will push across. 7 | type BasicError struct { 8 | Message string 9 | } 10 | 11 | // NewBasicError is used to create a BasicError. 12 | // 13 | // err is allowed to be nil. 14 | func NewBasicError(err error) *BasicError { 15 | if err == nil { 16 | return nil 17 | } 18 | 19 | return &BasicError{err.Error()} 20 | } 21 | 22 | func (e *BasicError) Error() string { 23 | return e.Message 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/plugin/ui_output.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "net/rpc" 5 | 6 | "github.com/hashicorp/terraform/terraform" 7 | ) 8 | 9 | // UIOutput is an implementatin of terraform.UIOutput that communicates 10 | // over RPC. 11 | type UIOutput struct { 12 | Client *rpc.Client 13 | } 14 | 15 | func (o *UIOutput) Output(v string) { 16 | o.Client.Call("Plugin.Output", v, new(interface{})) 17 | } 18 | 19 | // UIOutputServer is the RPC server for serving UIOutput. 20 | type UIOutputServer struct { 21 | UIOutput terraform.UIOutput 22 | } 23 | 24 | func (s *UIOutputServer) Output( 25 | v string, 26 | reply *interface{}) error { 27 | s.UIOutput.Output(v) 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/flatten.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Flatten flattens the given error, merging any *Errors together into 4 | // a single *Error. 5 | func Flatten(err error) error { 6 | // If it isn't an *Error, just return the error as-is 7 | if _, ok := err.(*Error); !ok { 8 | return err 9 | } 10 | 11 | // Otherwise, make the result and flatten away! 12 | flatErr := new(Error) 13 | flatten(err, flatErr) 14 | return flatErr 15 | } 16 | 17 | func flatten(err error, flatErr *Error) { 18 | switch err := err.(type) { 19 | case *Error: 20 | for _, e := range err.Errors { 21 | flatten(e, flatErr) 22 | } 23 | default: 24 | flatErr.Errors = append(flatErr.Errors, err) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/process_windows.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ( 8 | // Weird name but matches the MSDN docs 9 | exit_STILL_ACTIVE = 259 10 | 11 | processDesiredAccess = syscall.STANDARD_RIGHTS_READ | 12 | syscall.PROCESS_QUERY_INFORMATION | 13 | syscall.SYNCHRONIZE 14 | ) 15 | 16 | // _pidAlive tests whether a process is alive or not 17 | func _pidAlive(pid int) bool { 18 | h, err := syscall.OpenProcess(processDesiredAccess, false, uint32(pid)) 19 | if err != nil { 20 | return false 21 | } 22 | 23 | var ec uint32 24 | if e := syscall.GetExitCodeProcess(h, &ec); e != nil { 25 | return false 26 | } 27 | 28 | return ec == exit_STILL_ACTIVE 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/get_file.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "net/url" 5 | "os" 6 | ) 7 | 8 | // FileGetter is a Getter implementation that will download a module from 9 | // a file scheme. 10 | type FileGetter struct { 11 | // Copy, if set to true, will copy data instead of using a symlink 12 | Copy bool 13 | } 14 | 15 | func (g *FileGetter) ClientMode(u *url.URL) (ClientMode, error) { 16 | path := u.Path 17 | if u.RawPath != "" { 18 | path = u.RawPath 19 | } 20 | 21 | fi, err := os.Stat(path) 22 | if err != nil { 23 | return 0, err 24 | } 25 | 26 | // Check if the source is a directory. 27 | if fi.IsDir() { 28 | return ClientModeDir, nil 29 | } 30 | 31 | return ClientModeFile, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/path.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/hex" 6 | ) 7 | 8 | // PathCacheKey returns a cache key for a module path. 9 | // 10 | // TODO: test 11 | func PathCacheKey(path []string) string { 12 | // There is probably a better way to do this, but this is working for now. 13 | // We just create an MD5 hash of all the MD5 hashes of all the path 14 | // elements. This gets us the property that it is unique per ordering. 15 | hash := md5.New() 16 | for _, p := range path { 17 | single := md5.Sum([]byte(p)) 18 | if _, err := hash.Write(single[:]); err != nil { 19 | panic(err) 20 | } 21 | } 22 | 23 | return hex.EncodeToString(hash.Sum(nil)) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF 11 | GLOBL ·REDMASK51(SB), 8, $8 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body 11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} 12 | 13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. 14 | func UnmarshalDiscardBody(r *request.Request) { 15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { 16 | return 17 | } 18 | 19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) 20 | r.HTTPResponse.Body.Close() 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/parser/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package parser 4 | 5 | import ( 6 | "github.com/hashicorp/hil/ast" 7 | "github.com/hashicorp/hil/scanner" 8 | ) 9 | 10 | // This is a fuzz testing function designed to be used with go-fuzz: 11 | // https://github.com/dvyukov/go-fuzz 12 | // 13 | // It's not included in a normal build due to the gofuzz build tag above. 14 | // 15 | // There are some input files that you can use as a seed corpus for go-fuzz 16 | // in the directory ./fuzz-corpus . 17 | 18 | func Fuzz(data []byte) int { 19 | str := string(data) 20 | 21 | ch := scanner.Scan(str, ast.Pos{Line: 1, Column: 1}) 22 | _, err := Parse(ch) 23 | if err != nil { 24 | return 0 25 | } 26 | 27 | return 1 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_config_old.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | ) 8 | 9 | // varNameForVar returns the VarName value for an interpolated variable. 10 | // This value is compared to the VarName() value for the nodes within the 11 | // graph to build the graph edges. 12 | func varNameForVar(raw config.InterpolatedVariable) string { 13 | switch v := raw.(type) { 14 | case *config.ModuleVariable: 15 | return fmt.Sprintf("module.%s.output.%s", v.Name, v.Field) 16 | case *config.ResourceVariable: 17 | return v.ResourceId() 18 | case *config.UserVariable: 19 | return fmt.Sprintf("var.%s", v.Name) 20 | default: 21 | return "" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_transitive_reduction.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // TransitiveReductionTransformer is a GraphTransformer that performs 4 | // finds the transitive reduction of the graph. For a definition of 5 | // transitive reduction, see Wikipedia. 6 | type TransitiveReductionTransformer struct{} 7 | 8 | func (t *TransitiveReductionTransformer) Transform(g *Graph) error { 9 | // If the graph isn't valid, skip the transitive reduction. 10 | // We don't error here because Terraform itself handles graph 11 | // validation in a better way, or we assume it does. 12 | if err := g.Validate(); err != nil { 13 | return nil 14 | } 15 | 16 | // Do it 17 | g.TransitiveReduction() 18 | 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_count_computed.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | ) 8 | 9 | // EvalCountCheckComputed is an EvalNode that checks if a resource count 10 | // is computed and errors if so. This can possibly happen across a 11 | // module boundary and we don't yet support this. 12 | type EvalCountCheckComputed struct { 13 | Resource *config.Resource 14 | } 15 | 16 | // TODO: test 17 | func (n *EvalCountCheckComputed) Eval(ctx EvalContext) (interface{}, error) { 18 | if n.Resource.RawCount.Value() == unknownValue() { 19 | return nil, fmt.Errorf( 20 | "%s: value of 'count' cannot be computed", 21 | n.Resource.Id()) 22 | } 23 | 24 | return nil, nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_input_mock.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // MockUIInput is an implementation of UIInput that can be used for tests. 4 | type MockUIInput struct { 5 | InputCalled bool 6 | InputOpts *InputOpts 7 | InputReturnMap map[string]string 8 | InputReturnString string 9 | InputReturnError error 10 | InputFn func(*InputOpts) (string, error) 11 | } 12 | 13 | func (i *MockUIInput) Input(opts *InputOpts) (string, error) { 14 | i.InputCalled = true 15 | i.InputOpts = opts 16 | if i.InputFn != nil { 17 | return i.InputFn(opts) 18 | } 19 | if i.InputReturnMap != nil { 20 | return i.InputReturnMap[opts.Id], i.InputReturnError 21 | } 22 | return i.InputReturnString, i.InputReturnError 23 | } 24 | -------------------------------------------------------------------------------- /provider/provider_test.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "testing" 5 | "github.com/hashicorp/terraform/helper/schema" 6 | "github.com/hashicorp/terraform/terraform" 7 | ) 8 | 9 | var testAccProviders map[string]terraform.ResourceProvider 10 | var testAccProvider *schema.Provider 11 | 12 | func init() { 13 | testAccProvider = Provider().(*schema.Provider) 14 | testAccProviders = map[string]terraform.ResourceProvider { 15 | "sumologic":testAccProvider, 16 | } 17 | } 18 | 19 | func TestProvider(t *testing.T) { 20 | if err:= Provider().(*schema.Provider).InternalValidate(); err != nil { 21 | t.Fatalf("err: %s", err) 22 | } 23 | } 24 | 25 | func TestProvider_impl(t *testing.T) { 26 | var _ terraform.ResourceProvider = Provider() 27 | } -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/README.md: -------------------------------------------------------------------------------- 1 | # go-homedir 2 | 3 | This is a Go library for detecting the user's home directory without 4 | the use of cgo, so the library can be used in cross-compilation environments. 5 | 6 | Usage is incredibly simple, just call `homedir.Dir()` to get the home directory 7 | for a user, and `homedir.Expand()` to expand the `~` in a path to the home 8 | directory. 9 | 10 | **Why not just use `os/user`?** The built-in `os/user` package requires 11 | cgo on Darwin systems. This means that any Go code that uses that package 12 | cannot cross compile. But 99% of the time the use for `os/user` is just to 13 | retrieve the home directory, which we can do for the current user without 14 | cgo. This library does that, enabling cross-compilation. 15 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_module_destroy.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // NodeDestroyableModule represents a module destruction. 8 | type NodeDestroyableModuleVariable struct { 9 | PathValue []string 10 | } 11 | 12 | func (n *NodeDestroyableModuleVariable) Name() string { 13 | result := "plan-destroy" 14 | if len(n.PathValue) > 1 { 15 | result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result) 16 | } 17 | 18 | return result 19 | } 20 | 21 | // GraphNodeSubPath 22 | func (n *NodeDestroyableModuleVariable) Path() []string { 23 | return n.PathValue 24 | } 25 | 26 | // GraphNodeEvalable 27 | func (n *NodeDestroyableModuleVariable) EvalTree() EvalNode { 28 | return &EvalDiffDestroyModule{Path: n.PathValue} 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/discover.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | // Discover discovers plugins that are in a given directory. 8 | // 9 | // The directory doesn't need to be absolute. For example, "." will work fine. 10 | // 11 | // This currently assumes any file matching the glob is a plugin. 12 | // In the future this may be smarter about checking that a file is 13 | // executable and so on. 14 | // 15 | // TODO: test 16 | func Discover(glob, dir string) ([]string, error) { 17 | var err error 18 | 19 | // Make the directory absolute if it isn't already 20 | if !filepath.IsAbs(dir) { 21 | dir, err = filepath.Abs(dir) 22 | if err != nil { 23 | return nil, err 24 | } 25 | } 26 | 27 | return filepath.Glob(filepath.Join(dir, glob)) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package s3 4 | 5 | import ( 6 | "github.com/aws/aws-sdk-go/aws" 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | func platformRequestHandlers(r *request.Request) { 11 | if r.Operation.HTTPMethod == "PUT" { 12 | // 100-Continue should only be used on put requests. 13 | r.Handlers.Sign.PushBack(add100Continue) 14 | } 15 | } 16 | 17 | func add100Continue(r *request.Request) { 18 | if aws.BoolValue(r.Config.S3Disable100Continue) { 19 | return 20 | } 21 | if r.HTTPRequest.ContentLength < 1024*1024*2 { 22 | // Ignore requests smaller than 2MB. This helps prevent delaying 23 | // requests unnecessarily. 24 | return 25 | } 26 | 27 | r.HTTPRequest.Header.Set("Expect", "100-Continue") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/unknown.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | // IsUnknown reports whether a variable is unknown or contains any value 4 | // that is unknown. This will recurse into lists and maps and so on. 5 | func IsUnknown(v Variable) bool { 6 | // If it is unknown itself, return true 7 | if v.Type == TypeUnknown { 8 | return true 9 | } 10 | 11 | // If it is a container type, check the values 12 | switch v.Type { 13 | case TypeList: 14 | for _, el := range v.Value.([]Variable) { 15 | if IsUnknown(el) { 16 | return true 17 | } 18 | } 19 | case TypeMap: 20 | for _, el := range v.Value.(map[string]Variable) { 21 | if IsUnknown(el) { 22 | return true 23 | } 24 | } 25 | default: 26 | } 27 | 28 | // Not a container type or survive the above checks 29 | return false 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/testing.go: -------------------------------------------------------------------------------- 1 | package schema 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | "github.com/hashicorp/terraform/terraform" 8 | ) 9 | 10 | // TestResourceDataRaw creates a ResourceData from a raw configuration map. 11 | func TestResourceDataRaw( 12 | t *testing.T, schema map[string]*Schema, raw map[string]interface{}) *ResourceData { 13 | c, err := config.NewRawConfig(raw) 14 | if err != nil { 15 | t.Fatalf("err: %s", err) 16 | } 17 | 18 | sm := schemaMap(schema) 19 | diff, err := sm.Diff(nil, terraform.NewResourceConfig(c)) 20 | if err != nil { 21 | t.Fatalf("err: %s", err) 22 | } 23 | 24 | result, err := sm.Data(nil, diff) 25 | if err != nil { 26 | t.Fatalf("err: %s", err) 27 | } 28 | 29 | return result 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_count_boundary.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/dag" 5 | ) 6 | 7 | // CountBoundaryTransformer adds a node that depends on everything else 8 | // so that it runs last in order to clean up the state for nodes that 9 | // are on the "count boundary": "foo.0" when only one exists becomes "foo" 10 | type CountBoundaryTransformer struct{} 11 | 12 | func (t *CountBoundaryTransformer) Transform(g *Graph) error { 13 | node := &NodeCountBoundary{} 14 | g.Add(node) 15 | 16 | // Depends on everything 17 | for _, v := range g.Vertices() { 18 | // Don't connect to ourselves 19 | if v == node { 20 | continue 21 | } 22 | 23 | // Connect! 24 | g.Connect(dag.BasicEdge(node, v)) 25 | } 26 | 27 | return nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/format.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // ErrorFormatFunc is a function callback that is called by Error to 9 | // turn the list of errors into a string. 10 | type ErrorFormatFunc func([]error) string 11 | 12 | // ListFormatFunc is a basic formatter that outputs the number of errors 13 | // that occurred along with a bullet point list of the errors. 14 | func ListFormatFunc(es []error) string { 15 | if len(es) == 1 { 16 | return fmt.Sprintf("1 error occurred:\n\n* %s", es[0]) 17 | } 18 | 19 | points := make([]string, len(es)) 20 | for i, err := range es { 21 | points[i] = fmt.Sprintf("* %s", err) 22 | } 23 | 24 | return fmt.Sprintf( 25 | "%d errors occurred:\n\n%s", 26 | len(es), strings.Join(points, "\n")) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/variable_access.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // VariableAccess represents a variable access. 8 | type VariableAccess struct { 9 | Name string 10 | Posx Pos 11 | } 12 | 13 | func (n *VariableAccess) Accept(v Visitor) Node { 14 | return v(n) 15 | } 16 | 17 | func (n *VariableAccess) Pos() Pos { 18 | return n.Posx 19 | } 20 | 21 | func (n *VariableAccess) GoString() string { 22 | return fmt.Sprintf("*%#v", *n) 23 | } 24 | 25 | func (n *VariableAccess) String() string { 26 | return fmt.Sprintf("Variable(%s)", n.Name) 27 | } 28 | 29 | func (n *VariableAccess) Type(s Scope) (Type, error) { 30 | v, ok := s.LookupVar(n.Name) 31 | if !ok { 32 | return TypeInvalid, fmt.Errorf("unknown variable: %s", n.Name) 33 | } 34 | 35 | return v.Type, nil 36 | } 37 | -------------------------------------------------------------------------------- /provider/resource_sumologic_cloudsyslog_source_test.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/helper/resource" 5 | "testing" 6 | ) 7 | 8 | func TestAccSumologicCloudsyslogSource(t *testing.T) { 9 | resource.Test(t, resource.TestCase{ 10 | Providers: testAccProviders, 11 | Steps: []resource.TestStep{ 12 | { 13 | Config: testAccSumologicCloudsyslogSourceConfig, 14 | }, 15 | }}) 16 | } 17 | 18 | var testAccSumologicCloudsyslogSourceConfig = ` 19 | 20 | resource "sumologic_collector" "test" { 21 | name = "MyCollector" 22 | description = "MyCollectorDesc" 23 | category = "Cat" 24 | } 25 | 26 | resource "sumologic_cloudsyslog_source" "cloudsyslog" { 27 | name = "test_cloudsyslog" 28 | category = "source/category" 29 | collector_id = "${sumologic_collector.test.id}" 30 | } 31 | ` 32 | -------------------------------------------------------------------------------- /provider/resource_sumologic_http_source_test.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "testing" 5 | "github.com/hashicorp/terraform/helper/resource" 6 | ) 7 | 8 | func TestAccSumologicHttpSource(t *testing.T) { 9 | resource.Test(t, resource.TestCase{ 10 | Providers: testAccProviders, 11 | Steps: []resource.TestStep { 12 | { 13 | Config: testAccSumologicHttpSourceConfig, 14 | }, 15 | }}) 16 | } 17 | 18 | var testAccSumologicHttpSourceConfig = ` 19 | 20 | resource "sumologic_collector" "test" { 21 | name = "MyCollector" 22 | description = "MyCollectorDesc" 23 | category = "Cat" 24 | } 25 | 26 | resource "sumologic_http_source" "http" { 27 | name = "test_http" 28 | messagePerRequest = false 29 | category = "source/category" 30 | collector_id = "${sumologic_collector.test.id}" 31 | } 32 | ` 33 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package request 4 | 5 | import "io" 6 | 7 | // NoBody is an io.ReadCloser with no bytes. Read always returns EOF 8 | // and Close always returns nil. It can be used in an outgoing client 9 | // request to explicitly signal that a request has zero bytes. 10 | // An alternative, however, is to simply set Request.Body to nil. 11 | // 12 | // Copy of Go 1.8 NoBody type from net/http/http.go 13 | type noBody struct{} 14 | 15 | func (noBody) Read([]byte) (int, error) { return 0, io.EOF } 16 | func (noBody) Close() error { return nil } 17 | func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil } 18 | 19 | // Is an empty reader that will trigger the Go HTTP client to not include 20 | // and body in the HTTP request. 21 | var noBodyReader = noBody{} 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/server_mux.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | ) 7 | 8 | // ServeMuxMap is the type that is used to configure ServeMux 9 | type ServeMuxMap map[string]*ServeConfig 10 | 11 | // ServeMux is like Serve, but serves multiple types of plugins determined 12 | // by the argument given on the command-line. 13 | // 14 | // This command doesn't return until the plugin is done being executed. Any 15 | // errors are logged or output to stderr. 16 | func ServeMux(m ServeMuxMap) { 17 | if len(os.Args) != 2 { 18 | fmt.Fprintf(os.Stderr, 19 | "Invoked improperly. This is an internal command that shouldn't\n"+ 20 | "be manually invoked.\n") 21 | os.Exit(1) 22 | } 23 | 24 | opts, ok := m[os.Args[1]] 25 | if !ok { 26 | fmt.Fprintf(os.Stderr, "Unknown plugin: %s\n", os.Args[1]) 27 | os.Exit(1) 28 | } 29 | 30 | Serve(opts) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/dag/edge.go: -------------------------------------------------------------------------------- 1 | package dag 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Edge represents an edge in the graph, with a source and target vertex. 8 | type Edge interface { 9 | Source() Vertex 10 | Target() Vertex 11 | 12 | Hashable 13 | } 14 | 15 | // BasicEdge returns an Edge implementation that simply tracks the source 16 | // and target given as-is. 17 | func BasicEdge(source, target Vertex) Edge { 18 | return &basicEdge{S: source, T: target} 19 | } 20 | 21 | // basicEdge is a basic implementation of Edge that has the source and 22 | // target vertex. 23 | type basicEdge struct { 24 | S, T Vertex 25 | } 26 | 27 | func (e *basicEdge) Hashcode() interface{} { 28 | return fmt.Sprintf("%p-%p", e.S, e.T) 29 | } 30 | 31 | func (e *basicEdge) Source() Vertex { 32 | return e.S 33 | } 34 | 35 | func (e *basicEdge) Target() Vertex { 36 | return e.T 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/transform_fixed.go: -------------------------------------------------------------------------------- 1 | package hil 2 | 3 | import ( 4 | "github.com/hashicorp/hil/ast" 5 | ) 6 | 7 | // FixedValueTransform transforms an AST to return a fixed value for 8 | // all interpolations. i.e. you can make "hi ${anything}" always 9 | // turn into "hi foo". 10 | // 11 | // The primary use case for this is for config validations where you can 12 | // verify that interpolations result in a certain type of string. 13 | func FixedValueTransform(root ast.Node, Value *ast.LiteralNode) ast.Node { 14 | // We visit the nodes in top-down order 15 | result := root 16 | switch n := result.(type) { 17 | case *ast.Output: 18 | for i, v := range n.Exprs { 19 | n.Exprs[i] = FixedValueTransform(v, Value) 20 | } 21 | case *ast.LiteralNode: 22 | // We keep it as-is 23 | default: 24 | // Anything else we replace 25 | result = Value 26 | } 27 | 28 | return result 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_output_orphan.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // NodeOutputOrphan represents an output that is an orphan. 8 | type NodeOutputOrphan struct { 9 | OutputName string 10 | PathValue []string 11 | } 12 | 13 | func (n *NodeOutputOrphan) Name() string { 14 | result := fmt.Sprintf("output.%s (orphan)", n.OutputName) 15 | if len(n.PathValue) > 1 { 16 | result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result) 17 | } 18 | 19 | return result 20 | } 21 | 22 | // GraphNodeSubPath 23 | func (n *NodeOutputOrphan) Path() []string { 24 | return n.PathValue 25 | } 26 | 27 | // GraphNodeEvalable 28 | func (n *NodeOutputOrphan) EvalTree() EvalNode { 29 | return &EvalOpFilter{ 30 | Ops: []walkOperation{walkRefresh, walkApply, walkDestroy}, 31 | Node: &EvalDeleteOutput{ 32 | Name: n.OutputName, 33 | }, 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/client_mode.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | // ClientMode is the mode that the client operates in. 4 | type ClientMode uint 5 | 6 | const ( 7 | ClientModeInvalid ClientMode = iota 8 | 9 | // ClientModeAny downloads anything it can. In this mode, dst must 10 | // be a directory. If src is a file, it is saved into the directory 11 | // with the basename of the URL. If src is a directory or archive, 12 | // it is unpacked directly into dst. 13 | ClientModeAny 14 | 15 | // ClientModeFile downloads a single file. In this mode, dst must 16 | // be a file path (doesn't have to exist). src must point to a single 17 | // file. It is saved as dst. 18 | ClientModeFile 19 | 20 | // ClientModeDir downloads a directory. In this mode, dst must be 21 | // a directory path (doesn't have to exist). src must point to an 22 | // archive or directory (such as in s3). 23 | ClientModeDir 24 | ) 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_root.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import "github.com/hashicorp/terraform/dag" 4 | 5 | const rootNodeName = "root" 6 | 7 | // RootTransformer is a GraphTransformer that adds a root to the graph. 8 | type RootTransformer struct{} 9 | 10 | func (t *RootTransformer) Transform(g *Graph) error { 11 | // If we already have a good root, we're done 12 | if _, err := g.Root(); err == nil { 13 | return nil 14 | } 15 | 16 | // Add a root 17 | var root graphNodeRoot 18 | g.Add(root) 19 | 20 | // Connect the root to all the edges that need it 21 | for _, v := range g.Vertices() { 22 | if v == root { 23 | continue 24 | } 25 | 26 | if g.UpEdges(v).Len() == 0 { 27 | g.Connect(dag.BasicEdge(root, v)) 28 | } 29 | } 30 | 31 | return nil 32 | } 33 | 34 | type graphNodeRoot struct{} 35 | 36 | func (n graphNodeRoot) Name() string { 37 | return rootNodeName 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/arithmetic.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // Arithmetic represents a node where the result is arithmetic of 9 | // two or more operands in the order given. 10 | type Arithmetic struct { 11 | Op ArithmeticOp 12 | Exprs []Node 13 | Posx Pos 14 | } 15 | 16 | func (n *Arithmetic) Accept(v Visitor) Node { 17 | for i, expr := range n.Exprs { 18 | n.Exprs[i] = expr.Accept(v) 19 | } 20 | 21 | return v(n) 22 | } 23 | 24 | func (n *Arithmetic) Pos() Pos { 25 | return n.Posx 26 | } 27 | 28 | func (n *Arithmetic) GoString() string { 29 | return fmt.Sprintf("*%#v", *n) 30 | } 31 | 32 | func (n *Arithmetic) String() string { 33 | var b bytes.Buffer 34 | for _, expr := range n.Exprs { 35 | b.WriteString(fmt.Sprintf("%s", expr)) 36 | } 37 | 38 | return b.String() 39 | } 40 | 41 | func (n *Arithmetic) Type(Scope) (Type, error) { 42 | return TypeInt, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/ui_input.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // UIInput is the interface that must be implemented to ask for input 4 | // from this user. This should forward the request to wherever the user 5 | // inputs things to ask for values. 6 | type UIInput interface { 7 | Input(*InputOpts) (string, error) 8 | } 9 | 10 | // InputOpts are options for asking for input. 11 | type InputOpts struct { 12 | // Id is a unique ID for the question being asked that might be 13 | // used for logging or to look up a prior answered question. 14 | Id string 15 | 16 | // Query is a human-friendly question for inputting this value. 17 | Query string 18 | 19 | // Description is a description about what this option is. Be wary 20 | // that this will probably be in a terminal so split lines as you see 21 | // necessary. 22 | Description string 23 | 24 | // Default will be the value returned if no data is entered. 25 | Default string 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/source.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // SourceDirSubdir takes a source and returns a tuple of the URL without 8 | // the subdir and the URL with the subdir. 9 | func SourceDirSubdir(src string) (string, string) { 10 | // Calcaulate an offset to avoid accidentally marking the scheme 11 | // as the dir. 12 | var offset int 13 | if idx := strings.Index(src, "://"); idx > -1 { 14 | offset = idx + 3 15 | } 16 | 17 | // First see if we even have an explicit subdir 18 | idx := strings.Index(src[offset:], "//") 19 | if idx == -1 { 20 | return src, "" 21 | } 22 | 23 | idx += offset 24 | subdir := src[idx+2:] 25 | src = src[:idx] 26 | 27 | // Next, check if we have query parameters and push them onto the 28 | // URL. 29 | if idx = strings.Index(subdir, "?"); idx > -1 { 30 | query := subdir[idx:] 31 | subdir = subdir[:idx] 32 | src += query 33 | } 34 | 35 | return src, subdir 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "net/http" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | ) 11 | 12 | func copyMultipartStatusOKUnmarhsalError(r *request.Request) { 13 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) 14 | if err != nil { 15 | r.Error = awserr.New("SerializationError", "unable to read response body", err) 16 | return 17 | } 18 | body := bytes.NewReader(b) 19 | r.HTTPResponse.Body = ioutil.NopCloser(body) 20 | defer body.Seek(0, 0) 21 | 22 | if body.Len() == 0 { 23 | // If there is no body don't attempt to parse the body. 24 | return 25 | } 26 | 27 | unmarshalError(r) 28 | if err, ok := r.Error.(awserr.Error); ok && err != nil { 29 | if err.Code() == "SerializationError" { 30 | r.Error = nil 31 | return 32 | } 33 | r.HTTPResponse.StatusCode = http.StatusServiceUnavailable 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graph_builder_input.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/dag" 5 | ) 6 | 7 | // InputGraphBuilder creates the graph for the input operation. 8 | // 9 | // Unlike other graph builders, this is a function since it currently modifies 10 | // and is based on the PlanGraphBuilder. The PlanGraphBuilder passed in will be 11 | // modified and should not be used for any other operations. 12 | func InputGraphBuilder(p *PlanGraphBuilder) GraphBuilder { 13 | // We're going to customize the concrete functions 14 | p.CustomConcrete = true 15 | 16 | // Set the provider to the normal provider. This will ask for input. 17 | p.ConcreteProvider = func(a *NodeAbstractProvider) dag.Vertex { 18 | return &NodeApplyableProvider{ 19 | NodeAbstractProvider: a, 20 | } 21 | } 22 | 23 | // We purposely don't set any more concrete fields since the remainder 24 | // should be no-ops. 25 | 26 | return p 27 | } 28 | -------------------------------------------------------------------------------- /provider/resource_sumologic_collector_test.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "testing" 5 | "github.com/hashicorp/terraform/helper/resource" 6 | "github.com/hashicorp/terraform/terraform" 7 | ) 8 | 9 | func TestAccSumologicCollector(t *testing.T) { 10 | resource.Test(t, resource.TestCase{ 11 | Providers: testAccProviders, 12 | Steps: []resource.TestStep { 13 | { 14 | Config: testAccSumologicCollectorConfig, 15 | Check: resource.ComposeTestCheckFunc( 16 | testAccCheckCollectorExists("sumologic_collector.test", t), 17 | ), 18 | }, 19 | }}) 20 | } 21 | 22 | func testAccCheckCollectorExists(n string, t *testing.T) resource.TestCheckFunc { 23 | return func (s *terraform.State) error { 24 | return nil 25 | } 26 | } 27 | 28 | var testAccSumologicCollectorConfig = ` 29 | 30 | resource "sumologic_collector" "test" { 31 | name = "MyCollector" 32 | description = "MyCollectorDesc" 33 | category = "Cat" 34 | timezone = "Europe/Berlin" 35 | } 36 | 37 | ` -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/conditional.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type Conditional struct { 8 | CondExpr Node 9 | TrueExpr Node 10 | FalseExpr Node 11 | Posx Pos 12 | } 13 | 14 | // Accept passes the given visitor to the child nodes in this order: 15 | // CondExpr, TrueExpr, FalseExpr. It then finally passes itself to the visitor. 16 | func (n *Conditional) Accept(v Visitor) Node { 17 | n.CondExpr = n.CondExpr.Accept(v) 18 | n.TrueExpr = n.TrueExpr.Accept(v) 19 | n.FalseExpr = n.FalseExpr.Accept(v) 20 | 21 | return v(n) 22 | } 23 | 24 | func (n *Conditional) Pos() Pos { 25 | return n.Posx 26 | } 27 | 28 | func (n *Conditional) Type(Scope) (Type, error) { 29 | // This is not actually a useful value; the type checker ignores 30 | // this function when analyzing conditionals, just as with Arithmetic. 31 | return TypeInt, nil 32 | } 33 | 34 | func (n *Conditional) GoString() string { 35 | return fmt.Sprintf("*%#v", *n) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/Makefile: -------------------------------------------------------------------------------- 1 | TEST?=./... 2 | 3 | default: test 4 | 5 | # test runs the test suite and vets the code. 6 | test: generate 7 | @echo "==> Running tests..." 8 | @go list $(TEST) \ 9 | | grep -v "/vendor/" \ 10 | | xargs -n1 go test -timeout=60s -parallel=10 ${TESTARGS} 11 | 12 | # testrace runs the race checker 13 | testrace: generate 14 | @echo "==> Running tests (race)..." 15 | @go list $(TEST) \ 16 | | grep -v "/vendor/" \ 17 | | xargs -n1 go test -timeout=60s -race ${TESTARGS} 18 | 19 | # updatedeps installs all the dependencies needed to run and build. 20 | updatedeps: 21 | @sh -c "'${CURDIR}/scripts/deps.sh' '${NAME}'" 22 | 23 | # generate runs `go generate` to build the dynamically generated source files. 24 | generate: 25 | @echo "==> Generating..." 26 | @find . -type f -name '.DS_Store' -delete 27 | @go list ./... \ 28 | | grep -v "/vendor/" \ 29 | | xargs -n1 go generate 30 | 31 | .PHONY: default test testrace updatedeps generate 32 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/prefix.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/errwrap" 7 | ) 8 | 9 | // Prefix is a helper function that will prefix some text 10 | // to the given error. If the error is a multierror.Error, then 11 | // it will be prefixed to each wrapped error. 12 | // 13 | // This is useful to use when appending multiple multierrors 14 | // together in order to give better scoping. 15 | func Prefix(err error, prefix string) error { 16 | if err == nil { 17 | return nil 18 | } 19 | 20 | format := fmt.Sprintf("%s {{err}}", prefix) 21 | switch err := err.(type) { 22 | case *Error: 23 | // Typed nils can reach here, so initialize if we are nil 24 | if err == nil { 25 | err = new(Error) 26 | } 27 | 28 | // Wrap each of the errors 29 | for i, e := range err.Errors { 30 | err.Errors[i] = errwrap.Wrapf(format, e) 31 | } 32 | 33 | return err 34 | default: 35 | return errwrap.Wrapf(format, err) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/testing.go: -------------------------------------------------------------------------------- 1 | package module 2 | 3 | import ( 4 | "io/ioutil" 5 | "os" 6 | "testing" 7 | 8 | "github.com/hashicorp/go-getter" 9 | ) 10 | 11 | // TestTree loads a module at the given path and returns the tree as well 12 | // as a function that should be deferred to clean up resources. 13 | func TestTree(t *testing.T, path string) (*Tree, func()) { 14 | // Create a temporary directory for module storage 15 | dir, err := ioutil.TempDir("", "tf") 16 | if err != nil { 17 | t.Fatalf("err: %s", err) 18 | return nil, nil 19 | } 20 | 21 | // Load the module 22 | mod, err := NewTreeModule("", path) 23 | if err != nil { 24 | t.Fatalf("err: %s", err) 25 | return nil, nil 26 | } 27 | 28 | // Get the child modules 29 | s := &getter.FolderStorage{StorageDir: dir} 30 | if err := mod.Load(s, GetModeGet); err != nil { 31 | t.Fatalf("err: %s", err) 32 | return nil, nil 33 | } 34 | 35 | return mod, func() { 36 | os.RemoveAll(dir) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/call.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // Call represents a function call. 9 | type Call struct { 10 | Func string 11 | Args []Node 12 | Posx Pos 13 | } 14 | 15 | func (n *Call) Accept(v Visitor) Node { 16 | for i, a := range n.Args { 17 | n.Args[i] = a.Accept(v) 18 | } 19 | 20 | return v(n) 21 | } 22 | 23 | func (n *Call) Pos() Pos { 24 | return n.Posx 25 | } 26 | 27 | func (n *Call) String() string { 28 | args := make([]string, len(n.Args)) 29 | for i, arg := range n.Args { 30 | args[i] = fmt.Sprintf("%s", arg) 31 | } 32 | 33 | return fmt.Sprintf("Call(%s, %s)", n.Func, strings.Join(args, ", ")) 34 | } 35 | 36 | func (n *Call) Type(s Scope) (Type, error) { 37 | f, ok := s.LookupFunc(n.Func) 38 | if !ok { 39 | return TypeInvalid, fmt.Errorf("unknown function: %s", n.Func) 40 | } 41 | 42 | return f.ReturnType, nil 43 | } 44 | 45 | func (n *Call) GoString() string { 46 | return fmt.Sprintf("*%#v", *n) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_filter.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalNodeFilterFunc is the callback used to replace a node with 4 | // another to node. To not do the replacement, just return the input node. 5 | type EvalNodeFilterFunc func(EvalNode) EvalNode 6 | 7 | // EvalNodeFilterable is an interface that can be implemented by 8 | // EvalNodes to allow filtering of sub-elements. Note that this isn't 9 | // a common thing to implement and you probably don't need it. 10 | type EvalNodeFilterable interface { 11 | EvalNode 12 | Filter(EvalNodeFilterFunc) 13 | } 14 | 15 | // EvalFilter runs the filter on the given node and returns the 16 | // final filtered value. This should be called rather than checking 17 | // the EvalNode directly since this will properly handle EvalNodeFilterables. 18 | func EvalFilter(node EvalNode, fn EvalNodeFilterFunc) EvalNode { 19 | if f, ok := node.(EvalNodeFilterable); ok { 20 | f.Filter(fn) 21 | return node 22 | } 23 | 24 | return fn(node) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_variable.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/config/module" 5 | ) 6 | 7 | // RootVariableTransformer is a GraphTransformer that adds all the root 8 | // variables to the graph. 9 | // 10 | // Root variables are currently no-ops but they must be added to the 11 | // graph since downstream things that depend on them must be able to 12 | // reach them. 13 | type RootVariableTransformer struct { 14 | Module *module.Tree 15 | } 16 | 17 | func (t *RootVariableTransformer) Transform(g *Graph) error { 18 | // If no config, no variables 19 | if t.Module == nil { 20 | return nil 21 | } 22 | 23 | // If we have no vars, we're done! 24 | vars := t.Module.Config().Variables 25 | if len(vars) == 0 { 26 | return nil 27 | } 28 | 29 | // Add all variables here 30 | for _, v := range vars { 31 | node := &NodeRootVariable{ 32 | Config: v, 33 | } 34 | 35 | // Add it! 36 | g.Add(node) 37 | } 38 | 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/parser/error.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hil/ast" 7 | "github.com/hashicorp/hil/scanner" 8 | ) 9 | 10 | type ParseError struct { 11 | Message string 12 | Pos ast.Pos 13 | } 14 | 15 | func Errorf(pos ast.Pos, format string, args ...interface{}) error { 16 | return &ParseError{ 17 | Message: fmt.Sprintf(format, args...), 18 | Pos: pos, 19 | } 20 | } 21 | 22 | // TokenErrorf is a convenient wrapper around Errorf that uses the 23 | // position of the given token. 24 | func TokenErrorf(token *scanner.Token, format string, args ...interface{}) error { 25 | return Errorf(token.Pos, format, args...) 26 | } 27 | 28 | func ExpectationError(wanted string, got *scanner.Token) error { 29 | return TokenErrorf(got, "expected %s but found %s", wanted, got) 30 | } 31 | 32 | func (e *ParseError) Error() string { 33 | return fmt.Sprintf("parse error at %s: %s", e.Pos, e.Message) 34 | } 35 | 36 | func (e *ParseError) String() string { 37 | return e.Error() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-plugin/plugin.go: -------------------------------------------------------------------------------- 1 | // The plugin package exposes functions and helpers for communicating to 2 | // plugins which are implemented as standalone binary applications. 3 | // 4 | // plugin.Client fully manages the lifecycle of executing the application, 5 | // connecting to it, and returning the RPC client for dispensing plugins. 6 | // 7 | // plugin.Serve fully manages listeners to expose an RPC server from a binary 8 | // that plugin.Client can connect to. 9 | package plugin 10 | 11 | import ( 12 | "net/rpc" 13 | ) 14 | 15 | // Plugin is the interface that is implemented to serve/connect to an 16 | // inteface implementation. 17 | type Plugin interface { 18 | // Server should return the RPC server compatible struct to serve 19 | // the methods that the Client calls over net/rpc. 20 | Server(*MuxBroker) (interface{}, error) 21 | 22 | // Client returns an interface implementation for the plugin you're 23 | // serving that communicates to the server end of the plugin. 24 | Client(*MuxBroker, *rpc.Client) (interface{}, error) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go: -------------------------------------------------------------------------------- 1 | package awsutil 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. 8 | // In addition to this, this method will also dereference the input values if 9 | // possible so the DeepEqual performed will not fail if one parameter is a 10 | // pointer and the other is not. 11 | // 12 | // DeepEqual will not perform indirection of nested values of the input parameters. 13 | func DeepEqual(a, b interface{}) bool { 14 | ra := reflect.Indirect(reflect.ValueOf(a)) 15 | rb := reflect.Indirect(reflect.ValueOf(b)) 16 | 17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { 18 | // If the elements are both nil, and of the same type the are equal 19 | // If they are of different types they are not equal 20 | return reflect.TypeOf(a) == reflect.TypeOf(b) 21 | } else if raValid != rbValid { 22 | // Both values must be valid to be equal 23 | return false 24 | } 25 | 26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/experiment/id.go: -------------------------------------------------------------------------------- 1 | package experiment 2 | 3 | // ID represents an experimental feature. 4 | // 5 | // The global vars defined on this package should be used as ID values. 6 | // This interface is purposely not implement-able outside of this package 7 | // so that we can rely on the Go compiler to enforce all experiment references. 8 | type ID interface { 9 | Env() string 10 | Flag() string 11 | Default() bool 12 | 13 | unexported() // So the ID can't be implemented externally. 14 | } 15 | 16 | // basicID implements ID. 17 | type basicID struct { 18 | EnvValue string 19 | FlagValue string 20 | DefaultValue bool 21 | } 22 | 23 | func newBasicID(flag, env string, def bool) ID { 24 | return &basicID{ 25 | EnvValue: env, 26 | FlagValue: flag, 27 | DefaultValue: def, 28 | } 29 | } 30 | 31 | func (id *basicID) Env() string { return id.EnvValue } 32 | func (id *basicID) Flag() string { return id.FlagValue } 33 | func (id *basicID) Default() bool { return id.DefaultValue } 34 | func (id *basicID) unexported() {} 35 | -------------------------------------------------------------------------------- /vendor/github.com/apparentlymart/go-cidr/cidr/wrangling.go: -------------------------------------------------------------------------------- 1 | package cidr 2 | 3 | import ( 4 | "fmt" 5 | "math/big" 6 | "net" 7 | ) 8 | 9 | func ipToInt(ip net.IP) (*big.Int, int) { 10 | val := &big.Int{} 11 | val.SetBytes([]byte(ip)) 12 | if len(ip) == net.IPv4len { 13 | return val, 32 14 | } else if len(ip) == net.IPv6len { 15 | return val, 128 16 | } else { 17 | panic(fmt.Errorf("Unsupported address length %d", len(ip))) 18 | } 19 | } 20 | 21 | func intToIP(ipInt *big.Int, bits int) net.IP { 22 | ipBytes := ipInt.Bytes() 23 | ret := make([]byte, bits/8) 24 | // Pack our IP bytes into the end of the return array, 25 | // since big.Int.Bytes() removes front zero padding. 26 | for i := 1; i <= len(ipBytes); i++ { 27 | ret[len(ret)-i] = ipBytes[len(ipBytes)-i] 28 | } 29 | return net.IP(ret) 30 | } 31 | 32 | func insertNumIntoIP(ip net.IP, num int, prefixLen int) net.IP { 33 | ipInt, totalBits := ipToInt(ip) 34 | bigNum := big.NewInt(int64(num)) 35 | bigNum.Lsh(bigNum, uint(totalBits-prefixLen)) 36 | ipInt.Or(ipInt, bigNum) 37 | return intToIP(ipInt, totalBits) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/parse.go: -------------------------------------------------------------------------------- 1 | package hcl 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/hcl/hcl/ast" 7 | hclParser "github.com/hashicorp/hcl/hcl/parser" 8 | jsonParser "github.com/hashicorp/hcl/json/parser" 9 | ) 10 | 11 | // ParseBytes accepts as input byte slice and returns ast tree. 12 | // 13 | // Input can be either JSON or HCL 14 | func ParseBytes(in []byte) (*ast.File, error) { 15 | return parse(in) 16 | } 17 | 18 | // ParseString accepts input as a string and returns ast tree. 19 | func ParseString(input string) (*ast.File, error) { 20 | return parse([]byte(input)) 21 | } 22 | 23 | func parse(in []byte) (*ast.File, error) { 24 | switch lexMode(in) { 25 | case lexModeHcl: 26 | return hclParser.Parse(in) 27 | case lexModeJson: 28 | return jsonParser.Parse(in) 29 | } 30 | 31 | return nil, fmt.Errorf("unknown config format") 32 | } 33 | 34 | // Parse parses the given input and returns the root object. 35 | // 36 | // The input format can be either HCL or JSON. 37 | func Parse(input string) (*ast.File, error) { 38 | return parse([]byte(input)) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_provider_disabled.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // NodeDisabledProvider represents a provider that is disabled. A disabled 8 | // provider does nothing. It exists to properly set inheritance information 9 | // for child providers. 10 | type NodeDisabledProvider struct { 11 | *NodeAbstractProvider 12 | } 13 | 14 | func (n *NodeDisabledProvider) Name() string { 15 | return fmt.Sprintf("%s (disabled)", n.NodeAbstractProvider.Name()) 16 | } 17 | 18 | // GraphNodeEvalable 19 | func (n *NodeDisabledProvider) EvalTree() EvalNode { 20 | var resourceConfig *ResourceConfig 21 | return &EvalSequence{ 22 | Nodes: []EvalNode{ 23 | &EvalInterpolate{ 24 | Config: n.ProviderConfig(), 25 | Output: &resourceConfig, 26 | }, 27 | &EvalBuildProviderConfig{ 28 | Provider: n.ProviderName(), 29 | Config: &resourceConfig, 30 | Output: &resourceConfig, 31 | }, 32 | &EvalSetProviderConfig{ 33 | Provider: n.ProviderName(), 34 | Config: &resourceConfig, 35 | }, 36 | }, 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/decompress_bzip2.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "compress/bzip2" 5 | "fmt" 6 | "io" 7 | "os" 8 | "path/filepath" 9 | ) 10 | 11 | // Bzip2Decompressor is an implementation of Decompressor that can 12 | // decompress bz2 files. 13 | type Bzip2Decompressor struct{} 14 | 15 | func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool) error { 16 | // Directory isn't supported at all 17 | if dir { 18 | return fmt.Errorf("bzip2-compressed files can only unarchive to a single file") 19 | } 20 | 21 | // If we're going into a directory we should make that first 22 | if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { 23 | return err 24 | } 25 | 26 | // File first 27 | f, err := os.Open(src) 28 | if err != nil { 29 | return err 30 | } 31 | defer f.Close() 32 | 33 | // Bzip2 compression is second 34 | bzipR := bzip2.NewReader(f) 35 | 36 | // Copy it out 37 | dstF, err := os.Create(dst) 38 | if err != nil { 39 | return err 40 | } 41 | defer dstF.Close() 42 | 43 | _, err = io.Copy(dstF, bzipR) 44 | return err 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/context_graph_type.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | //go:generate stringer -type=GraphType context_graph_type.go 4 | 5 | // GraphType is an enum of the type of graph to create with a Context. 6 | // The values of the constants may change so they shouldn't be depended on; 7 | // always use the constant name. 8 | type GraphType byte 9 | 10 | const ( 11 | GraphTypeInvalid GraphType = 0 12 | GraphTypeLegacy GraphType = iota 13 | GraphTypeRefresh 14 | GraphTypePlan 15 | GraphTypePlanDestroy 16 | GraphTypeApply 17 | GraphTypeInput 18 | GraphTypeValidate 19 | ) 20 | 21 | // GraphTypeMap is a mapping of human-readable string to GraphType. This 22 | // is useful to use as the mechanism for human input for configurable 23 | // graph types. 24 | var GraphTypeMap = map[string]GraphType{ 25 | "apply": GraphTypeApply, 26 | "input": GraphTypeInput, 27 | "plan": GraphTypePlan, 28 | "plan-destroy": GraphTypePlanDestroy, 29 | "refresh": GraphTypeRefresh, 30 | "legacy": GraphTypeLegacy, 31 | "validate": GraphTypeValidate, 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/decompress.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | // Decompressor defines the interface that must be implemented to add 4 | // support for decompressing a type. 5 | type Decompressor interface { 6 | // Decompress should decompress src to dst. dir specifies whether dst 7 | // is a directory or single file. src is guaranteed to be a single file 8 | // that exists. dst is not guaranteed to exist already. 9 | Decompress(dst, src string, dir bool) error 10 | } 11 | 12 | // Decompressors is the mapping of extension to the Decompressor implementation 13 | // that will decompress that extension/type. 14 | var Decompressors map[string]Decompressor 15 | 16 | func init() { 17 | tbzDecompressor := new(TarBzip2Decompressor) 18 | tgzDecompressor := new(TarGzipDecompressor) 19 | 20 | Decompressors = map[string]Decompressor{ 21 | "bz2": new(Bzip2Decompressor), 22 | "gz": new(GzipDecompressor), 23 | "tar.bz2": tbzDecompressor, 24 | "tar.gz": tgzDecompressor, 25 | "tbz2": tbzDecompressor, 26 | "tgz": tgzDecompressor, 27 | "zip": new(ZipDecompressor), 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/schema/getsource_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=getSource resource_data_get_source.go"; DO NOT EDIT. 2 | 3 | package schema 4 | 5 | import "fmt" 6 | 7 | const ( 8 | _getSource_name_0 = "getSourceStategetSourceConfig" 9 | _getSource_name_1 = "getSourceDiff" 10 | _getSource_name_2 = "getSourceSet" 11 | _getSource_name_3 = "getSourceLevelMaskgetSourceExact" 12 | ) 13 | 14 | var ( 15 | _getSource_index_0 = [...]uint8{0, 14, 29} 16 | _getSource_index_1 = [...]uint8{0, 13} 17 | _getSource_index_2 = [...]uint8{0, 12} 18 | _getSource_index_3 = [...]uint8{0, 18, 32} 19 | ) 20 | 21 | func (i getSource) String() string { 22 | switch { 23 | case 1 <= i && i <= 2: 24 | i -= 1 25 | return _getSource_name_0[_getSource_index_0[i]:_getSource_index_0[i+1]] 26 | case i == 4: 27 | return _getSource_name_1 28 | case i == 8: 29 | return _getSource_name_2 30 | case 15 <= i && i <= 16: 31 | i -= 15 32 | return _getSource_name_3[_getSource_index_3[i]:_getSource_index_3[i+1]] 33 | default: 34 | return fmt.Sprintf("getSource(%d)", i) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/evaltype_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=EvalType eval_type.go"; DO NOT EDIT 2 | 3 | package hil 4 | 5 | import "fmt" 6 | 7 | const ( 8 | _EvalType_name_0 = "TypeInvalid" 9 | _EvalType_name_1 = "TypeString" 10 | _EvalType_name_2 = "TypeBool" 11 | _EvalType_name_3 = "TypeList" 12 | _EvalType_name_4 = "TypeMap" 13 | _EvalType_name_5 = "TypeUnknown" 14 | ) 15 | 16 | var ( 17 | _EvalType_index_0 = [...]uint8{0, 11} 18 | _EvalType_index_1 = [...]uint8{0, 10} 19 | _EvalType_index_2 = [...]uint8{0, 8} 20 | _EvalType_index_3 = [...]uint8{0, 8} 21 | _EvalType_index_4 = [...]uint8{0, 7} 22 | _EvalType_index_5 = [...]uint8{0, 11} 23 | ) 24 | 25 | func (i EvalType) String() string { 26 | switch { 27 | case i == 0: 28 | return _EvalType_name_0 29 | case i == 2: 30 | return _EvalType_name_1 31 | case i == 4: 32 | return _EvalType_name_2 33 | case i == 8: 34 | return _EvalType_name_3 35 | case i == 16: 36 | return _EvalType_name_4 37 | case i == 32: 38 | return _EvalType_name_5 39 | default: 40 | return fmt.Sprintf("EvalType(%d)", i) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/version.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/go-version" 7 | ) 8 | 9 | // The main version number that is being run at the moment. 10 | const Version = "0.9.3" 11 | 12 | // A pre-release marker for the version. If this is "" (empty string) 13 | // then it means that it is a final release. Otherwise, this is a pre-release 14 | // such as "dev" (in development), "beta", "rc1", etc. 15 | const VersionPrerelease = "" 16 | 17 | // SemVersion is an instance of version.Version. This has the secondary 18 | // benefit of verifying during tests and init time that our version is a 19 | // proper semantic version, which should always be the case. 20 | var SemVersion = version.Must(version.NewVersion(Version)) 21 | 22 | // VersionHeader is the header name used to send the current terraform version 23 | // in http requests. 24 | const VersionHeader = "Terraform-Version" 25 | 26 | func VersionString() string { 27 | if VersionPrerelease != "" { 28 | return fmt.Sprintf("%s-%s", Version, VersionPrerelease) 29 | } 30 | return Version 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html 7 | package curve25519 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Erik van Brakel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/content_md5.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/base64" 6 | "io" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | ) 11 | 12 | // contentMD5 computes and sets the HTTP Content-MD5 header for requests that 13 | // require it. 14 | func contentMD5(r *request.Request) { 15 | h := md5.New() 16 | 17 | // hash the body. seek back to the first position after reading to reset 18 | // the body for transmission. copy errors may be assumed to be from the 19 | // body. 20 | _, err := io.Copy(h, r.Body) 21 | if err != nil { 22 | r.Error = awserr.New("ContentMD5", "failed to read body", err) 23 | return 24 | } 25 | _, err = r.Body.Seek(0, 0) 26 | if err != nil { 27 | r.Error = awserr.New("ContentMD5", "failed to seek body", err) 28 | return 29 | } 30 | 31 | // encode the md5 checksum in base64 and set the request header. 32 | sum := h.Sum(nil) 33 | sum64 := make([]byte, base64.StdEncoding.EncodedLen(len(sum))) 34 | base64.StdEncoding.Encode(sum64, sum) 35 | r.HTTPRequest.Header.Set("Content-MD5", string(sum64)) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/apparentlymart/go-cidr/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Martin Atkins 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/decompress_gzip.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "compress/gzip" 5 | "fmt" 6 | "io" 7 | "os" 8 | "path/filepath" 9 | ) 10 | 11 | // GzipDecompressor is an implementation of Decompressor that can 12 | // decompress bz2 files. 13 | type GzipDecompressor struct{} 14 | 15 | func (d *GzipDecompressor) Decompress(dst, src string, dir bool) error { 16 | // Directory isn't supported at all 17 | if dir { 18 | return fmt.Errorf("gzip-compressed files can only unarchive to a single file") 19 | } 20 | 21 | // If we're going into a directory we should make that first 22 | if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { 23 | return err 24 | } 25 | 26 | // File first 27 | f, err := os.Open(src) 28 | if err != nil { 29 | return err 30 | } 31 | defer f.Close() 32 | 33 | // gzip compression is second 34 | gzipR, err := gzip.NewReader(f) 35 | if err != nil { 36 | return err 37 | } 38 | defer gzipR.Close() 39 | 40 | // Copy it out 41 | dstF, err := os.Create(dst) 42 | if err != nil { 43 | return err 44 | } 45 | defer dstF.Close() 46 | 47 | _, err = io.Copy(dstF, gzipR) 48 | return err 49 | } 50 | -------------------------------------------------------------------------------- /docs/r/sumologic_collector.md: -------------------------------------------------------------------------------- 1 | # sumologic_collector 2 | Provides a [Sumologic (Hosted) Collector][1]. 3 | 4 | ## Example Usage 5 | ```hcl 6 | resource "sumologic_collector" "collector" { 7 | name = "my-collector" 8 | description = "Just testing this" 9 | } 10 | ``` 11 | 12 | ## Argument reference 13 | The following arguments are supported: 14 | - `name` - (Required) The name of the collector. This is required, and has to be unique. Changing this will force recreation the collector. 15 | - `description` - (Optional) The description of the collector. 16 | - `category` - (Optional) The default source category for any source attached to this collector. Can be overridden in the configuration of said sources. 17 | - `timezone` - (Optional) The time zone to use for this collector. The value follows the [tzdata][2] naming convention. 18 | 19 | ## Attributes reference 20 | The following attributes are exported: 21 | - `id` - The internal ID of the collector. This can be used to attach sources to the collector. 22 | 23 | [Back to Index][0] 24 | 25 | [0]: ../README.md 26 | [1]: https://help.sumologic.com/Send_Data/Hosted_Collectors 27 | [2]: https://en.wikipedia.org/wiki/Tz_database -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/append.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Append is a helper function that will append more errors 4 | // onto an Error in order to create a larger multi-error. 5 | // 6 | // If err is not a multierror.Error, then it will be turned into 7 | // one. If any of the errs are multierr.Error, they will be flattened 8 | // one level into err. 9 | func Append(err error, errs ...error) *Error { 10 | switch err := err.(type) { 11 | case *Error: 12 | // Typed nils can reach here, so initialize if we are nil 13 | if err == nil { 14 | err = new(Error) 15 | } 16 | 17 | // Go through each error and flatten 18 | for _, e := range errs { 19 | switch e := e.(type) { 20 | case *Error: 21 | if e != nil { 22 | err.Errors = append(err.Errors, e.Errors...) 23 | } 24 | default: 25 | if e != nil { 26 | err.Errors = append(err.Errors, e) 27 | } 28 | } 29 | } 30 | 31 | return err 32 | default: 33 | newErrs := make([]error, 0, len(errs)+1) 34 | if err != nil { 35 | newErrs = append(newErrs, err) 36 | } 37 | newErrs = append(newErrs, errs...) 38 | 39 | return Append(&Error{}, newErrs...) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/logutils/README.md: -------------------------------------------------------------------------------- 1 | # logutils 2 | 3 | logutils is a Go package that augments the standard library "log" package 4 | to make logging a bit more modern, without fragmenting the Go ecosystem 5 | with new logging packages. 6 | 7 | ## The simplest thing that could possibly work 8 | 9 | Presumably your application already uses the default `log` package. To switch, you'll want your code to look like the following: 10 | 11 | ```go 12 | package main 13 | 14 | import ( 15 | "log" 16 | "os" 17 | 18 | "github.com/hashicorp/logutils" 19 | ) 20 | 21 | func main() { 22 | filter := &logutils.LevelFilter{ 23 | Levels: []logutils.LogLevel{"DEBUG", "WARN", "ERROR"}, 24 | MinLevel: logutils.LogLevel("WARN"), 25 | Writer: os.Stderr, 26 | } 27 | log.SetOutput(filter) 28 | 29 | log.Print("[DEBUG] Debugging") // this will not print 30 | log.Print("[WARN] Warning") // this will 31 | log.Print("[ERROR] Erring") // and so will this 32 | log.Print("Message I haven't updated") // and so will this 33 | } 34 | ``` 35 | 36 | This logs to standard error exactly like go's standard logger. Any log messages you haven't converted to have a level will continue to print as before. 37 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_import_provider.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // ImportProviderValidateTransformer is a GraphTransformer that goes through 9 | // the providers in the graph and validates that they only depend on variables. 10 | type ImportProviderValidateTransformer struct{} 11 | 12 | func (t *ImportProviderValidateTransformer) Transform(g *Graph) error { 13 | for _, v := range g.Vertices() { 14 | // We only care about providers 15 | pv, ok := v.(GraphNodeProvider) 16 | if !ok { 17 | continue 18 | } 19 | 20 | // We only care about providers that reference things 21 | rn, ok := pv.(GraphNodeReferencer) 22 | if !ok { 23 | continue 24 | } 25 | 26 | for _, ref := range rn.References() { 27 | if !strings.HasPrefix(ref, "var.") { 28 | return fmt.Errorf( 29 | "Provider %q depends on non-var %q. Providers for import can currently\n"+ 30 | "only depend on variables or must be hardcoded. You can stop import\n"+ 31 | "from loading configurations by specifying `-config=\"\"`.", 32 | pv.ProviderName(), ref) 33 | } 34 | } 35 | } 36 | 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/parse.go: -------------------------------------------------------------------------------- 1 | package hil 2 | 3 | import ( 4 | "github.com/hashicorp/hil/ast" 5 | "github.com/hashicorp/hil/parser" 6 | "github.com/hashicorp/hil/scanner" 7 | ) 8 | 9 | // Parse parses the given program and returns an executable AST tree. 10 | // 11 | // Syntax errors are returned with error having the dynamic type 12 | // *parser.ParseError, which gives the caller access to the source position 13 | // where the error was found, which allows (for example) combining it with 14 | // a known source filename to add context to the error message. 15 | func Parse(v string) (ast.Node, error) { 16 | return ParseWithPosition(v, ast.Pos{Line: 1, Column: 1}) 17 | } 18 | 19 | // ParseWithPosition is like Parse except that it overrides the source 20 | // row and column position of the first character in the string, which should 21 | // be 1-based. 22 | // 23 | // This can be used when HIL is embedded in another language and the outer 24 | // parser knows the row and column where the HIL expression started within 25 | // the overall source file. 26 | func ParseWithPosition(v string, pos ast.Pos) (ast.Node, error) { 27 | ch := scanner.Scan(v, pos) 28 | return parser.Parse(ch) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/reflectwalk/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/copystructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/hashstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/doc.go: -------------------------------------------------------------------------------- 1 | // Package cleanhttp offers convenience utilities for acquiring "clean" 2 | // http.Transport and http.Client structs. 3 | // 4 | // Values set on http.DefaultClient and http.DefaultTransport affect all 5 | // callers. This can have detrimental effects, esepcially in TLS contexts, 6 | // where client or root certificates set to talk to multiple endpoints can end 7 | // up displacing each other, leading to hard-to-debug issues. This package 8 | // provides non-shared http.Client and http.Transport structs to ensure that 9 | // the configuration will not be overwritten by other parts of the application 10 | // or dependencies. 11 | // 12 | // The DefaultClient and DefaultTransport functions disable idle connections 13 | // and keepalives. Without ensuring that idle connections are closed before 14 | // garbage collection, short-term clients/transports can leak file descriptors, 15 | // eventually leading to "too many open files" errors. If you will be 16 | // connecting to the same hosts repeatedly from the same client, you can use 17 | // DefaultPooledClient to receive a client that has connection pooling 18 | // semantics similar to http.DefaultClient. 19 | // 20 | package cleanhttp 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/provisioner_enums.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // ProvisionerWhen is an enum for valid values for when to run provisioners. 4 | type ProvisionerWhen int 5 | 6 | const ( 7 | ProvisionerWhenInvalid ProvisionerWhen = iota 8 | ProvisionerWhenCreate 9 | ProvisionerWhenDestroy 10 | ) 11 | 12 | var provisionerWhenStrs = map[ProvisionerWhen]string{ 13 | ProvisionerWhenInvalid: "invalid", 14 | ProvisionerWhenCreate: "create", 15 | ProvisionerWhenDestroy: "destroy", 16 | } 17 | 18 | func (v ProvisionerWhen) String() string { 19 | return provisionerWhenStrs[v] 20 | } 21 | 22 | // ProvisionerOnFailure is an enum for valid values for on_failure options 23 | // for provisioners. 24 | type ProvisionerOnFailure int 25 | 26 | const ( 27 | ProvisionerOnFailureInvalid ProvisionerOnFailure = iota 28 | ProvisionerOnFailureContinue 29 | ProvisionerOnFailureFail 30 | ) 31 | 32 | var provisionerOnFailureStrs = map[ProvisionerOnFailure]string{ 33 | ProvisionerOnFailureInvalid: "invalid", 34 | ProvisionerOnFailureContinue: "continue", 35 | ProvisionerOnFailureFail: "fail", 36 | } 37 | 38 | func (v ProvisionerOnFailure) String() string { 39 | return provisionerOnFailureStrs[v] 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CMD = jpgo 3 | 4 | help: 5 | @echo "Please use \`make ' where is one of" 6 | @echo " test to run all the tests" 7 | @echo " build to build the library and jp executable" 8 | @echo " generate to run codegen" 9 | 10 | 11 | generate: 12 | go generate ./... 13 | 14 | build: 15 | rm -f $(CMD) 16 | go build ./... 17 | rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./... 18 | mv cmd/$(CMD)/$(CMD) . 19 | 20 | test: 21 | go test -v ./... 22 | 23 | check: 24 | go vet ./... 25 | @echo "golint ./..." 26 | @lint=`golint ./...`; \ 27 | lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \ 28 | echo "$$lint"; \ 29 | if [ "$$lint" != "" ]; then exit 1; fi 30 | 31 | htmlc: 32 | go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov 33 | 34 | buildfuzz: 35 | go-fuzz-build github.com/jmespath/go-jmespath/fuzz 36 | 37 | fuzz: buildfuzz 38 | go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata 39 | 40 | bench: 41 | go test -bench . -cpuprofile cpu.out 42 | 43 | pprof-cpu: 44 | go tool pprof ./go-jmespath.test ./cpu.out 45 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/helper/url/url_windows.go: -------------------------------------------------------------------------------- 1 | package url 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "path/filepath" 7 | "strings" 8 | ) 9 | 10 | func parse(rawURL string) (*url.URL, error) { 11 | // Make sure we're using "/" since URLs are "/"-based. 12 | rawURL = filepath.ToSlash(rawURL) 13 | 14 | u, err := url.Parse(rawURL) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | if len(rawURL) > 1 && rawURL[1] == ':' { 20 | // Assume we're dealing with a drive letter file path where the drive 21 | // letter has been parsed into the URL Scheme, and the rest of the path 22 | // has been parsed into the URL Path without the leading ':' character. 23 | u.Path = fmt.Sprintf("%s:%s", string(rawURL[0]), u.Path) 24 | u.Scheme = "" 25 | } 26 | 27 | if len(u.Host) > 1 && u.Host[1] == ':' && strings.HasPrefix(rawURL, "file://") { 28 | // Assume we're dealing with a drive letter file path where the drive 29 | // letter has been parsed into the URL Host. 30 | u.Path = fmt.Sprintf("%s%s", u.Host, u.Path) 31 | u.Host = "" 32 | } 33 | 34 | // Remove leading slash for absolute file paths. 35 | if len(u.Path) > 2 && u.Path[0] == '/' && u.Path[2] == ':' { 36 | u.Path = u.Path[1:] 37 | } 38 | 39 | return u, err 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/config_tree.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // configTree represents a tree of configurations where the root is the 4 | // first file and its children are the configurations it has imported. 5 | type configTree struct { 6 | Path string 7 | Config *Config 8 | Children []*configTree 9 | } 10 | 11 | // Flatten flattens the entire tree down to a single merged Config 12 | // structure. 13 | func (t *configTree) Flatten() (*Config, error) { 14 | // No children is easy: we're already merged! 15 | if len(t.Children) == 0 { 16 | return t.Config, nil 17 | } 18 | 19 | // Depth-first, merge all the children first. 20 | childConfigs := make([]*Config, len(t.Children)) 21 | for i, ct := range t.Children { 22 | c, err := ct.Flatten() 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | childConfigs[i] = c 28 | } 29 | 30 | // Merge all the children in order 31 | config := childConfigs[0] 32 | childConfigs = childConfigs[1:] 33 | for _, config2 := range childConfigs { 34 | var err error 35 | config, err = Merge(config, config2) 36 | if err != nil { 37 | return nil, err 38 | } 39 | } 40 | 41 | // Merge the final merged child config with our own 42 | return Merge(config, t.Config) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/graph_builder_validate.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/dag" 5 | ) 6 | 7 | // ValidateGraphBuilder creates the graph for the validate operation. 8 | // 9 | // ValidateGraphBuilder is based on the PlanGraphBuilder. We do this so that 10 | // we only have to validate what we'd normally plan anyways. The 11 | // PlanGraphBuilder given will be modified so it shouldn't be used for anything 12 | // else after calling this function. 13 | func ValidateGraphBuilder(p *PlanGraphBuilder) GraphBuilder { 14 | // We're going to customize the concrete functions 15 | p.CustomConcrete = true 16 | 17 | // Set the provider to the normal provider. This will ask for input. 18 | p.ConcreteProvider = func(a *NodeAbstractProvider) dag.Vertex { 19 | return &NodeApplyableProvider{ 20 | NodeAbstractProvider: a, 21 | } 22 | } 23 | 24 | p.ConcreteResource = func(a *NodeAbstractResource) dag.Vertex { 25 | return &NodeValidatableResource{ 26 | NodeAbstractCountResource: &NodeAbstractCountResource{ 27 | NodeAbstractResource: a, 28 | }, 29 | } 30 | } 31 | 32 | // We purposely don't set any other concrete types since they don't 33 | // require validation. 34 | 35 | return p 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/bgentry/go-netrc/LICENSE: -------------------------------------------------------------------------------- 1 | Original version Copyright © 2010 Fazlul Shahriar . Newer 2 | portions Copyright © 2014 Blake Gentry . 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/get_mock.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "net/url" 5 | ) 6 | 7 | // MockGetter is an implementation of Getter that can be used for tests. 8 | type MockGetter struct { 9 | // Proxy, if set, will be called after recording the calls below. 10 | // If it isn't set, then the *Err values will be returned. 11 | Proxy Getter 12 | 13 | GetCalled bool 14 | GetDst string 15 | GetURL *url.URL 16 | GetErr error 17 | 18 | GetFileCalled bool 19 | GetFileDst string 20 | GetFileURL *url.URL 21 | GetFileErr error 22 | } 23 | 24 | func (g *MockGetter) Get(dst string, u *url.URL) error { 25 | g.GetCalled = true 26 | g.GetDst = dst 27 | g.GetURL = u 28 | 29 | if g.Proxy != nil { 30 | return g.Proxy.Get(dst, u) 31 | } 32 | 33 | return g.GetErr 34 | } 35 | 36 | func (g *MockGetter) GetFile(dst string, u *url.URL) error { 37 | g.GetFileCalled = true 38 | g.GetFileDst = dst 39 | g.GetFileURL = u 40 | 41 | if g.Proxy != nil { 42 | return g.Proxy.GetFile(dst, u) 43 | } 44 | return g.GetFileErr 45 | } 46 | 47 | func (g *MockGetter) ClientMode(u *url.URL) (ClientMode, error) { 48 | if l := len(u.Path); l > 0 && u.Path[l-1:] == "/" { 49 | return ClientModeDir, nil 50 | } 51 | return ClientModeFile, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/plugin/ui_input.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "net/rpc" 5 | 6 | "github.com/hashicorp/go-plugin" 7 | "github.com/hashicorp/terraform/terraform" 8 | ) 9 | 10 | // UIInput is an implementatin of terraform.UIInput that communicates 11 | // over RPC. 12 | type UIInput struct { 13 | Client *rpc.Client 14 | } 15 | 16 | func (i *UIInput) Input(opts *terraform.InputOpts) (string, error) { 17 | var resp UIInputInputResponse 18 | err := i.Client.Call("Plugin.Input", opts, &resp) 19 | if err != nil { 20 | return "", err 21 | } 22 | if resp.Error != nil { 23 | err = resp.Error 24 | return "", err 25 | } 26 | 27 | return resp.Value, nil 28 | } 29 | 30 | type UIInputInputResponse struct { 31 | Value string 32 | Error *plugin.BasicError 33 | } 34 | 35 | // UIInputServer is a net/rpc compatible structure for serving 36 | // a UIInputServer. This should not be used directly. 37 | type UIInputServer struct { 38 | UIInput terraform.UIInput 39 | } 40 | 41 | func (s *UIInputServer) Input( 42 | opts *terraform.InputOpts, 43 | reply *UIInputInputResponse) error { 44 | value, err := s.UIInput.Input(opts) 45 | *reply = UIInputInputResponse{ 46 | Value: value, 47 | Error: plugin.NewBasicError(err), 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/resource/id.go: -------------------------------------------------------------------------------- 1 | package resource 2 | 3 | import ( 4 | "crypto/rand" 5 | "fmt" 6 | "math/big" 7 | "sync" 8 | ) 9 | 10 | const UniqueIdPrefix = `terraform-` 11 | 12 | // idCounter is a randomly seeded monotonic counter for generating ordered 13 | // unique ids. It uses a big.Int so we can easily increment a long numeric 14 | // string. The max possible hex value here with 12 random bytes is 15 | // "01000000000000000000000000", so there's no chance of rollover during 16 | // operation. 17 | var idMutex sync.Mutex 18 | var idCounter = big.NewInt(0).SetBytes(randomBytes(12)) 19 | 20 | // Helper for a resource to generate a unique identifier w/ default prefix 21 | func UniqueId() string { 22 | return PrefixedUniqueId(UniqueIdPrefix) 23 | } 24 | 25 | // Helper for a resource to generate a unique identifier w/ given prefix 26 | // 27 | // After the prefix, the ID consists of an incrementing 26 digit value (to match 28 | // previous timestamp output). 29 | func PrefixedUniqueId(prefix string) string { 30 | idMutex.Lock() 31 | defer idMutex.Unlock() 32 | return fmt.Sprintf("%s%026x", prefix, idCounter.Add(idCounter, big.NewInt(1))) 33 | } 34 | 35 | func randomBytes(n int) []byte { 36 | b := make([]byte, n) 37 | rand.Read(b) 38 | return b 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_provisioner.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | ) 8 | 9 | // NodeProvisioner represents a provider that has no associated operations. 10 | // It registers all the common interfaces across operations for providers. 11 | type NodeProvisioner struct { 12 | NameValue string 13 | PathValue []string 14 | 15 | // The fields below will be automatically set using the Attach 16 | // interfaces if you're running those transforms, but also be explicitly 17 | // set if you already have that information. 18 | 19 | Config *config.ProviderConfig 20 | } 21 | 22 | func (n *NodeProvisioner) Name() string { 23 | result := fmt.Sprintf("provisioner.%s", n.NameValue) 24 | if len(n.PathValue) > 1 { 25 | result = fmt.Sprintf("%s.%s", modulePrefixStr(n.PathValue), result) 26 | } 27 | 28 | return result 29 | } 30 | 31 | // GraphNodeSubPath 32 | func (n *NodeProvisioner) Path() []string { 33 | return n.PathValue 34 | } 35 | 36 | // GraphNodeProvisioner 37 | func (n *NodeProvisioner) ProvisionerName() string { 38 | return n.NameValue 39 | } 40 | 41 | // GraphNodeEvalable impl. 42 | func (n *NodeProvisioner) EvalTree() EvalNode { 43 | return &EvalInitProvisioner{Name: n.NameValue} 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_check_prevent_destroy.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/config" 7 | ) 8 | 9 | // EvalPreventDestroy is an EvalNode implementation that returns an 10 | // error if a resource has PreventDestroy configured and the diff 11 | // would destroy the resource. 12 | type EvalCheckPreventDestroy struct { 13 | Resource *config.Resource 14 | ResourceId string 15 | Diff **InstanceDiff 16 | } 17 | 18 | func (n *EvalCheckPreventDestroy) Eval(ctx EvalContext) (interface{}, error) { 19 | if n.Diff == nil || *n.Diff == nil || n.Resource == nil { 20 | return nil, nil 21 | } 22 | 23 | diff := *n.Diff 24 | preventDestroy := n.Resource.Lifecycle.PreventDestroy 25 | 26 | if diff.GetDestroy() && preventDestroy { 27 | resourceId := n.ResourceId 28 | if resourceId == "" { 29 | resourceId = n.Resource.Id() 30 | } 31 | 32 | return nil, fmt.Errorf(preventDestroyErrStr, resourceId) 33 | } 34 | 35 | return nil, nil 36 | } 37 | 38 | const preventDestroyErrStr = `%s: the plan would destroy this resource, but it currently has lifecycle.prevent_destroy set to true. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or adjust the scope of the plan using the -target flag.` 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_vertex.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/dag" 7 | ) 8 | 9 | // VertexTransformer is a GraphTransformer that transforms vertices 10 | // using the GraphVertexTransformers. The Transforms are run in sequential 11 | // order. If a transform replaces a vertex then the next transform will see 12 | // the new vertex. 13 | type VertexTransformer struct { 14 | Transforms []GraphVertexTransformer 15 | } 16 | 17 | func (t *VertexTransformer) Transform(g *Graph) error { 18 | for _, v := range g.Vertices() { 19 | for _, vt := range t.Transforms { 20 | newV, err := vt.Transform(v) 21 | if err != nil { 22 | return err 23 | } 24 | 25 | // If the vertex didn't change, then don't do anything more 26 | if newV == v { 27 | continue 28 | } 29 | 30 | // Vertex changed, replace it within the graph 31 | if ok := g.Replace(v, newV); !ok { 32 | // This should never happen, big problem 33 | return fmt.Errorf( 34 | "Failed to replace %s with %s!\n\nSource: %#v\n\nTarget: %#v", 35 | dag.VertexName(v), dag.VertexName(newV), v, newV) 36 | } 37 | 38 | // Replace v so that future transforms use the proper vertex 39 | v = newV 40 | } 41 | } 42 | 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "io/ioutil" 5 | "regexp" 6 | 7 | "github.com/aws/aws-sdk-go/aws" 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/awsutil" 10 | "github.com/aws/aws-sdk-go/aws/request" 11 | ) 12 | 13 | var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) 14 | 15 | func buildGetBucketLocation(r *request.Request) { 16 | if r.DataFilled() { 17 | out := r.Data.(*GetBucketLocationOutput) 18 | b, err := ioutil.ReadAll(r.HTTPResponse.Body) 19 | if err != nil { 20 | r.Error = awserr.New("SerializationError", "failed reading response body", err) 21 | return 22 | } 23 | 24 | match := reBucketLocation.FindSubmatch(b) 25 | if len(match) > 1 { 26 | loc := string(match[1]) 27 | out.LocationConstraint = &loc 28 | } 29 | } 30 | } 31 | 32 | func populateLocationConstraint(r *request.Request) { 33 | if r.ParamsFilled() && aws.StringValue(r.Config.Region) != "us-east-1" { 34 | in := r.Params.(*CreateBucketInput) 35 | if in.CreateBucketConfiguration == nil { 36 | r.Params = awsutil.CopyOf(r.Params) 37 | in = r.Params.(*CreateBucketInput) 38 | in.CreateBucketConfiguration = &CreateBucketConfiguration{ 39 | LocationConstraint: r.Config.Region, 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "reflect" 4 | 5 | // PayloadMember returns the payload field member of i if there is one, or nil. 6 | func PayloadMember(i interface{}) interface{} { 7 | if i == nil { 8 | return nil 9 | } 10 | 11 | v := reflect.ValueOf(i).Elem() 12 | if !v.IsValid() { 13 | return nil 14 | } 15 | if field, ok := v.Type().FieldByName("_"); ok { 16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 17 | field, _ := v.Type().FieldByName(payloadName) 18 | if field.Tag.Get("type") != "structure" { 19 | return nil 20 | } 21 | 22 | payload := v.FieldByName(payloadName) 23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { 24 | return payload.Interface() 25 | } 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | // PayloadType returns the type of a payload field member of i if there is one, or "". 32 | func PayloadType(i interface{}) string { 33 | v := reflect.Indirect(reflect.ValueOf(i)) 34 | if !v.IsValid() { 35 | return "" 36 | } 37 | if field, ok := v.Type().FieldByName("_"); ok { 38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 39 | if member, ok := v.Type().FieldByName(payloadName); ok { 40 | return member.Tag.Get("type") 41 | } 42 | } 43 | } 44 | return "" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/sse.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/base64" 6 | 7 | "github.com/aws/aws-sdk-go/aws/awserr" 8 | "github.com/aws/aws-sdk-go/aws/awsutil" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | ) 11 | 12 | var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) 13 | 14 | func validateSSERequiresSSL(r *request.Request) { 15 | if r.HTTPRequest.URL.Scheme != "https" { 16 | p, _ := awsutil.ValuesAtPath(r.Params, "SSECustomerKey||CopySourceSSECustomerKey") 17 | if len(p) > 0 { 18 | r.Error = errSSERequiresSSL 19 | } 20 | } 21 | } 22 | 23 | func computeSSEKeys(r *request.Request) { 24 | headers := []string{ 25 | "x-amz-server-side-encryption-customer-key", 26 | "x-amz-copy-source-server-side-encryption-customer-key", 27 | } 28 | 29 | for _, h := range headers { 30 | md5h := h + "-md5" 31 | if key := r.HTTPRequest.Header.Get(h); key != "" { 32 | // Base64-encode the value 33 | b64v := base64.StdEncoding.EncodeToString([]byte(key)) 34 | r.HTTPRequest.Header.Set(h, b64v) 35 | 36 | // Add MD5 if it wasn't computed 37 | if r.HTTPRequest.Header.Get(md5h) == "" { 38 | sum := md5.Sum([]byte(key)) 39 | b64sum := base64.StdEncoding.EncodeToString(sum[:]) 40 | r.HTTPRequest.Header.Set(md5h, b64sum) 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/type_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Type"; DO NOT EDIT 2 | 3 | package ast 4 | 5 | import "fmt" 6 | 7 | const ( 8 | _Type_name_0 = "TypeInvalid" 9 | _Type_name_1 = "TypeAny" 10 | _Type_name_2 = "TypeBool" 11 | _Type_name_3 = "TypeString" 12 | _Type_name_4 = "TypeInt" 13 | _Type_name_5 = "TypeFloat" 14 | _Type_name_6 = "TypeList" 15 | _Type_name_7 = "TypeMap" 16 | _Type_name_8 = "TypeUnknown" 17 | ) 18 | 19 | var ( 20 | _Type_index_0 = [...]uint8{0, 11} 21 | _Type_index_1 = [...]uint8{0, 7} 22 | _Type_index_2 = [...]uint8{0, 8} 23 | _Type_index_3 = [...]uint8{0, 10} 24 | _Type_index_4 = [...]uint8{0, 7} 25 | _Type_index_5 = [...]uint8{0, 9} 26 | _Type_index_6 = [...]uint8{0, 8} 27 | _Type_index_7 = [...]uint8{0, 7} 28 | _Type_index_8 = [...]uint8{0, 11} 29 | ) 30 | 31 | func (i Type) String() string { 32 | switch { 33 | case i == 0: 34 | return _Type_name_0 35 | case i == 2: 36 | return _Type_name_1 37 | case i == 4: 38 | return _Type_name_2 39 | case i == 8: 40 | return _Type_name_3 41 | case i == 16: 42 | return _Type_name_4 43 | case i == 32: 44 | return _Type_name_5 45 | case i == 64: 46 | return _Type_name_6 47 | case i == 128: 48 | return _Type_name_7 49 | case i == 256: 50 | return _Type_name_8 51 | default: 52 | return fmt.Sprintf("Type(%d)", i) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_refresh.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | ) 7 | 8 | // EvalRefresh is an EvalNode implementation that does a refresh for 9 | // a resource. 10 | type EvalRefresh struct { 11 | Provider *ResourceProvider 12 | State **InstanceState 13 | Info *InstanceInfo 14 | Output **InstanceState 15 | } 16 | 17 | // TODO: test 18 | func (n *EvalRefresh) Eval(ctx EvalContext) (interface{}, error) { 19 | provider := *n.Provider 20 | state := *n.State 21 | 22 | // If we have no state, we don't do any refreshing 23 | if state == nil { 24 | log.Printf("[DEBUG] refresh: %s: no state, not refreshing", n.Info.Id) 25 | return nil, nil 26 | } 27 | 28 | // Call pre-refresh hook 29 | err := ctx.Hook(func(h Hook) (HookAction, error) { 30 | return h.PreRefresh(n.Info, state) 31 | }) 32 | if err != nil { 33 | return nil, err 34 | } 35 | 36 | // Refresh! 37 | state, err = provider.Refresh(n.Info, state) 38 | if err != nil { 39 | return nil, fmt.Errorf("%s: %s", n.Info.Id, err.Error()) 40 | } 41 | 42 | // Call post-refresh hook 43 | err = ctx.Hook(func(h Hook) (HookAction, error) { 44 | return h.PostRefresh(n.Info, state) 45 | }) 46 | if err != nil { 47 | return nil, err 48 | } 49 | 50 | if n.Output != nil { 51 | *n.Output = state 52 | } 53 | 54 | return nil, nil 55 | } 56 | -------------------------------------------------------------------------------- /docs/r/sumologic_cloudsyslog_source.md: -------------------------------------------------------------------------------- 1 | # sumologic_cloudsyslog_source 2 | 3 | Provides a [Sumologic Cloud Syslog source][1]. 4 | 5 | __IMPORTANT:__ The token is stored in plain-text in the state. This is a potential security issue. 6 | 7 | ## Example Usage 8 | ```hcl 9 | resource "sumologic_cloudsyslog_source" "cloudsyslog_source" { 10 | name = "CLOUDSYSLOG" 11 | category = "my/source/category" 12 | collector_id = "${sumologic_collector.collector.id}" 13 | } 14 | 15 | resource "sumologic_collector" "collector" { 16 | name = "my-collector" 17 | description = "Just testing this" 18 | } 19 | ``` 20 | 21 | ## Argument reference 22 | 23 | The following arguments are supported: 24 | - `name` - (Required) The name of the source. This is required, and has to be unique in the scope of the collector. Changing this will force recreation the source. 25 | - `collector_id` - (Required) The ID of the collector to attach this source to. 26 | - `category` - (Optional) The source category this source logs to. 27 | 28 | ## Attributes reference 29 | 30 | The following attributes are exported: 31 | - `id` - The internal ID of the source. 32 | - `token` - The token to use for sending data to this source. 33 | 34 | [Back to Index][0] 35 | 36 | [0]: ../README.md 37 | [1]: https://help.sumologic.com/Send_Data/Sources/02Sources_for_Hosted_Collectors/Cloud_Syslog_Source 38 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_resource_count.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/dag" 7 | ) 8 | 9 | // ResourceCountTransformer is a GraphTransformer that expands the count 10 | // out for a specific resource. 11 | // 12 | // This assumes that the count is already interpolated. 13 | type ResourceCountTransformer struct { 14 | Concrete ConcreteResourceNodeFunc 15 | 16 | Count int 17 | Addr *ResourceAddress 18 | } 19 | 20 | func (t *ResourceCountTransformer) Transform(g *Graph) error { 21 | // Don't allow the count to be negative 22 | if t.Count < 0 { 23 | return fmt.Errorf("negative count: %d", t.Count) 24 | } 25 | 26 | // For each count, build and add the node 27 | for i := 0; i < t.Count; i++ { 28 | // Set the index. If our count is 1 we special case it so that 29 | // we handle the "resource.0" and "resource" boundary properly. 30 | index := i 31 | if t.Count == 1 { 32 | index = -1 33 | } 34 | 35 | // Build the resource address 36 | addr := t.Addr.Copy() 37 | addr.Index = index 38 | 39 | // Build the abstract node and the concrete one 40 | abstract := &NodeAbstractResource{Addr: addr} 41 | var node dag.Vertex = abstract 42 | if f := t.Concrete; f != nil { 43 | node = f(abstract) 44 | } 45 | 46 | // Add it to the graph 47 | g.Add(node) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/config/module/tree_gob.go: -------------------------------------------------------------------------------- 1 | package module 2 | 3 | import ( 4 | "bytes" 5 | "encoding/gob" 6 | 7 | "github.com/hashicorp/terraform/config" 8 | ) 9 | 10 | func (t *Tree) GobDecode(bs []byte) error { 11 | t.lock.Lock() 12 | defer t.lock.Unlock() 13 | 14 | // Decode the gob data 15 | var data treeGob 16 | dec := gob.NewDecoder(bytes.NewReader(bs)) 17 | if err := dec.Decode(&data); err != nil { 18 | return err 19 | } 20 | 21 | // Set the fields 22 | t.name = data.Name 23 | t.config = data.Config 24 | t.children = data.Children 25 | t.path = data.Path 26 | 27 | return nil 28 | } 29 | 30 | func (t *Tree) GobEncode() ([]byte, error) { 31 | data := &treeGob{ 32 | Config: t.config, 33 | Children: t.children, 34 | Name: t.name, 35 | Path: t.path, 36 | } 37 | 38 | var buf bytes.Buffer 39 | enc := gob.NewEncoder(&buf) 40 | if err := enc.Encode(data); err != nil { 41 | return nil, err 42 | } 43 | 44 | return buf.Bytes(), nil 45 | } 46 | 47 | // treeGob is used as a structure to Gob encode a tree. 48 | // 49 | // This structure is private so it can't be referenced but the fields are 50 | // public, allowing Gob to properly encode this. When we decode this, we are 51 | // able to turn it into a Tree. 52 | type treeGob struct { 53 | Config *config.Config 54 | Children map[string]*Tree 55 | Name string 56 | Path []string 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go: -------------------------------------------------------------------------------- 1 | // Package query provides serialization of AWS query requests, and responses. 2 | package query 3 | 4 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go 5 | 6 | import ( 7 | "net/url" 8 | 9 | "github.com/aws/aws-sdk-go/aws/awserr" 10 | "github.com/aws/aws-sdk-go/aws/request" 11 | "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" 12 | ) 13 | 14 | // BuildHandler is a named request handler for building query protocol requests 15 | var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} 16 | 17 | // Build builds a request for an AWS Query service. 18 | func Build(r *request.Request) { 19 | body := url.Values{ 20 | "Action": {r.Operation.Name}, 21 | "Version": {r.ClientInfo.APIVersion}, 22 | } 23 | if err := queryutil.Parse(body, r.Params, false); err != nil { 24 | r.Error = awserr.New("SerializationError", "failed encoding Query request", err) 25 | return 26 | } 27 | 28 | if r.ExpireTime == 0 { 29 | r.HTTPRequest.Method = "POST" 30 | r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") 31 | r.SetBufferBody([]byte(body.Encode())) 32 | } else { // This is a pre-signed request 33 | r.HTTPRequest.Method = "GET" 34 | r.HTTPRequest.URL.RawQuery = body.Encode() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_provisioner.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // EvalInitProvisioner is an EvalNode implementation that initializes a provisioner 8 | // and returns nothing. The provisioner can be retrieved again with the 9 | // EvalGetProvisioner node. 10 | type EvalInitProvisioner struct { 11 | Name string 12 | } 13 | 14 | func (n *EvalInitProvisioner) Eval(ctx EvalContext) (interface{}, error) { 15 | return ctx.InitProvisioner(n.Name) 16 | } 17 | 18 | // EvalCloseProvisioner is an EvalNode implementation that closes provisioner 19 | // connections that aren't needed anymore. 20 | type EvalCloseProvisioner struct { 21 | Name string 22 | } 23 | 24 | func (n *EvalCloseProvisioner) Eval(ctx EvalContext) (interface{}, error) { 25 | ctx.CloseProvisioner(n.Name) 26 | return nil, nil 27 | } 28 | 29 | // EvalGetProvisioner is an EvalNode implementation that retrieves an already 30 | // initialized provisioner instance for the given name. 31 | type EvalGetProvisioner struct { 32 | Name string 33 | Output *ResourceProvisioner 34 | } 35 | 36 | func (n *EvalGetProvisioner) Eval(ctx EvalContext) (interface{}, error) { 37 | result := ctx.Provisioner(n.Name) 38 | if result == nil { 39 | return nil, fmt.Errorf("provisioner %s not initialized", n.Name) 40 | } 41 | 42 | if n.Output != nil { 43 | *n.Output = result 44 | } 45 | 46 | return result, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/shadow.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // Shadow is the interface that any "shadow" structures must implement. 4 | // 5 | // A shadow structure is an interface implementation (typically) that 6 | // shadows a real implementation and verifies that the same behavior occurs 7 | // on both. The semantics of this behavior are up to the interface itself. 8 | // 9 | // A shadow NEVER modifies real values or state. It must always be safe to use. 10 | // 11 | // For example, a ResourceProvider shadow ensures that the same operations 12 | // are done on the same resources with the same configurations. 13 | // 14 | // The typical usage of a shadow following this interface is to complete 15 | // the real operations, then call CloseShadow which tells the shadow that 16 | // the real side is done. Then, once the shadow is also complete, call 17 | // ShadowError to find any errors that may have been caught. 18 | type Shadow interface { 19 | // CloseShadow tells the shadow that the REAL implementation is 20 | // complete. Therefore, any calls that would block should now return 21 | // immediately since no more changes will happen to the real side. 22 | CloseShadow() error 23 | 24 | // ShadowError returns the errors that the shadow has found. 25 | // This should be called AFTER CloseShadow and AFTER the shadow is 26 | // known to be complete (no more calls to it). 27 | ShadowError() error 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/parser/binary_op.go: -------------------------------------------------------------------------------- 1 | package parser 2 | 3 | import ( 4 | "github.com/hashicorp/hil/ast" 5 | "github.com/hashicorp/hil/scanner" 6 | ) 7 | 8 | var binaryOps []map[scanner.TokenType]ast.ArithmeticOp 9 | 10 | func init() { 11 | // This operation table maps from the operator's scanner token type 12 | // to the AST arithmetic operation. All expressions produced from 13 | // binary operators are *ast.Arithmetic nodes. 14 | // 15 | // Binary operator groups are listed in order of precedence, with 16 | // the *lowest* precedence first. Operators within the same group 17 | // have left-to-right associativity. 18 | binaryOps = []map[scanner.TokenType]ast.ArithmeticOp{ 19 | { 20 | scanner.OR: ast.ArithmeticOpLogicalOr, 21 | }, 22 | { 23 | scanner.AND: ast.ArithmeticOpLogicalAnd, 24 | }, 25 | { 26 | scanner.EQUAL: ast.ArithmeticOpEqual, 27 | scanner.NOTEQUAL: ast.ArithmeticOpNotEqual, 28 | }, 29 | { 30 | scanner.GT: ast.ArithmeticOpGreaterThan, 31 | scanner.GTE: ast.ArithmeticOpGreaterThanOrEqual, 32 | scanner.LT: ast.ArithmeticOpLessThan, 33 | scanner.LTE: ast.ArithmeticOpLessThanOrEqual, 34 | }, 35 | { 36 | scanner.PLUS: ast.ArithmeticOpAdd, 37 | scanner.MINUS: ast.ArithmeticOpSub, 38 | }, 39 | { 40 | scanner.STAR: ast.ArithmeticOpMul, 41 | scanner.SLASH: ast.ArithmeticOpDiv, 42 | scanner.PERCENT: ast.ArithmeticOpMod, 43 | }, 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_filter_operation.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // EvalNodeOpFilterable is an interface that EvalNodes can implement 4 | // to be filterable by the operation that is being run on Terraform. 5 | type EvalNodeOpFilterable interface { 6 | IncludeInOp(walkOperation) bool 7 | } 8 | 9 | // EvalNodeFilterOp returns a filter function that filters nodes that 10 | // include themselves in specific operations. 11 | func EvalNodeFilterOp(op walkOperation) EvalNodeFilterFunc { 12 | return func(n EvalNode) EvalNode { 13 | include := true 14 | if of, ok := n.(EvalNodeOpFilterable); ok { 15 | include = of.IncludeInOp(op) 16 | } 17 | if include { 18 | return n 19 | } 20 | 21 | return EvalNoop{} 22 | } 23 | } 24 | 25 | // EvalOpFilter is an EvalNode implementation that is a proxy to 26 | // another node but filters based on the operation. 27 | type EvalOpFilter struct { 28 | // Ops is the list of operations to include this node in. 29 | Ops []walkOperation 30 | 31 | // Node is the node to execute 32 | Node EvalNode 33 | } 34 | 35 | // TODO: test 36 | func (n *EvalOpFilter) Eval(ctx EvalContext) (interface{}, error) { 37 | return EvalRaw(n.Node, ctx) 38 | } 39 | 40 | // EvalNodeOpFilterable impl. 41 | func (n *EvalOpFilter) IncludeInOp(op walkOperation) bool { 42 | for _, v := range n.Ops { 43 | if v == op { 44 | return true 45 | } 46 | } 47 | 48 | return false 49 | } 50 | -------------------------------------------------------------------------------- /provider/resource_sumologic_polling_source_test.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "testing" 5 | "github.com/hashicorp/terraform/helper/resource" 6 | "os" 7 | ) 8 | 9 | func TestAccSumologicPollingSource(t *testing.T) { 10 | resource.Test(t, resource.TestCase{ 11 | Providers: testAccProviders, 12 | Steps: []resource.TestStep { 13 | { 14 | Config: testAccSumologicPollingSourceConfig, 15 | Check: resource.ComposeTestCheckFunc( 16 | resource.TestCheckResourceAttrSet("sumologic_polling_source.s3_audit", "content_type"), 17 | ), 18 | }, 19 | }}) 20 | } 21 | 22 | var accessKey,_ = os.LookupEnv("AWS_ACCESS_KEY_ID") 23 | var secretKey,_ = os.LookupEnv("AWS_SECRET_ACCESS_KEY") 24 | 25 | var testAccSumologicPollingSourceConfig = ` 26 | resource "sumologic_collector" "AWS" { 27 | name = "AWS2" 28 | description = "AWS logs" 29 | category = "category" 30 | } 31 | 32 | resource "sumologic_polling_source" "s3_audit" { 33 | collector_id = "${sumologic_collector.AWS.id}" 34 | name = "Amazon S3 Audit" 35 | category = "some/category" 36 | content_type = "AwsS3AuditBucket" 37 | scan_interval = 1000 38 | paused = false 39 | 40 | authentication { 41 | access_key = "` + accessKey + `" 42 | secret_key = "` + secretKey + `" 43 | } 44 | 45 | path { 46 | bucket_name = "terraform-sumologic-testing-a39dj4f850f" 47 | path_expression = "*" 48 | } 49 | } 50 | ` 51 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/openpgp/canonical_text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import "hash" 8 | 9 | // NewCanonicalTextHash reformats text written to it into the canonical 10 | // form and then applies the hash h. See RFC 4880, section 5.2.1. 11 | func NewCanonicalTextHash(h hash.Hash) hash.Hash { 12 | return &canonicalTextHash{h, 0} 13 | } 14 | 15 | type canonicalTextHash struct { 16 | h hash.Hash 17 | s int 18 | } 19 | 20 | var newline = []byte{'\r', '\n'} 21 | 22 | func (cth *canonicalTextHash) Write(buf []byte) (int, error) { 23 | start := 0 24 | 25 | for i, c := range buf { 26 | switch cth.s { 27 | case 0: 28 | if c == '\r' { 29 | cth.s = 1 30 | } else if c == '\n' { 31 | cth.h.Write(buf[start:i]) 32 | cth.h.Write(newline) 33 | start = i + 1 34 | } 35 | case 1: 36 | cth.s = 0 37 | } 38 | } 39 | 40 | cth.h.Write(buf[start:]) 41 | return len(buf), nil 42 | } 43 | 44 | func (cth *canonicalTextHash) Sum(in []byte) []byte { 45 | return cth.h.Sum(in) 46 | } 47 | 48 | func (cth *canonicalTextHash) Reset() { 49 | cth.h.Reset() 50 | cth.s = 0 51 | } 52 | 53 | func (cth *canonicalTextHash) Size() int { 54 | return cth.h.Size() 55 | } 56 | 57 | func (cth *canonicalTextHash) BlockSize() int { 58 | return cth.h.BlockSize() 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/json/token/position.go: -------------------------------------------------------------------------------- 1 | package token 2 | 3 | import "fmt" 4 | 5 | // Pos describes an arbitrary source position 6 | // including the file, line, and column location. 7 | // A Position is valid if the line number is > 0. 8 | type Pos struct { 9 | Filename string // filename, if any 10 | Offset int // offset, starting at 0 11 | Line int // line number, starting at 1 12 | Column int // column number, starting at 1 (character count) 13 | } 14 | 15 | // IsValid returns true if the position is valid. 16 | func (p *Pos) IsValid() bool { return p.Line > 0 } 17 | 18 | // String returns a string in one of several forms: 19 | // 20 | // file:line:column valid position with file name 21 | // line:column valid position without file name 22 | // file invalid position with file name 23 | // - invalid position without file name 24 | func (p Pos) String() string { 25 | s := p.Filename 26 | if p.IsValid() { 27 | if s != "" { 28 | s += ":" 29 | } 30 | s += fmt.Sprintf("%d:%d", p.Line, p.Column) 31 | } 32 | if s == "" { 33 | s = "-" 34 | } 35 | return s 36 | } 37 | 38 | // Before reports whether the position p is before u. 39 | func (p Pos) Before(u Pos) bool { 40 | return u.Offset > p.Offset || u.Line > p.Line 41 | } 42 | 43 | // After reports whether the position p is after u. 44 | func (p Pos) After(u Pos) bool { 45 | return u.Offset < p.Offset || u.Line < p.Line 46 | } 47 | -------------------------------------------------------------------------------- /provider/provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/helper/schema" 5 | "github.com/hashicorp/terraform/terraform" 6 | 7 | "os" 8 | 9 | sumo "github.com/erikvanbrakel/terraform-provider-sumologic/go-sumologic" 10 | ) 11 | 12 | func Provider() terraform.ResourceProvider { 13 | return &schema.Provider{ 14 | Schema: map[string]*schema.Schema{ 15 | "access_id": { 16 | Type: schema.TypeString, 17 | Optional: true, 18 | Default: os.Getenv("SL_ACCESSID"), 19 | }, 20 | "access_key": { 21 | Type: schema.TypeString, 22 | Optional: true, 23 | Default: os.Getenv("SL_ACCESSKEY"), 24 | }, 25 | "environment": { 26 | Type: schema.TypeString, 27 | Optional: true, 28 | Default: "eu", 29 | }, 30 | }, 31 | ResourcesMap: map[string]*schema.Resource{ 32 | "sumologic_collector": resourceSumologicCollector(), 33 | "sumologic_http_source": resourceSumologicHttpSource(), 34 | "sumologic_polling_source": resourceSumologicPollingSource(), 35 | "sumologic_cloudsyslog_source": resourceSumologicCloudsyslogSource(), 36 | }, 37 | ConfigureFunc: providerConfigure, 38 | } 39 | } 40 | 41 | func providerConfigure(d *schema.ResourceData) (interface{}, error) { 42 | return sumo.NewClient( 43 | d.Get("access_id").(string), 44 | d.Get("access_key").(string), 45 | d.Get("environment").(string), 46 | ) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_provider_disable.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/terraform/dag" 7 | ) 8 | 9 | // DisableProviderTransformer "disables" any providers that are not actually 10 | // used by anything. This avoids the provider being initialized and configured. 11 | // This both saves resources but also avoids errors since configuration 12 | // may imply initialization which may require auth. 13 | type DisableProviderTransformer struct{} 14 | 15 | func (t *DisableProviderTransformer) Transform(g *Graph) error { 16 | for _, v := range g.Vertices() { 17 | // We only care about providers 18 | pn, ok := v.(GraphNodeProvider) 19 | if !ok || pn.ProviderName() == "" { 20 | continue 21 | } 22 | 23 | // If we have dependencies, then don't disable 24 | if g.UpEdges(v).Len() > 0 { 25 | continue 26 | } 27 | 28 | // Get the path 29 | var path []string 30 | if pn, ok := v.(GraphNodeSubPath); ok { 31 | path = pn.Path() 32 | } 33 | 34 | // Disable the provider by replacing it with a "disabled" provider 35 | disabled := &NodeDisabledProvider{ 36 | NodeAbstractProvider: &NodeAbstractProvider{ 37 | NameValue: pn.ProviderName(), 38 | PathValue: path, 39 | }, 40 | } 41 | 42 | if !g.Replace(v, disabled) { 43 | panic(fmt.Sprintf( 44 | "vertex disappeared from under us: %s", 45 | dag.VertexName(v))) 46 | } 47 | } 48 | 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /docs/r/sumologic_http_source.md: -------------------------------------------------------------------------------- 1 | # sumologic_http_source 2 | Provides a [Sumologic HTTP source][1]. 3 | 4 | __IMPORTANT:__ The endpoint is stored in plain-text in the state. This is a potential security issue. 5 | 6 | ## Example Usage 7 | ```hcl 8 | resource "sumologic_http_source" "http_source" { 9 | name = "HTTP" 10 | messagePerRequest = true 11 | category = "my/source/category" 12 | collector_id = "${sumologic_collector.collector.id}" 13 | } 14 | 15 | resource "sumologic_collector" "collector" { 16 | name = "my-collector" 17 | description = "Just testing this" 18 | } 19 | ``` 20 | 21 | ## Argument reference 22 | The following arguments are supported: 23 | - `name` - (Required) The name of the source. This is required, and has to be unique in the scope of the collector. Changing this will force recreation the source. 24 | - `collector_id` - (Required) The ID of the collector to attach this source to. 25 | - `category` - (Optional) The source category this source logs to. 26 | - `messagePerRequest` - (Optional) When set to `true`, will create one log message per HTTP request. 27 | 28 | ## Attributes reference 29 | The following attributes are exported: 30 | - `id` - The internal ID of the source. 31 | - `url` - The HTTP endpoint to use for sending data to this source. 32 | 33 | [Back to Index][0] 34 | 35 | [0]: ../README.md 36 | [1]: https://help.sumologic.com/Send_Data/Sources/02Sources_for_Hosted_Collectors/HTTP_Source 37 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_resource_plan_destroy.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // NodePlanDestroyableResource represents a resource that is "applyable": 4 | // it is ready to be applied and is represented by a diff. 5 | type NodePlanDestroyableResource struct { 6 | *NodeAbstractResource 7 | } 8 | 9 | // GraphNodeDestroyer 10 | func (n *NodePlanDestroyableResource) DestroyAddr() *ResourceAddress { 11 | return n.Addr 12 | } 13 | 14 | // GraphNodeEvalable 15 | func (n *NodePlanDestroyableResource) EvalTree() EvalNode { 16 | addr := n.NodeAbstractResource.Addr 17 | 18 | // stateId is the ID to put into the state 19 | stateId := addr.stateId() 20 | 21 | // Build the instance info. More of this will be populated during eval 22 | info := &InstanceInfo{ 23 | Id: stateId, 24 | Type: addr.Type, 25 | } 26 | 27 | // Declare a bunch of variables that are used for state during 28 | // evaluation. Most of this are written to by-address below. 29 | var diff *InstanceDiff 30 | var state *InstanceState 31 | 32 | return &EvalSequence{ 33 | Nodes: []EvalNode{ 34 | &EvalReadState{ 35 | Name: stateId, 36 | Output: &state, 37 | }, 38 | &EvalDiffDestroy{ 39 | Info: info, 40 | State: &state, 41 | Output: &diff, 42 | }, 43 | &EvalCheckPreventDestroy{ 44 | Resource: n.Config, 45 | Diff: &diff, 46 | }, 47 | &EvalWriteDiff{ 48 | Name: stateId, 49 | Diff: &diff, 50 | }, 51 | }, 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go 4 | 5 | import ( 6 | "encoding/xml" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" 11 | ) 12 | 13 | // UnmarshalHandler is a named request handler for unmarshaling query protocol requests 14 | var UnmarshalHandler = request.NamedHandler{Name: "awssdk.query.Unmarshal", Fn: Unmarshal} 15 | 16 | // UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata 17 | var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalMeta", Fn: UnmarshalMeta} 18 | 19 | // Unmarshal unmarshals a response for an AWS Query service. 20 | func Unmarshal(r *request.Request) { 21 | defer r.HTTPResponse.Body.Close() 22 | if r.DataFilled() { 23 | decoder := xml.NewDecoder(r.HTTPResponse.Body) 24 | err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") 25 | if err != nil { 26 | r.Error = awserr.New("SerializationError", "failed decoding Query response", err) 27 | return 28 | } 29 | } 30 | } 31 | 32 | // UnmarshalMeta unmarshals header response values for an AWS Query service. 33 | func UnmarshalMeta(r *request.Request) { 34 | r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/yamux/addr.go: -------------------------------------------------------------------------------- 1 | package yamux 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // hasAddr is used to get the address from the underlying connection 9 | type hasAddr interface { 10 | LocalAddr() net.Addr 11 | RemoteAddr() net.Addr 12 | } 13 | 14 | // yamuxAddr is used when we cannot get the underlying address 15 | type yamuxAddr struct { 16 | Addr string 17 | } 18 | 19 | func (*yamuxAddr) Network() string { 20 | return "yamux" 21 | } 22 | 23 | func (y *yamuxAddr) String() string { 24 | return fmt.Sprintf("yamux:%s", y.Addr) 25 | } 26 | 27 | // Addr is used to get the address of the listener. 28 | func (s *Session) Addr() net.Addr { 29 | return s.LocalAddr() 30 | } 31 | 32 | // LocalAddr is used to get the local address of the 33 | // underlying connection. 34 | func (s *Session) LocalAddr() net.Addr { 35 | addr, ok := s.conn.(hasAddr) 36 | if !ok { 37 | return &yamuxAddr{"local"} 38 | } 39 | return addr.LocalAddr() 40 | } 41 | 42 | // RemoteAddr is used to get the address of remote end 43 | // of the underlying connection 44 | func (s *Session) RemoteAddr() net.Addr { 45 | addr, ok := s.conn.(hasAddr) 46 | if !ok { 47 | return &yamuxAddr{"remote"} 48 | } 49 | return addr.RemoteAddr() 50 | } 51 | 52 | // LocalAddr returns the local address 53 | func (s *Stream) LocalAddr() net.Addr { 54 | return s.session.LocalAddr() 55 | } 56 | 57 | // LocalAddr returns the remote address 58 | func (s *Stream) RemoteAddr() net.Addr { 59 | return s.session.RemoteAddr() 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | ) 7 | 8 | // offsetReader is a thread-safe io.ReadCloser to prevent racing 9 | // with retrying requests 10 | type offsetReader struct { 11 | buf io.ReadSeeker 12 | lock sync.Mutex 13 | closed bool 14 | } 15 | 16 | func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { 17 | reader := &offsetReader{} 18 | buf.Seek(offset, 0) 19 | 20 | reader.buf = buf 21 | return reader 22 | } 23 | 24 | // Close will close the instance of the offset reader's access to 25 | // the underlying io.ReadSeeker. 26 | func (o *offsetReader) Close() error { 27 | o.lock.Lock() 28 | defer o.lock.Unlock() 29 | o.closed = true 30 | return nil 31 | } 32 | 33 | // Read is a thread-safe read of the underlying io.ReadSeeker 34 | func (o *offsetReader) Read(p []byte) (int, error) { 35 | o.lock.Lock() 36 | defer o.lock.Unlock() 37 | 38 | if o.closed { 39 | return 0, io.EOF 40 | } 41 | 42 | return o.buf.Read(p) 43 | } 44 | 45 | // Seek is a thread-safe seeking operation. 46 | func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { 47 | o.lock.Lock() 48 | defer o.lock.Unlock() 49 | 50 | return o.buf.Seek(offset, whence) 51 | } 52 | 53 | // CloseAndCopy will return a new offsetReader with a copy of the old buffer 54 | // and close the old buffer. 55 | func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { 56 | o.Close() 57 | return newOffsetReader(o.buf, offset) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/multierror.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Error is an error type to track multiple errors. This is used to 8 | // accumulate errors in cases and return them as a single "error". 9 | type Error struct { 10 | Errors []error 11 | ErrorFormat ErrorFormatFunc 12 | } 13 | 14 | func (e *Error) Error() string { 15 | fn := e.ErrorFormat 16 | if fn == nil { 17 | fn = ListFormatFunc 18 | } 19 | 20 | return fn(e.Errors) 21 | } 22 | 23 | // ErrorOrNil returns an error interface if this Error represents 24 | // a list of errors, or returns nil if the list of errors is empty. This 25 | // function is useful at the end of accumulation to make sure that the value 26 | // returned represents the existence of errors. 27 | func (e *Error) ErrorOrNil() error { 28 | if e == nil { 29 | return nil 30 | } 31 | if len(e.Errors) == 0 { 32 | return nil 33 | } 34 | 35 | return e 36 | } 37 | 38 | func (e *Error) GoString() string { 39 | return fmt.Sprintf("*%#v", *e) 40 | } 41 | 42 | // WrappedErrors returns the list of errors that this Error is wrapping. 43 | // It is an implementatin of the errwrap.Wrapper interface so that 44 | // multierror.Error can be used with that library. 45 | // 46 | // This method is not safe to be called concurrently and is no different 47 | // than accessing the Errors field directly. It is implementd only to 48 | // satisfy the errwrap.Wrapper interface. 49 | func (e *Error) WrappedErrors() []error { 50 | return e.Errors 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hcl/hcl/ast/walk.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "fmt" 4 | 5 | // WalkFunc describes a function to be called for each node during a Walk. The 6 | // returned node can be used to rewrite the AST. Walking stops the returned 7 | // bool is false. 8 | type WalkFunc func(Node) (Node, bool) 9 | 10 | // Walk traverses an AST in depth-first order: It starts by calling fn(node); 11 | // node must not be nil. If fn returns true, Walk invokes fn recursively for 12 | // each of the non-nil children of node, followed by a call of fn(nil). The 13 | // returned node of fn can be used to rewrite the passed node to fn. 14 | func Walk(node Node, fn WalkFunc) Node { 15 | rewritten, ok := fn(node) 16 | if !ok { 17 | return rewritten 18 | } 19 | 20 | switch n := node.(type) { 21 | case *File: 22 | n.Node = Walk(n.Node, fn) 23 | case *ObjectList: 24 | for i, item := range n.Items { 25 | n.Items[i] = Walk(item, fn).(*ObjectItem) 26 | } 27 | case *ObjectKey: 28 | // nothing to do 29 | case *ObjectItem: 30 | for i, k := range n.Keys { 31 | n.Keys[i] = Walk(k, fn).(*ObjectKey) 32 | } 33 | 34 | if n.Val != nil { 35 | n.Val = Walk(n.Val, fn) 36 | } 37 | case *LiteralType: 38 | // nothing to do 39 | case *ListType: 40 | for i, l := range n.List { 41 | n.List[i] = Walk(l, fn) 42 | } 43 | case *ObjectType: 44 | n.List = Walk(n.List, fn).(*ObjectList) 45 | default: 46 | // should we panic here? 47 | fmt.Printf("unknown type: %T\n", n) 48 | } 49 | 50 | fn(nil) 51 | return rewritten 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/encryption/encryption.go: -------------------------------------------------------------------------------- 1 | package encryption 2 | 3 | import ( 4 | "encoding/base64" 5 | "fmt" 6 | "strings" 7 | 8 | "github.com/hashicorp/errwrap" 9 | "github.com/hashicorp/vault/helper/pgpkeys" 10 | ) 11 | 12 | // RetrieveGPGKey returns the PGP key specified as the pgpKey parameter, or queries 13 | // the public key from the keybase service if the parameter is a keybase username 14 | // prefixed with the phrase "keybase:" 15 | func RetrieveGPGKey(pgpKey string) (string, error) { 16 | const keybasePrefix = "keybase:" 17 | 18 | encryptionKey := pgpKey 19 | if strings.HasPrefix(pgpKey, keybasePrefix) { 20 | publicKeys, err := pgpkeys.FetchKeybasePubkeys([]string{pgpKey}) 21 | if err != nil { 22 | return "", errwrap.Wrapf(fmt.Sprintf("Error retrieving Public Key for %s: {{err}}", pgpKey), err) 23 | } 24 | encryptionKey = publicKeys[pgpKey] 25 | } 26 | 27 | return encryptionKey, nil 28 | } 29 | 30 | // EncryptValue encrypts the given value with the given encryption key. Description 31 | // should be set such that errors return a meaningful user-facing response. 32 | func EncryptValue(encryptionKey, value, description string) (string, string, error) { 33 | fingerprints, encryptedValue, err := 34 | pgpkeys.EncryptShares([][]byte{[]byte(value)}, []string{encryptionKey}) 35 | if err != nil { 36 | return "", "", errwrap.Wrapf(fmt.Sprintf("Error encrypting %s: {{err}}", description), err) 37 | } 38 | 39 | return fingerprints[0], base64.StdEncoding.EncodeToString(encryptedValue[0]), nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/node_resource_plan_orphan.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | // NodePlannableResourceOrphan represents a resource that is "applyable": 4 | // it is ready to be applied and is represented by a diff. 5 | type NodePlannableResourceOrphan struct { 6 | *NodeAbstractResource 7 | } 8 | 9 | func (n *NodePlannableResourceOrphan) Name() string { 10 | return n.NodeAbstractResource.Name() + " (orphan)" 11 | } 12 | 13 | // GraphNodeEvalable 14 | func (n *NodePlannableResourceOrphan) EvalTree() EvalNode { 15 | addr := n.NodeAbstractResource.Addr 16 | 17 | // stateId is the ID to put into the state 18 | stateId := addr.stateId() 19 | 20 | // Build the instance info. More of this will be populated during eval 21 | info := &InstanceInfo{ 22 | Id: stateId, 23 | Type: addr.Type, 24 | ModulePath: normalizeModulePath(addr.Path), 25 | } 26 | 27 | // Declare a bunch of variables that are used for state during 28 | // evaluation. Most of this are written to by-address below. 29 | var diff *InstanceDiff 30 | var state *InstanceState 31 | 32 | return &EvalSequence{ 33 | Nodes: []EvalNode{ 34 | &EvalReadState{ 35 | Name: stateId, 36 | Output: &state, 37 | }, 38 | &EvalDiffDestroy{ 39 | Info: info, 40 | State: &state, 41 | Output: &diff, 42 | }, 43 | &EvalCheckPreventDestroy{ 44 | Resource: n.Config, 45 | ResourceId: stateId, 46 | Diff: &diff, 47 | }, 48 | &EvalWriteDiff{ 49 | Name: stateId, 50 | Diff: &diff, 51 | }, 52 | }, 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/README.md: -------------------------------------------------------------------------------- 1 | # cleanhttp 2 | 3 | Functions for accessing "clean" Go http.Client values 4 | 5 | ------------- 6 | 7 | The Go standard library contains a default `http.Client` called 8 | `http.DefaultClient`. It is a common idiom in Go code to start with 9 | `http.DefaultClient` and tweak it as necessary, and in fact, this is 10 | encouraged; from the `http` package documentation: 11 | 12 | > The Client's Transport typically has internal state (cached TCP connections), 13 | so Clients should be reused instead of created as needed. Clients are safe for 14 | concurrent use by multiple goroutines. 15 | 16 | Unfortunately, this is a shared value, and it is not uncommon for libraries to 17 | assume that they are free to modify it at will. With enough dependencies, it 18 | can be very easy to encounter strange problems and race conditions due to 19 | manipulation of this shared value across libraries and goroutines (clients are 20 | safe for concurrent use, but writing values to the client struct itself is not 21 | protected). 22 | 23 | Making things worse is the fact that a bare `http.Client` will use a default 24 | `http.Transport` called `http.DefaultTransport`, which is another global value 25 | that behaves the same way. So it is not simply enough to replace 26 | `http.DefaultClient` with `&http.Client{}`. 27 | 28 | This repository provides some simple functions to get a "clean" `http.Client` 29 | -- one that uses the same default values as the Go standard library, but 30 | returns a client that does not share any state with other clients. 31 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/hilmapstructure/hilmapstructure.go: -------------------------------------------------------------------------------- 1 | package hilmapstructure 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | 7 | "github.com/mitchellh/mapstructure" 8 | ) 9 | 10 | var hilMapstructureDecodeHookEmptySlice []interface{} 11 | var hilMapstructureDecodeHookStringSlice []string 12 | var hilMapstructureDecodeHookEmptyMap map[string]interface{} 13 | 14 | // WeakDecode behaves in the same way as mapstructure.WeakDecode but has a 15 | // DecodeHook which defeats the backward compatibility mode of mapstructure 16 | // which WeakDecodes []interface{}{} into an empty map[string]interface{}. This 17 | // allows us to use WeakDecode (desirable), but not fail on empty lists. 18 | func WeakDecode(m interface{}, rawVal interface{}) error { 19 | config := &mapstructure.DecoderConfig{ 20 | DecodeHook: func(source reflect.Type, target reflect.Type, val interface{}) (interface{}, error) { 21 | sliceType := reflect.TypeOf(hilMapstructureDecodeHookEmptySlice) 22 | stringSliceType := reflect.TypeOf(hilMapstructureDecodeHookStringSlice) 23 | mapType := reflect.TypeOf(hilMapstructureDecodeHookEmptyMap) 24 | 25 | if (source == sliceType || source == stringSliceType) && target == mapType { 26 | return nil, fmt.Errorf("Cannot convert a []interface{} into a map[string]interface{}") 27 | } 28 | 29 | return val, nil 30 | }, 31 | WeaklyTypedInput: true, 32 | Result: rawVal, 33 | } 34 | 35 | decoder, err := mapstructure.NewDecoder(config) 36 | if err != nil { 37 | return err 38 | } 39 | 40 | return decoder.Decode(m) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/agl/ed25519/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/keybase/go-crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-uuid/uuid.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | "crypto/rand" 5 | "encoding/hex" 6 | "fmt" 7 | ) 8 | 9 | // GenerateRandomBytes is used to generate random bytes of given size. 10 | func GenerateRandomBytes(size int) ([]byte, error) { 11 | buf := make([]byte, size) 12 | if _, err := rand.Read(buf); err != nil { 13 | return nil, fmt.Errorf("failed to read random bytes: %v", err) 14 | } 15 | return buf, nil 16 | } 17 | 18 | // GenerateUUID is used to generate a random UUID 19 | func GenerateUUID() (string, error) { 20 | buf, err := GenerateRandomBytes(16) 21 | if err != nil { 22 | return "", err 23 | } 24 | return FormatUUID(buf) 25 | } 26 | 27 | func FormatUUID(buf []byte) (string, error) { 28 | if len(buf) != 16 { 29 | return "", fmt.Errorf("wrong length byte slice (%d)", len(buf)) 30 | } 31 | 32 | return fmt.Sprintf("%08x-%04x-%04x-%04x-%12x", 33 | buf[0:4], 34 | buf[4:6], 35 | buf[6:8], 36 | buf[8:10], 37 | buf[10:16]), nil 38 | } 39 | 40 | func ParseUUID(uuid string) ([]byte, error) { 41 | if len(uuid) != 36 { 42 | return nil, fmt.Errorf("uuid string is wrong length") 43 | } 44 | 45 | hyph := []byte("-") 46 | 47 | if uuid[8] != hyph[0] || 48 | uuid[13] != hyph[0] || 49 | uuid[18] != hyph[0] || 50 | uuid[23] != hyph[0] { 51 | return nil, fmt.Errorf("uuid is improperly formatted") 52 | } 53 | 54 | hexStr := uuid[0:8] + uuid[9:13] + uuid[14:18] + uuid[19:23] + uuid[24:36] 55 | 56 | ret, err := hex.DecodeString(hexStr) 57 | if err != nil { 58 | return nil, err 59 | } 60 | if len(ret) != 16 { 61 | return nil, fmt.Errorf("decoded hex is the wrong length") 62 | } 63 | 64 | return ret, nil 65 | } 66 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/resource/resource.go: -------------------------------------------------------------------------------- 1 | package resource 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/helper/config" 5 | "github.com/hashicorp/terraform/terraform" 6 | ) 7 | 8 | type Resource struct { 9 | ConfigValidator *config.Validator 10 | Create CreateFunc 11 | Destroy DestroyFunc 12 | Diff DiffFunc 13 | Refresh RefreshFunc 14 | Update UpdateFunc 15 | } 16 | 17 | // CreateFunc is a function that creates a resource that didn't previously 18 | // exist. 19 | type CreateFunc func( 20 | *terraform.InstanceState, 21 | *terraform.InstanceDiff, 22 | interface{}) (*terraform.InstanceState, error) 23 | 24 | // DestroyFunc is a function that destroys a resource that previously 25 | // exists using the state. 26 | type DestroyFunc func( 27 | *terraform.InstanceState, 28 | interface{}) error 29 | 30 | // DiffFunc is a function that performs a diff of a resource. 31 | type DiffFunc func( 32 | *terraform.InstanceState, 33 | *terraform.ResourceConfig, 34 | interface{}) (*terraform.InstanceDiff, error) 35 | 36 | // RefreshFunc is a function that performs a refresh of a specific type 37 | // of resource. 38 | type RefreshFunc func( 39 | *terraform.InstanceState, 40 | interface{}) (*terraform.InstanceState, error) 41 | 42 | // UpdateFunc is a function that is called to update a resource that 43 | // previously existed. The difference between this and CreateFunc is that 44 | // the diff is guaranteed to only contain attributes that don't require 45 | // a new resource. 46 | type UpdateFunc func( 47 | *terraform.InstanceState, 48 | *terraform.InstanceDiff, 49 | interface{}) (*terraform.InstanceState, error) 50 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/scanner/peeker.go: -------------------------------------------------------------------------------- 1 | package scanner 2 | 3 | // Peeker is a utility that wraps a token channel returned by Scan and 4 | // provides an interface that allows a caller (e.g. the parser) to 5 | // work with the token stream in a mode that allows one token of lookahead, 6 | // and provides utilities for more convenient processing of the stream. 7 | type Peeker struct { 8 | ch <-chan *Token 9 | peeked *Token 10 | } 11 | 12 | func NewPeeker(ch <-chan *Token) *Peeker { 13 | return &Peeker{ 14 | ch: ch, 15 | } 16 | } 17 | 18 | // Peek returns the next token in the stream without consuming it. A 19 | // subsequent call to Read will return the same token. 20 | func (p *Peeker) Peek() *Token { 21 | if p.peeked == nil { 22 | p.peeked = <-p.ch 23 | } 24 | return p.peeked 25 | } 26 | 27 | // Read consumes the next token in the stream and returns it. 28 | func (p *Peeker) Read() *Token { 29 | token := p.Peek() 30 | 31 | // As a special case, we will produce the EOF token forever once 32 | // it is reached. 33 | if token.Type != EOF { 34 | p.peeked = nil 35 | } 36 | 37 | return token 38 | } 39 | 40 | // Close ensures that the token stream has been exhausted, to prevent 41 | // the goroutine in the underlying scanner from leaking. 42 | // 43 | // It's not necessary to call this if the caller reads the token stream 44 | // to EOF, since that implicitly closes the scanner. 45 | func (p *Peeker) Close() { 46 | for _ = range p.ch { 47 | // discard 48 | } 49 | // Install a synthetic EOF token in 'peeked' in case someone 50 | // erroneously calls Peek() or Read() after we've closed. 51 | p.peeked = &Token{ 52 | Type: EOF, 53 | Content: "", 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_expand.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/hashicorp/terraform/dag" 7 | ) 8 | 9 | // GraphNodeExapndable is an interface that nodes can implement to 10 | // signal that they can be expanded. Expanded nodes turn into 11 | // GraphNodeSubgraph nodes within the graph. 12 | type GraphNodeExpandable interface { 13 | Expand(GraphBuilder) (GraphNodeSubgraph, error) 14 | } 15 | 16 | // GraphNodeDynamicExpandable is an interface that nodes can implement 17 | // to signal that they can be expanded at eval-time (hence dynamic). 18 | // These nodes are given the eval context and are expected to return 19 | // a new subgraph. 20 | type GraphNodeDynamicExpandable interface { 21 | DynamicExpand(EvalContext) (*Graph, error) 22 | } 23 | 24 | // GraphNodeSubgraph is an interface a node can implement if it has 25 | // a larger subgraph that should be walked. 26 | type GraphNodeSubgraph interface { 27 | Subgraph() dag.Grapher 28 | } 29 | 30 | // ExpandTransform is a transformer that does a subgraph expansion 31 | // at graph transform time (vs. at eval time). The benefit of earlier 32 | // subgraph expansion is that errors with the graph build can be detected 33 | // at an earlier stage. 34 | type ExpandTransform struct { 35 | Builder GraphBuilder 36 | } 37 | 38 | func (t *ExpandTransform) Transform(v dag.Vertex) (dag.Vertex, error) { 39 | ev, ok := v.(GraphNodeExpandable) 40 | if !ok { 41 | // This isn't an expandable vertex, so just ignore it. 42 | return v, nil 43 | } 44 | 45 | // Expand the subgraph! 46 | log.Printf("[DEBUG] vertex %q: static expanding", dag.VertexName(ev)) 47 | return ev.Expand(t.Builder) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/helper/shadow/ordered_value.go: -------------------------------------------------------------------------------- 1 | package shadow 2 | 3 | import ( 4 | "container/list" 5 | "sync" 6 | ) 7 | 8 | // OrderedValue is a struct that keeps track of a value in the order 9 | // it is set. Each time Value() is called, it will return the most recent 10 | // calls value then discard it. 11 | // 12 | // This is unlike Value that returns the same value once it is set. 13 | type OrderedValue struct { 14 | lock sync.Mutex 15 | values *list.List 16 | waiters *list.List 17 | } 18 | 19 | // Value returns the last value that was set, or blocks until one 20 | // is received. 21 | func (w *OrderedValue) Value() interface{} { 22 | w.lock.Lock() 23 | 24 | // If we have a pending value already, use it 25 | if w.values != nil && w.values.Len() > 0 { 26 | front := w.values.Front() 27 | w.values.Remove(front) 28 | w.lock.Unlock() 29 | return front.Value 30 | } 31 | 32 | // No pending value, create a waiter 33 | if w.waiters == nil { 34 | w.waiters = list.New() 35 | } 36 | 37 | var val Value 38 | w.waiters.PushBack(&val) 39 | w.lock.Unlock() 40 | 41 | // Return the value once we have it 42 | return val.Value() 43 | } 44 | 45 | // SetValue sets the latest value. 46 | func (w *OrderedValue) SetValue(v interface{}) { 47 | w.lock.Lock() 48 | defer w.lock.Unlock() 49 | 50 | // If we have a waiter, notify it 51 | if w.waiters != nil && w.waiters.Len() > 0 { 52 | front := w.waiters.Front() 53 | w.waiters.Remove(front) 54 | 55 | val := front.Value.(*Value) 56 | val.SetValue(v) 57 | return 58 | } 59 | 60 | // Add it to the list of values 61 | if w.values == nil { 62 | w.values = list.New() 63 | } 64 | 65 | w.values.PushBack(v) 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/api.go: -------------------------------------------------------------------------------- 1 | package jmespath 2 | 3 | import "strconv" 4 | 5 | // JmesPath is the epresentation of a compiled JMES path query. A JmesPath is 6 | // safe for concurrent use by multiple goroutines. 7 | type JMESPath struct { 8 | ast ASTNode 9 | intr *treeInterpreter 10 | } 11 | 12 | // Compile parses a JMESPath expression and returns, if successful, a JMESPath 13 | // object that can be used to match against data. 14 | func Compile(expression string) (*JMESPath, error) { 15 | parser := NewParser() 16 | ast, err := parser.Parse(expression) 17 | if err != nil { 18 | return nil, err 19 | } 20 | jmespath := &JMESPath{ast: ast, intr: newInterpreter()} 21 | return jmespath, nil 22 | } 23 | 24 | // MustCompile is like Compile but panics if the expression cannot be parsed. 25 | // It simplifies safe initialization of global variables holding compiled 26 | // JMESPaths. 27 | func MustCompile(expression string) *JMESPath { 28 | jmespath, err := Compile(expression) 29 | if err != nil { 30 | panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error()) 31 | } 32 | return jmespath 33 | } 34 | 35 | // Search evaluates a JMESPath expression against input data and returns the result. 36 | func (jp *JMESPath) Search(data interface{}) (interface{}, error) { 37 | return jp.intr.Execute(jp.ast, data) 38 | } 39 | 40 | // Search evaluates a JMESPath expression against input data and returns the result. 41 | func Search(expression string, data interface{}) (interface{}, error) { 42 | intr := newInterpreter() 43 | parser := NewParser() 44 | ast, err := parser.Parse(expression) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return intr.Execute(ast, data) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/eval_count.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/config" 5 | ) 6 | 7 | // EvalCountFixZeroOneBoundary is an EvalNode that fixes up the state 8 | // when there is a resource count with zero/one boundary, i.e. fixing 9 | // a resource named "aws_instance.foo" to "aws_instance.foo.0" and vice-versa. 10 | type EvalCountFixZeroOneBoundary struct { 11 | Resource *config.Resource 12 | } 13 | 14 | // TODO: test 15 | func (n *EvalCountFixZeroOneBoundary) Eval(ctx EvalContext) (interface{}, error) { 16 | // Get the count, important for knowing whether we're supposed to 17 | // be adding the zero, or trimming it. 18 | count, err := n.Resource.Count() 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | // Figure what to look for and what to replace it with 24 | hunt := n.Resource.Id() 25 | replace := hunt + ".0" 26 | if count < 2 { 27 | hunt, replace = replace, hunt 28 | } 29 | 30 | state, lock := ctx.State() 31 | 32 | // Get a lock so we can access this instance and potentially make 33 | // changes to it. 34 | lock.Lock() 35 | defer lock.Unlock() 36 | 37 | // Look for the module state. If we don't have one, then it doesn't matter. 38 | mod := state.ModuleByPath(ctx.Path()) 39 | if mod == nil { 40 | return nil, nil 41 | } 42 | 43 | // Look for the resource state. If we don't have one, then it is okay. 44 | rs, ok := mod.Resources[hunt] 45 | if !ok { 46 | return nil, nil 47 | } 48 | 49 | // If the replacement key exists, we just keep both 50 | if _, ok := mod.Resources[replace]; ok { 51 | return nil, nil 52 | } 53 | 54 | mod.Resources[replace] = rs 55 | delete(mod.Resources, hunt) 56 | 57 | return nil, nil 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go: -------------------------------------------------------------------------------- 1 | package s3 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/aws/client" 5 | "github.com/aws/aws-sdk-go/aws/request" 6 | ) 7 | 8 | func init() { 9 | initClient = defaultInitClientFn 10 | initRequest = defaultInitRequestFn 11 | } 12 | 13 | func defaultInitClientFn(c *client.Client) { 14 | // Support building custom endpoints based on config 15 | c.Handlers.Build.PushFront(updateEndpointForS3Config) 16 | 17 | // Require SSL when using SSE keys 18 | c.Handlers.Validate.PushBack(validateSSERequiresSSL) 19 | c.Handlers.Build.PushBack(computeSSEKeys) 20 | 21 | // S3 uses custom error unmarshaling logic 22 | c.Handlers.UnmarshalError.Clear() 23 | c.Handlers.UnmarshalError.PushBack(unmarshalError) 24 | } 25 | 26 | func defaultInitRequestFn(r *request.Request) { 27 | // Add reuest handlers for specific platforms. 28 | // e.g. 100-continue support for PUT requests using Go 1.6 29 | platformRequestHandlers(r) 30 | 31 | switch r.Operation.Name { 32 | case opPutBucketCors, opPutBucketLifecycle, opPutBucketPolicy, 33 | opPutBucketTagging, opDeleteObjects, opPutBucketLifecycleConfiguration, 34 | opPutBucketReplication: 35 | // These S3 operations require Content-MD5 to be set 36 | r.Handlers.Build.PushBack(contentMD5) 37 | case opGetBucketLocation: 38 | // GetBucketLocation has custom parsing logic 39 | r.Handlers.Unmarshal.PushFront(buildGetBucketLocation) 40 | case opCreateBucket: 41 | // Auto-populate LocationConstraint with current region 42 | r.Handlers.Validate.PushFront(populateLocationConstraint) 43 | case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload: 44 | r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarhsalError) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/hil/ast/variables_helper.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "fmt" 4 | 5 | func VariableListElementTypesAreHomogenous(variableName string, list []Variable) (Type, error) { 6 | listTypes := make(map[Type]struct{}) 7 | for _, v := range list { 8 | // Allow unknown 9 | if v.Type == TypeUnknown { 10 | continue 11 | } 12 | 13 | if _, ok := listTypes[v.Type]; ok { 14 | continue 15 | } 16 | listTypes[v.Type] = struct{}{} 17 | } 18 | 19 | if len(listTypes) != 1 && len(list) != 0 { 20 | return TypeInvalid, fmt.Errorf("list %q does not have homogenous types. found %s", variableName, reportTypes(listTypes)) 21 | } 22 | 23 | if len(list) > 0 { 24 | return list[0].Type, nil 25 | } 26 | 27 | return TypeInvalid, fmt.Errorf("list %q does not have any elements so cannot determine type.", variableName) 28 | } 29 | 30 | func VariableMapValueTypesAreHomogenous(variableName string, vmap map[string]Variable) (Type, error) { 31 | valueTypes := make(map[Type]struct{}) 32 | for _, v := range vmap { 33 | // Allow unknown 34 | if v.Type == TypeUnknown { 35 | continue 36 | } 37 | 38 | if _, ok := valueTypes[v.Type]; ok { 39 | continue 40 | } 41 | 42 | valueTypes[v.Type] = struct{}{} 43 | } 44 | 45 | if len(valueTypes) != 1 && len(vmap) != 0 { 46 | return TypeInvalid, fmt.Errorf("map %q does not have homogenous value types. found %s", variableName, reportTypes(valueTypes)) 47 | } 48 | 49 | // For loop here is an easy way to get a single key, we return immediately. 50 | for _, v := range vmap { 51 | return v.Type, nil 52 | } 53 | 54 | // This means the map is empty 55 | return TypeInvalid, fmt.Errorf("map %q does not have any elements so cannot determine type.", variableName) 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform_output.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/config/module" 5 | ) 6 | 7 | // OutputTransformer is a GraphTransformer that adds all the outputs 8 | // in the configuration to the graph. 9 | // 10 | // This is done for the apply graph builder even if dependent nodes 11 | // aren't changing since there is no downside: the state will be available 12 | // even if the dependent items aren't changing. 13 | type OutputTransformer struct { 14 | Module *module.Tree 15 | } 16 | 17 | func (t *OutputTransformer) Transform(g *Graph) error { 18 | return t.transform(g, t.Module) 19 | } 20 | 21 | func (t *OutputTransformer) transform(g *Graph, m *module.Tree) error { 22 | // If no config, no outputs 23 | if m == nil { 24 | return nil 25 | } 26 | 27 | // Transform all the children. We must do this first because 28 | // we can reference module outputs and they must show up in the 29 | // reference map. 30 | for _, c := range m.Children() { 31 | if err := t.transform(g, c); err != nil { 32 | return err 33 | } 34 | } 35 | 36 | // If we have no outputs, we're done! 37 | os := m.Config().Outputs 38 | if len(os) == 0 { 39 | return nil 40 | } 41 | 42 | // Add all outputs here 43 | for _, o := range os { 44 | // Build the node. 45 | // 46 | // NOTE: For now this is just an "applyable" output. As we build 47 | // new graph builders for the other operations I suspect we'll 48 | // find a way to parameterize this, require new transforms, etc. 49 | node := &NodeApplyableOutput{ 50 | PathValue: normalizeModulePath(m.Path()), 51 | Config: o, 52 | } 53 | 54 | // Add it! 55 | g.Add(node) 56 | } 57 | 58 | return nil 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-getter/netrc.go: -------------------------------------------------------------------------------- 1 | package getter 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "os" 7 | "runtime" 8 | 9 | "github.com/bgentry/go-netrc/netrc" 10 | "github.com/mitchellh/go-homedir" 11 | ) 12 | 13 | // addAuthFromNetrc adds auth information to the URL from the user's 14 | // netrc file if it can be found. This will only add the auth info 15 | // if the URL doesn't already have auth info specified and the 16 | // the username is blank. 17 | func addAuthFromNetrc(u *url.URL) error { 18 | // If the URL already has auth information, do nothing 19 | if u.User != nil && u.User.Username() != "" { 20 | return nil 21 | } 22 | 23 | // Get the netrc file path 24 | path := os.Getenv("NETRC") 25 | if path == "" { 26 | filename := ".netrc" 27 | if runtime.GOOS == "windows" { 28 | filename = "_netrc" 29 | } 30 | 31 | var err error 32 | path, err = homedir.Expand("~/" + filename) 33 | if err != nil { 34 | return err 35 | } 36 | } 37 | 38 | // If the file is not a file, then do nothing 39 | if fi, err := os.Stat(path); err != nil { 40 | // File doesn't exist, do nothing 41 | if os.IsNotExist(err) { 42 | return nil 43 | } 44 | 45 | // Some other error! 46 | return err 47 | } else if fi.IsDir() { 48 | // File is directory, ignore 49 | return nil 50 | } 51 | 52 | // Load up the netrc file 53 | net, err := netrc.ParseFile(path) 54 | if err != nil { 55 | return fmt.Errorf("Error parsing netrc file at %q: %s", path, err) 56 | } 57 | 58 | machine := net.FindMachine(u.Host) 59 | if machine == nil { 60 | // Machine not found, no problem 61 | return nil 62 | } 63 | 64 | // Set the user info 65 | u.User = url.UserPassword(machine.Login, machine.Password) 66 | return nil 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/terraform/terraform/transform.go: -------------------------------------------------------------------------------- 1 | package terraform 2 | 3 | import ( 4 | "github.com/hashicorp/terraform/dag" 5 | ) 6 | 7 | // GraphTransformer is the interface that transformers implement. This 8 | // interface is only for transforms that need entire graph visibility. 9 | type GraphTransformer interface { 10 | Transform(*Graph) error 11 | } 12 | 13 | // GraphVertexTransformer is an interface that transforms a single 14 | // Vertex within with graph. This is a specialization of GraphTransformer 15 | // that makes it easy to do vertex replacement. 16 | // 17 | // The GraphTransformer that runs through the GraphVertexTransformers is 18 | // VertexTransformer. 19 | type GraphVertexTransformer interface { 20 | Transform(dag.Vertex) (dag.Vertex, error) 21 | } 22 | 23 | // GraphTransformIf is a helper function that conditionally returns a 24 | // GraphTransformer given. This is useful for calling inline a sequence 25 | // of transforms without having to split it up into multiple append() calls. 26 | func GraphTransformIf(f func() bool, then GraphTransformer) GraphTransformer { 27 | if f() { 28 | return then 29 | } 30 | 31 | return nil 32 | } 33 | 34 | type graphTransformerMulti struct { 35 | Transforms []GraphTransformer 36 | } 37 | 38 | func (t *graphTransformerMulti) Transform(g *Graph) error { 39 | for _, t := range t.Transforms { 40 | if err := t.Transform(g); err != nil { 41 | return err 42 | } 43 | } 44 | 45 | return nil 46 | } 47 | 48 | // GraphTransformMulti combines multiple graph transformers into a single 49 | // GraphTransformer that runs all the individual graph transformers. 50 | func GraphTransformMulti(ts ...GraphTransformer) GraphTransformer { 51 | return &graphTransformerMulti{Transforms: ts} 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/README.md: -------------------------------------------------------------------------------- 1 | # mapstructure 2 | 3 | mapstructure is a Go library for decoding generic map values to structures 4 | and vice versa, while providing helpful error handling. 5 | 6 | This library is most useful when decoding values from some data stream (JSON, 7 | Gob, etc.) where you don't _quite_ know the structure of the underlying data 8 | until you read a part of it. You can therefore read a `map[string]interface{}` 9 | and use this library to decode it into the proper underlying native Go 10 | structure. 11 | 12 | ## Installation 13 | 14 | Standard `go get`: 15 | 16 | ``` 17 | $ go get github.com/mitchellh/mapstructure 18 | ``` 19 | 20 | ## Usage & Example 21 | 22 | For usage and examples see the [Godoc](http://godoc.org/github.com/mitchellh/mapstructure). 23 | 24 | The `Decode` function has examples associated with it there. 25 | 26 | ## But Why?! 27 | 28 | Go offers fantastic standard libraries for decoding formats such as JSON. 29 | The standard method is to have a struct pre-created, and populate that struct 30 | from the bytes of the encoded format. This is great, but the problem is if 31 | you have configuration or an encoding that changes slightly depending on 32 | specific fields. For example, consider this JSON: 33 | 34 | ```json 35 | { 36 | "type": "person", 37 | "name": "Mitchell" 38 | } 39 | ``` 40 | 41 | Perhaps we can't populate a specific structure without first reading 42 | the "type" field from the JSON. We could always do two passes over the 43 | decoding of the JSON (reading the "type" first, and the rest later). 44 | However, it is much simpler to just decode this into a `map[string]interface{}` 45 | structure, read the "type" key, then use something like this library 46 | to decode it into the proper structure. 47 | --------------------------------------------------------------------------------