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

data source "pfptmeta_metaport" and "pfptmeta_metaport_cluster" should get name as input #11

Closed
talmarco opened this issue Jan 30, 2022 · 8 comments

Comments

@talmarco
Copy link

talmarco commented Jan 30, 2022

Hello,

Currently, it seems like both data sources "pfptmeta_metaport" and "pfptmeta_metaport_cluster" get only the resource ID as input.
It would be great to have the resource name as an input and get the resource id as an output.

In my scenario - the MetaPort is created while bootstrap with userdata script, so when Terraform runs, it doesn't know the MetaPort IDs.

@hod-alpert fyi

Edit: I do understand that in Meta, the resource's name is not unique, and therefore the input for this data source is an ID and not the resource name. Having said that, what about returning as an output a list of resources with a given resource name, along with some other parameters, such as Healthy/Not healthy.

@kvitali
Copy link

kvitali commented Feb 3, 2022

Hi @talmarco,
Can you elaborate more about your MetaPort onboard process?
Which resources do you create in TF and which resources do you create with bootstrap?

@hod-alpert
Copy link
Contributor

Hi @talmarco,

Thank you for your feedback.

Can you elaborate please what it is you're trying to achieve and what is your use case?
Do I understand correctly that you're trying to onboard a metaport with userdata?
If the metaport is not a tf resource where do you create it and why not create as tf resource as well?

@talmarco
Copy link
Author

talmarco commented Feb 3, 2022

Hi @kvitali @hod-alpert,
Our Terraform deploys the VMs, then using userdata script, we install and onboard the MetaPort.
Once we have the new MetaPort configured, Terraform creates private resources, such as EKS, and then Terraform runs a null_resource that discovers the relevant MetaPort, create a Mapped Service and Access Policy.

Now since you have provided this great Terraform provider, we would like to migrate the second part of the above to the new Terraform provider.
The desired process we would like to achieve is:
Terraform deploy a VM -> userdata runs and bootstrap the MetaPort -> Create Mapped service, Access policy using the new Terraform provider.

So my problem is I'd like to get the MetaPort ID in order to attach it to the Mapped Service.

LMK if you need more details, Thanks!

@hod-alpert
Copy link
Contributor

Thanks for your reply @talmarco.

One thing I don't get yet, why the following scenario won't solve your problem?

Terraform creates metaport resource in meta -> Terraform deploy a VM -> userdata runs and bootstrap the MetaPort -> Create Mapped service, Access policy using the new Terraform provider -> attach the mapped subnet to the metaport using the resource id.

@talmarco
Copy link
Author

talmarco commented Feb 3, 2022

@hod-alpert the terraform resource for creating a mapped service doesn't aware of the MetaPort ID that was created by the userdata.

@hod-alpert
Copy link
Contributor

Got you now.

So that's metaport and metaport cluster only that needs that feature?

@talmarco
Copy link
Author

talmarco commented Feb 4, 2022

I think so.
I think it's good to have as an input the MetaPort name and then get all MetaPorts with this given name with all other attributes such as enabled/disabled, active/inactive/ data of creation, etc.

WDYT?

hod-alpert added a commit that referenced this issue Feb 6, 2022
Even though name is not unique for metaports - costumer's feedback
brought the need to onboard metaport outside of tf code and later - use
the metaport name to find it and attach mapped elements to it from
terraform.

Because it's not unique - in case there is more then one metaport with
specified name - an error will be returned.

Customer's ticket: #11
hod-alpert added a commit that referenced this issue Feb 6, 2022
Even though name is not unique for metaport clusters - costumer's feedback
brought the need to onboard metaports and metaport clusters outside of tf code and later - use
the metaport name to find it and attach mapped elements to it from
terraform.

Because it's not unique - in case there is more then one metaport cluster with the
specified name - an error will be returned.

Customer's ticket: #11
@hod-alpert
Copy link
Contributor

Version 0.1.20 was released, enjoy!

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

3 participants