Skip to content
New issue

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

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

Already on GitHub? # to your account

Ensure terraform import documented for all supported resources #203

Open
20 tasks
DanInProgress opened this issue Nov 9, 2023 · 3 comments
Open
20 tasks

Comments

@DanInProgress
Copy link

DanInProgress commented Nov 9, 2023

Most of the terraform providers support terraform import but mutliple are lacking documentation,
creating an issue to inventory all resrouces and ensure that they have proper documentation.

This is especially important given the frequency of failures due to parallelism issues.
terraform import is a vital tool for users when trying to fix bad terraform state.

  • sigsci_corp_cloudwaf_certificate docs md
  • sigsci_corp_cloudwaf_instance docs md
  • sigsci_corp_integration docs md
  • sigsci_corp_list docs md
  • sigsci_corp_rule docs md
  • sigsci_corp_signal_tag docs md
  • sigsci_edge_deployment docs md
  • sigsci_edge_deployment_service docs md
  • sigsci_edge_deployment_service_backend docs md
  • sigsci_site docs md
  • sigsci_site_alert docs md
  • sigsci_site_allowlist docs md
  • sigsci_site_blocklist docs md
  • sigsci_site_header_link docs md
  • sigsci_site_integration docs md
  • sigsci_site_list docs md
  • sigsci_site_redaction docs md
  • sigsci_site_rule docs md
  • sigsci_site_signal_tag docs md
  • sigsci_site_templated_rule docs md

I'll review some of the links above and update with what I find. I've already seen a couple of related issues #159 and #202

@DanInProgress
Copy link
Author

🤔 reading #159 and noting that sigsci_site_templated_rule does actually have a section titled import:

## Import
Import is supported using the following syntax:
```terraform
terraform import sigsci_site_templated_rule.test site_short_name:id
```

I don't know if I can properly evaluate this list, given that I've not tried to import these. The ids of a lot of these seem somewhat obfuscated on the admin dashboard.

@BrooksCunningham
Copy link
Contributor

Thanks for the comment @DanInProgress . I've been doing some tinkering and this format works for some of the templated rules.

import {
  id = "site_short_name:LOGINATTEMPT"
  to = sigsci_site_templated_rule.site_short_nameLOGINATTEMPT
}

Some of the templated rules are managed the sigsci_site_templated_rule resource and others are not.

I did make a tool to automagically generate HCL for an NGWAF config. You are welcome to give it a try and see if it at least can build out the HCL as you would expect it to. https://github.com/BrooksCunningham/ngwaf-terraformify

As a disclaimer, this tool is not an official Fastly supported tool.

@danicat
Copy link

danicat commented Dec 10, 2024

The following resources have import documentation, but the markdown is labelled incorrectly as terraform instead of shell which I believe is creating problems:

  • sigsci_corp_integration
  • sigsci_site_header_link
  • sigsci_site_integration
  • sigsci_site_redaction
  • sigsci_site_rule
  • sigsci_site_templated_rule

See:

```terraform
terraform import sigsci_site_templated_rule.test site_short_name:id
```

Should be like this instead (notice the shell tag instead of terraform):

```shell
terraform import sigsci_site_list.test site_short_name:id
```

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

No branches or pull requests

3 participants