Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add capability to manage "Libraries" to the provider #66

Open
dscanlan-sg opened this issue Oct 26, 2023 · 6 comments
Open

Add capability to manage "Libraries" to the provider #66

dscanlan-sg opened this issue Oct 26, 2023 · 6 comments

Comments

@dscanlan-sg
Copy link

Is your feature request related to a problem? Please describe.

We are currently setting up Segment in Terraform and would like to be able to utilise "Libraries" but currently can only use LIVE tracking plans not PROPERTY_LIBRARY or RULE_LIBRARY which is supported by the Public API. This means we will end up with repeated groups of events or attributes which will have to be maintained within the code.

Describe the solution you'd like

Ability to manage the resource type segment_tracking_plan with types PROPERTY_LIBRARY or RULE_LIBRARY which can then be linked to the LIVE tracking plan's.

Describe alternatives you've considered

  • Repeating blocks of events and/or attributes in each tracking plan
  • Reproduce this functionality using a common/shared file within TF
  • Use the Public API (but ideally want everything in TF)

Additional context

The PROPERTY_LIBRARY is probably more of a priority at this stage and the RULE_LIBRARY likely something we would want in the future.

Public API reference to types noted above: https://docs.segmentapis.com/tag/Tracking-Plans#operation/createTrackingPlan

@deanhuynh
Copy link
Contributor

Could you explain a bit more about what is preventing you from using those Tracking Plan types? I am able to use those on my end. Are you perhaps getting an error like this which is in the connection (Sources cannot be connected to non LIVE Tracking Plans) and not the Tracking Plan resource?

│ Error: Unable to create connection between Source and Tracking Plan
│ 
│   with segment_source_tracking_plan_connection.test,
│   on main.tf line 269, in resource "segment_source_tracking_plan_connection" "test":
│  269: resource "segment_source_tracking_plan_connection" "test" {
│ 
│ 403 Forbidden
│ {
│   "errors": [
│     {
│       "type": "forbidden",
│       "message": "Authz: User does not have permissions to perform this action. Tracking plan is not type Live."
│     }
│   ]
│ }

@sco-at-scg
Copy link

One of Tracking Plan's type is RULE_LIBRARY.

{
  "name": "Some Library",
  "description": "Some Library Desc"
  "type": "RULE_LIBRARY",
  "syncFromLibraries": [],
  "excludedRulesFromLibraries": []
}

Questions:

  • Do we have capabilities to create libraries?
  • As the mandatory field for segment_tracking_plan are name and rules, it it possible to use RULE_LIBRARY with the current provider?

@deanhuynh
Copy link
Contributor

@sco-at-scg

Do we have capabilities to create libraries?

Yes you can create libraries in the provider now, are you running into issues?

As the mandatory field for segment_tracking_plan are name and rules, it it possible to use RULE_LIBRARY with the current provider?

No, we do not support importing libraries at this point, but is on our future roadmap.

@dscanlan-sg
Copy link
Author

dscanlan-sg commented Nov 2, 2023

Hi @deanhuynh - so just to confirm the current terraform tracking plan capabilities allow us to:

  • Create a Tracking Plans (LIVE) and connect this to a source
  • Create Tracking Plan Libraries (but not connect it to anything)

What we do not have the capability to do is connect/synchronize a library of events/attributes with a tracking plan - is this correct?

Is there another way we should be using libraries or is this just a capability gap with the API/terraform provider? It seems that if we create one it is just orphaned and cannot be connected to anything. Just want to check I am not missing something here. Thanks

@ranand
Copy link

ranand commented Nov 2, 2023

What we do not have the capability to do is connect/synchronize a library of events/attributes with a tracking plan - is this correct?

Yes this is correct

It is a missing functionality at this point. We will consider prioritizing this early next year. Thanks!

@dscanlan-sg
Copy link
Author

@ranand - great - thanks for confirming and will work around this for now. Are we OK to keep this feature request open for the additional capability as it is something we are looking to utilise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants