Coder Social home page Coder Social logo

Comments (9)

kvrhdn avatar kvrhdn commented on August 23, 2024 1

Okay, I've quickly added schema.ImportStatePassthrough and I can confirm importing boards works fine 👍🏻 I'll clean that up tomorrow and release it.

Importing triggers should also be possible, it will just a bit more implementation work because we need both the dataset and the ID.

from terraform-provider-honeycombio.

kvrhdn avatar kvrhdn commented on August 23, 2024

Yeah, that's right. It's something you have to explicitly enable/implement per resource.
Which resource would you like to import?

Since reading honeycombio_board only requires an ID this can be implemented with schema.ImportStatePassthrough.

Importing triggers is a bit more difficult since we need both the ID and the datasaet to retrieve the trigger.

from terraform-provider-honeycombio.

fitzoh avatar fitzoh commented on August 23, 2024

Which resource would you like to import?

Primarily interested in boards at the moment (that's the issue I ran into), was torn between opening per resource issues or a blanket one. I could see someone wanting to import a trigger, not really seeing a marker import use case.

Okay, I've quickly added schema.ImportStatePassthrough and I can confirm importing boards works fine 👍🏻 I'll clean that up tomorrow and release it.

Awesome, thanks

Importing triggers should also be possible, it will just a bit more implementation work because we need both the dataset and the ID.

Something like terraform import honeycombio_trigger.whatever <dataset>/<id>?

from terraform-provider-honeycombio.

kvrhdn avatar kvrhdn commented on August 23, 2024

Primarily interested in boards at the moment (that's the issue I ran into), was torn between opening per resource issues or a blanket one. I could see someone wanting to import a trigger, not really seeing a marker import use case.

Agree. One issue for all imports is fine imo, we can add both implementations simultaneously.

Something like terraform import honeycombio_trigger.whatever <dataset>/<id>?

Yeah, but we have to keep in mind that / is a valid character in a dataset name. I have a dataset named kvrhdn/terraform-provider-honeycombio for example.

But we might be able to write a function that always uses the last / in the string. I think we can assume an ID will only contain alphanumeric characters and especially no /...

from terraform-provider-honeycombio.

fitzoh avatar fitzoh commented on August 23, 2024

Yeah, but we have to keep in mind that / is a valid character in a dataset name. I have a dataset named kvrhdn/terraform-provider-honeycombio for example.

Well that's interesting...
So I created a dataset called test/dataset, and the url becomes <team>/datasets/test-dataset.

If I try to create test-dataset later, it appears to just be a noop.

anyways...

But we might be able to write a function that always uses the last / in the string. I think we can assume an ID will only contain alphanumeric characters and especially no /...

Yeah, that sounds reasonable

from terraform-provider-honeycombio.

kvrhdn avatar kvrhdn commented on August 23, 2024

Well that's interesting...
So I created a dataset called test/dataset, and the url becomes /datasets/test-dataset.

If I try to create test-dataset later, it appears to just be a noop.

Yeah, that's also something I discovered: if you put the dataset in the URL, it has to be sanitized (replace / by -) but if you use it in the body it should stay the same...

go-honeycombio has a little extra logic for this when calling the markers and triggers API
https://github.com/kvrhdn/go-honeycombio/blob/main/client.go#L185

from terraform-provider-honeycombio.

kvrhdn avatar kvrhdn commented on August 23, 2024

All in all not a lot of work to implement this 😀

I'll add an importer to honeycombio_trigger as well and make a new release tomorrow.

from terraform-provider-honeycombio.

fitzoh avatar fitzoh commented on August 23, 2024

sweet, thanks again

from terraform-provider-honeycombio.

kvrhdn avatar kvrhdn commented on August 23, 2024

Import has been implemented for boards and triggers! 🙂

from terraform-provider-honeycombio.

Related Issues (20)

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.