GithubHelp home page GithubHelp logo

nat-henderson / terraform-provider-dominos Goto Github PK

View Code? Open in Web Editor NEW
1.1K 14.0 80.0 18.33 MB

The Terraform plugin for the Dominos Pizza provider.

License: MIT License

Go 99.70% Makefile 0.30%

terraform-provider-dominos's Introduction

Terraform Provider for Dominos Pizza

Quickstart

Download bin/terraform-provider-dominos and place it on your machine at ~/.terraform.d/plugins/terraform-provider-dominos. Make sure to chmod +x it. This is the normal way to install third-party providers - follow instructions at Installing 3rd Party Plugins if you have trouble.

mkdir ~/.terraform.d/plugins && \
wget https://github.com/nat-henderson/terraform-provider-dominos/raw/master/bin/terraform-provider-dominos -O ~/.terraform.d/plugins/terraform-provider-dominos && \
chmod +x ~/.terraform.d/plugins/terraform-provider-dominos

Then write your config. Here's a sample config - a variation on this worked for me last night.

provider "dominos" {
  first_name    = "My"
  last_name     = "Name"
  email_address = "[email protected]"
  phone_number  = "15555555555"

  credit_card {
    number = 123456789101112
    cvv    = 1314
    date   = "15/16"
    zip    = 18192
  }
}

data "dominos_address" "addr" {
  street = "123 Main St"
  city   = "Anytown"
  state  = "WA"
  zip    = "02122"
}

data "dominos_store" "store" {
  address_url_object = "${data.dominos_address.addr.url_object}"
}

data "dominos_menu_item" "item" {
  store_id     = "${data.dominos_store.store.store_id}"
  query_string = ["philly", "medium"]
}

resource "dominos_order" "order" {
  address_api_object = "${data.dominos_address.addr.api_object}"
  item_codes         = ["${data.dominos_menu_item.item.matches.0.code}"]
  store_id           = "${data.dominos_store.store.store_id}"
}

terraform init as usual and plan! apply when ready - but use caution, since this is going to charge you money.

Please view the docs here for more information past the quickstart, as well as some caveats it's probably worth being aware of.

terraform-provider-dominos's People

Contributors

davewongillies avatar deltamualpha avatar kaedemalu avatar nat-henderson avatar pjaudiomv avatar will-molloy avatar

Stargazers

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

Watchers

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

terraform-provider-dominos's Issues

Value Conversion Error

When doing terraform apply, I got the following error:

Error: Value Conversion Error

with dominos_order.order,
An unexpected error was encountered trying to convert tftypes.Value into provider.resourceOrderData. This is always an error in the provider. Please
report the following to the provider developer:

mismatch between struct and object: Struct defines fields not found in object: address_api_object. Object defines fields not found in struct:
api_object.

Publishing to the Terraform Registry

Hey There, I'm on our Terraform Provider team and we love this provider ๐Ÿ•!

We'd like to invite you to publish it on our Registry as we now also support provider publishing. Publishing to the Registry offers a variety of benefits for our community contributors, and having the provider published means users can benefit from provider source, no longer needing to manually sideload. If you're interested, check out the instructions here. Thanks and happy Terraforming!

Crash after creating order

After running terraform apply, I got one of those TERRAFORM CRASH errors (copied below). It seems like something is getting an EOF and it's not handled gracefully.

One thing to note is that I noticed that as I was running terraform plan a couple of times in a row to build my order and make sure it was correct, the HTTP requests made by the provider would sometimes time out, but they would work again after some time. So it's possible that there is some throttling happening on their end. I don't know if this is the same thing, but it sounds to me like it could be related.

I've only seen this once because I've only ordered once and it's obviously not easy to reproduce ๐Ÿ™‚

2019-09-29T15:52:59.640-0400 [DEBUG] plugin.terraform-provider-dominos: 2019/09/29 15:52:59 [DEBUG] checking tracker...
2019-09-29T15:52:59.752-0400 [DEBUG] plugin.terraform-provider-dominos: 2019/09/29 15:52:59 [DEBUG] order: (*main.OrderStatus)(nil)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: panic: runtime error: invalid memory address or nil pointer dereference
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1986c84]
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos:
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: goroutine 104 [running]:
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: main.getOrderStatus(0xc0002752f0, 0xc000802270, 0xa, 0xc000475380, 0x12, 0x1a83b20, 0xc0002752c0, 0x1be0b18, 0x2)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/ndmckinley/terraform-provider-dominos/resource_order.go:188 +0xd4
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: main.resourceOrderRead(0xc00014aee0, 0x1a049c0, 0xc00080a800, 0xc, 0xc00050fa38)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/ndmckinley/terraform-provider-dominos/resource_order.go:255 +0x9a
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: main.resourceOrderCreate(0xc00014aee0, 0x1a049c0, 0xc00080a800, 0xc00014aee0, 0x0)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/ndmckinley/terraform-provider-dominos/resource_order.go:182 +0x230a
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc000112180, 0xc000664640, 0xc0005b43c0, 0x1a049c0, 0xc00080a800, 0x100d701, 0xc0007cbb80, 0x10bb92c)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/hashicorp/terraform/helper/schema/resource.go:305 +0x363
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000112700, 0xc0006645f0, 0xc000664640, 0xc0005b43c0, 0xc000588000, 0x18, 0x285d440)
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/hashicorp/terraform/helper/schema/provider.go:289 +0x9c
2019-09-29T15:52:59.755-0400 [DEBUG] plugin.terraform-provider-dominos: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc0002ba120, 0xc0005a9e80, 0xc0007cfc20, 0x0, 0x0)
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: 	/Users/parvizu/go/src/github.com/hashicorp/terraform/plugin/resource_provider.go:530 +0x57
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: reflect.Value.call(0xc00031ac00, 0xc0000d00a8, 0x13, 0x1be1359, 0x4, 0xc0007cbf18, 0x3, 0x3, 0xc000042100, 0x0, ...)
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: 	/usr/local/go/src/reflect/value.go:447 +0x454
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: reflect.Value.Call(0xc00031ac00, 0xc0000d00a8, 0x13, 0xc0004bc718, 0x3, 0x3, 0x15, 0xc0004bc728, 0x141f6c5)
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: 	/usr/local/go/src/reflect/value.go:308 +0xa4
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: net/rpc.(*service).call(0xc0000c9b80, 0xc0005980a0, 0xc000802050, 0xc000802060, 0xc00080a000, 0xc0005ce700, 0x19f8a00, 0xc0005a9e80, 0x16, 0x19f8a40, ...)
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: 	/usr/local/go/src/net/rpc/server.go:384 +0x14e
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: created by net/rpc.(*Server).ServeCodec
2019-09-29T15:52:59.756-0400 [DEBUG] plugin.terraform-provider-dominos: 	/usr/local/go/src/net/rpc/server.go:481 +0x47e
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalWriteState
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2019-09-29T15:52:59.760-0400 [DEBUG] plugin: plugin process exited: path=/Users/parvizu/.terraform.d/plugins/terraform-provider-dominos
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalIf
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalWriteState
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalWriteDiff
2019/09/29 15:52:59 [TRACE] root: eval: *terraform.EvalApplyPost
2019/09/29 15:52:59 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error occurred:
	* dominos_order.order: unexpected EOF

2019/09/29 15:52:59 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error occurred:
	* dominos_order.order: unexpected EOF

2019/09/29 15:52:59 [TRACE] [walkApply] Exiting eval tree: dominos_order.order
2019/09/29 15:52:59 [TRACE] dag/walk: upstream errored, not walking "provider.dominos (close)"
2019/09/29 15:52:59 [TRACE] dag/walk: upstream errored, not walking "meta.count-boundary (count boundary fixup)"
2019/09/29 15:52:59 [TRACE] dag/walk: upstream errored, not walking "root"
2019/09/29 15:52:59 [TRACE] Preserving existing state lineage "fc1e89b2-07fc-4905-aa6b-d16236abf021"
2019/09/29 15:52:59 [TRACE] Preserving existing state lineage "fc1e89b2-07fc-4905-aa6b-d16236abf021"
2019/09/29 15:52:59 [TRACE] Preserving existing state lineage "fc1e89b2-07fc-4905-aa6b-d16236abf021"
2019/09/29 15:52:59 [TRACE] Preserving existing state lineage "fc1e89b2-07fc-4905-aa6b-d16236abf021"
2019/09/29 15:52:59 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-09-29T15:52:59.792-0400 [WARN ] plugin: error closing client during Kill: err="connection is shut down"

Discrepancy between api_object and address_api object

Hello,

I noticed a difference between the resource inputs listed in the readme here and the scheme listed in the terraform registry.

The required schema api_object is listed, whereas the resource block in the readme is address_api_object.

When running terraform plan with address_api_object, it errors with "The argument 'api_object' is required, but no definition was found." and "An argument named 'address_api_object' is not expected here."

When running terraform plan then apply with api_object, it errors at apply with a Value Conversion Error in dominos_order.order stating

"An unexpected error was encountered trying to convert tftypes.Value into provider.resourceOrderData. This is always an error in the provider. Please report the following to the provider developer:

mismatch between struct and object: Struct defines fields not found in object: address_api_object. Object defines fields not found in struct: api_object."

Any help appreciated.

Support for adding a delivery tip

I realized when I ordered and paid with a credit card that I couldn't add a tip. I tipped upon delivery but it would be good if that could be passed as a parameter if possible, or somehow let the users know that the order doesn't include a tip.

Maybe a tip_message field in the dominos_order resource that's hard-coded to something like "REMEMBER TO TIP!"?

As I'm typing this I realize that I don't know if the Domino's API allows this, so it may not be as easy to do, but a reminder to tip is not a bad thing anyway ๐Ÿ™‚

Broken link

The link to the full documentation is loading a 404 screen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.