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

Importing a Firewall section shows applied_to = LogicalRouter #152

Closed
fdhex opened this issue Mar 13, 2019 · 1 comment
Closed

Importing a Firewall section shows applied_to = LogicalRouter #152

fdhex opened this issue Mar 13, 2019 · 1 comment

Comments

@fdhex
Copy link

fdhex commented Mar 13, 2019

As written in title I have imported a firewall section by id. It is an edge firewall on a T0
From my tfstate:

 "nsxt_firewall_section.section_prod": {
                    "type": "nsxt_firewall_section",
                    "depends_on": [],
                    "primary": {
                        "id": "ewadwadwa",
                        "attributes": {
                            "applied_to.#": "1",
                            "applied_to.903722171.is_valid": "true",
                            "applied_to.903722171.target_display_name": "my_to",
                            "applied_to.903722171.target_id": "dwadwadwad",
                            "applied_to.903722171.target_type": "LogicalRouter",
                            "description": "",
                            "display_name": "Infrastructure",
                            "id": "dwadwadwadwad",
                            "is_default": "false",
                            "revision": "2", [...]

But as written in docs, target_type LogicalRouter does not seem supported, so if in my resource I do write

resource "nsxt_firewall_section" "section_prod" {
    section_type = "LAYER3"
    stateful = "true"
    applied_to = {
        target_id = "dwadwadwad",
        target_type = "LogicalRouter"
    }
}

it fails and tells me LogicalRouter is not supported. Am I missing something?

Curl'ing the API /firewall/sections it mixes DFW and EFW rules, so I would assume EFW could be created using the same framework.

EDIT: I was able to make it work by adding LogicalRouter to the array at https://github.com/terraform-providers/terraform-provider-nsxt/blob/master/nsxt/resource_nsxt_firewall_section.go#L103 - the API behind is the same so it's only a matter of internal validation.

@fdhex
Copy link
Author

fdhex commented Mar 18, 2019

@annakhm annakhm closed this as completed Apr 15, 2019
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