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

Mapped Subnets should allow for empty mapped subnet CIDR's #36

Open
jmohr01 opened this issue Nov 30, 2020 · 0 comments
Open

Mapped Subnets should allow for empty mapped subnet CIDR's #36

jmohr01 opened this issue Nov 30, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jmohr01
Copy link
Contributor

jmohr01 commented Nov 30, 2020

Proofpoint believe it best practice to create a seperate 'mapped_subnet' without any IPv4 CIDR blocks on it, with the enterprise DNS domain, metaport connector and routing group. This tells meta that any DNS queries for the domain, query through that metaport. It does not require any CIDR blocks. After testing via the API directly, I was able to successfully create a mapped_subnet without the mapped_subnets (CIDRs). However, if done via terraform, it says it successfully creates the subnet, but it doesn't create the resource, and thus, when trying to attach a metaport, routing_group and mapped_domain resource, it fails as it does not exist. Something to do with the way the plugin handles the mapped_subnets attribute.

As it is set to required, I had to put an empty list in place for it to except it mapped_subnets = []. This allowed it to pass and 'created' it, but it did not actually create it.

If placing a null or empty string inside the list, the API throws an error. Unable to omit it due to it being required in the plugin.

TLDR, the API allows for a creating of a mapped_subnet resource without the need for specifying any CIDRs, as long as the JSON looks like below, it works. Need this same expected behaviour to happen with TF, so it allows for the creation of DNS only mapped_subnets. Proofpoint are aware that it's weird naming considering it technically isn't a mapped subnet without mapped_subnets, but this is best practice and behaviour at the moment.

JSON:

{
    "description": "test",
    "enabled": true,
    "mapped_subnets": [],
    "name": "API_TEST"
}

POST: https://api.metanetworks.com/v1/network_elements

@mataneine mataneine added the enhancement New feature or request label Dec 14, 2020
@mataneine mataneine self-assigned this Dec 14, 2020
jmohr01 referenced this issue in jmohr01/terraform-provider-metanetworks Dec 15, 2020
…it, and creates empty mapped_subnets resource in meta
jmohr01 referenced this issue in jmohr01/terraform-provider-metanetworks Jan 13, 2021
#36 enhancement now allows for [] as mapped_subnets without omitting …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants