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

Can't import GRAPHQL-API templated rule #159

Open
sarsa78 opened this issue Apr 14, 2023 · 1 comment
Open

Can't import GRAPHQL-API templated rule #159

sarsa78 opened this issue Apr 14, 2023 · 1 comment

Comments

@sarsa78
Copy link

sarsa78 commented Apr 14, 2023

Hi,
I'm trying to import the graphql-api templated rule but it is failing. I tried many variations(non-caps etc) of the ID but no luck.

> terraform import sigsci_site_templated_rule.graphql our_site:GRAPHQL-API

sigsci_site_templated_rule.graphql: Importing from ID "our_site:GRAPHQL-API"...
sigsci_site_templated_rule.graphql: Import prepared!
  Prepared sigsci_site_templated_rule for import
sigsci_site_templated_rule.graphql: Refreshing state... [id=GRAPHQL-API]
╷
│ Error: Cannot import non-existent remote object
│
│ While attempting to import an existing object to "sigsci_site_templated_rule.graphql", the provider detected that no object exists with the given id. Only
│ pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" to
│ create a new remote object for this resource.

While the templated rule exists, enabled in the site under https://dashboard.signalsciences.net/corps/our_corp/sites/our_site/templatedRules/GRAPHQL-API it doesn't work.

Other templated rules can be imported without much of a problem. Example of a successfully imported templated rule: https://dashboard.signalsciences.net/corps/our_corp/sites/our_site/templatedRules/CVE-2021-44228

Not sure if there is a different ID format for this rule or if the provider is using a legacy api endpoint where this resource resides.

Thank you!

@rahiparikh
Copy link

Hello @Eric-Evangelista-Paidy! I noticed that you've encountered the same issue I was dealing with and I think I have a potential solution. YMMV.

  1. Find the ID for the Templated GraphQL Rule: Visit the URL https://dashboard.signalsciences.net/api/v0/corps/[corp_name]/sites/[site_name]/rules?limit=1000&type=templatedSignal and look for the specific rule you want to work with and note down its ID.

  2. Create a Resource for Your GraphQL Endpoint: Now, create a resource of type sigsci_site_rule in terraform for your GraphQL endpoint. This is where you'll configure the rule.

  3. Import the Rule Using the ID (Not the Rule Name): When configuring the rule, make sure to use the ID you found in step 1 instead of the rule name (GRAPHQL-API).

Please note that this solution might not be officially supported. Hope it helps.

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

2 participants