Coder Social home page Coder Social logo

mataneine / terraform-provider-metanetworks Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 10.0 9.24 MB

Terraform Meta Networks provider

License: Mozilla Public License 2.0

Go 98.96% Makefile 1.04%
terraform terraform-provider metanetworks proofpoint meta ztna zero-trust-network-access swg secure-web-gateway

terraform-provider-metanetworks's Introduction

Terraform Provider for Meta Networks

See the Meta Networks Provider documentation to get started using the provider.

Requirements

Building The Provider

Clone repository to: $GOPATH/src/github.com/mataneine/terraform-provider-metanetworks

$ mkdir -p $GOPATH/src/github.com/mataneine; cd $GOPATH/src/github.com/mataneine
$ git clone [email protected]:mataneine/terraform-provider-metanetworks

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/mataneine/terraform-provider-metanetworks
$ make build

Using the provider

Enter the provider directory and install the provider

$ cd $GOPATH/src/github.com/mataneine/terraform-provider-metanetworks
$ make install

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it.

See the Meta Networks Provider documentation to get started using the provider.

Developing the Provider

Enter the provider directory.

$ cd $GOPATH/src/github.com/mataneine/terraform-provider-metanetworks

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/src/github.com/mataneine/terraform-provider-metanetworks/bin directory.

$ make build

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, run make testacc.

Note: Acceptance tests create real resources, and often cost money to run.

$ make testacc

terraform-provider-metanetworks's People

Contributors

dependabot[bot] avatar gkid avatar jmohr01 avatar mataneine avatar mazooz-chen avatar ryanpodonnell1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

terraform-provider-metanetworks's Issues

allow_support property not allowed when metanetworks_metaport create

According too:
https://help.metanetworks.com/api/#operation/api.api.create_metaport

allow_support property is not expected while creating metaport.

Creating new metaport with this code:

resource "metanetworks_metaport" "test" {
  name        = "test"
  description = "description"
}

results with an error:
Additional properties are not allowed ('allow_support' was unexpected)

Here is the terraform apply output:

Terraform will perform the following actions:

  # metanetworks_metaport.test will be created
  + resource "metanetworks_metaport" "test" {
      + allow_support      = true
      + created_at         = (known after apply)
      + description        = "description"
      + dns_name           = (known after apply)
      + enabled            = true
      + expires_at         = (known after apply)
      + id                 = (known after apply)
      + mapped_elements    = (known after apply)
      + modified_at        = (known after apply)
      + name               = "test"
      + network_element_id = (known after apply)
      + org_id             = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

metanetworks_metaport.test: Creating...

Error: {
  "detail": "Additional properties are not allowed ('allow_support' was unexpected)",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

I'm having issues packing the plugin in a terraform container

I've tried adding the plugin (copying the binary) to hashicorp/terraform docker container and it doesn't seem to find the plugin.
I've also tried to build the plugin with a go-lang container and then just downloading and running terraform - but it also doesn't find the plugin.

Do you have a recommended way for running terraform CI/CD with the plugin?
Any specific examples for CircleCI maybe?

Thank you!

BTW - Locally, on Mac, the plugin works just fine.

Versioning and releases

Should versioning be happening with the plugin? Terraform relies on proper plugin/provider versions. Locally I am making it up at the moment. Started with 1.0.0, it's now 1.0.7 . Might be good to do official versioning, so when installing the plugin and calling the provider, version or state of provider can be controlled.

Should we also look at building the plugin under releases? Then people can point the source directly to the release on github, rather than have to pull down the repo and build it

Error with networkElement.MappedDomains (Wrong Type)

Hi guys,
When running the make test and make testacc, I am receiving the errors below regarding issues with the network_element.go and protocol_group.go

sh-3.2# make test
go test -i $(go list ./... | grep -v 'vendor') || exit 1
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
echo $(go list ./... | grep -v 'vendor') | xargs -t -n4 go test -timeout=30s -parallel=4
go test -timeout=30s -parallel=4 terraform-provider-metanetworks terraform-provider-metanetworks/metanetworks\

terraform-provider-metanetworks/metanetworks\

metanetworks/network_element.go:45:2: Printf format %s has arg networkElement.MappedDomains of wrong type []terraform-provider-metanetworks/metanetworks.MappedDomain
metanetworks/protocol_group.go:40:2: Printf format %s has arg protocolGroup of wrong type terraform-provider-metanetworks/metanetworks.ProtocolGroup
? terraform-provider-metanetworks [no test files]
make: *** [test] Error 1\

sh-3.2# make testacc
TF_ACC=1 go test $(go list ./... | grep -v 'vendor') -v -timeout 120m\

terraform-provider-metanetworks/metanetworks\

metanetworks/network_element.go:45:2: Printf format %s has arg networkElement.MappedDomains of wrong type []terraform-provider-metanetworks/metanetworks.MappedDomain
metanetworks/protocol_group.go:40:2: Printf format %s has arg protocolGroup of wrong type terraform-provider-metanetworks/metanetworks.ProtocolGroup
? terraform-provider-metanetworks [no test files]
make: *** [testacc] Error 2
sh-3.2#
}`

Have you one of you seen this issue?

Read Error using Resource mapped_subnets_mapped_domain

Get this error when trying to attach a domain to a subnet

metanetworks_mapped_subnets_mapped_domain.DC_Infrastructure_Group_Domain: Creating...

Error: Provider produced inconsistent result after apply

When applying changes to
metanetworks_mapped_subnets_mapped_domain.DC_Infrastructure_Group_Domain,
provider "github.com/metanetworks/metanetworks" produced an unexpected new
value: Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

All other attachments seem to work so far (MetaConnector -> Subnets, Alias -> Services, Routing Group -> Connector, Subnets)

My Code in my main.tf

resource "metanetworks_mapped_subnets" "DC_Infrastructure" {
    name                        = "DC_Infrastructure_Subnets"
    mapped_subnets              = [ *redacted*]
    description                 = "Subnet Group for all Data Centre (DC) Infrastructure. All clients requires access to services on
    these subnets, INF requires whole subnet access"
}
resource "metanetworks_mapped_subnets_mapped_domain" "DC_Infrastructure_Group_Domain" {
    mapped_subnets_id           = metanetworks_mapped_subnets.DC_Infrastructure.id
    enterprise_dns              = true
    mapped_domain               = "redacted.redacted"
    name                        = "redacted.redacted"
}

Metaport_attachment. Root resource was present, but now absent.

Logged error

module.xxx.metanetworks_mapped_service.mapped_service: Creation complete after 2s [id=ne-104]
module.xxx.metanetworks_mapped_service_alias.mapped_service_alias: Creating...
module.xxx.metanetworks_metaport_attachment.metaport_attachment: Creating...
module.xxx.metanetworks_policy.policy: Creating...
module.xxx.metanetworks_mapped_service_alias.mapped_service_alias: Creation complete after 0s [id=ne-104_xxx]

Error: Provider produced inconsistent result after apply

When applying changes to
module.xxx.metanetworks_metaport_attachment.metaport_attachment, provider
"registry.terraform.local/mataneine/metanetworks" produced an unexpected new
value: Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Steps to reproduce

Unknown. I can't force this to occur, only that is has now and terraform can't provision any metaport_attachment resources.

I suspect the error being thrown is from resource_metaport_attachment.go line 55. If I manually attach the metaport_service to the metaport, then the condition on resource_metaport_attachment.go line 47 triggers, which suggests to me that the error is encountered after this.

The attachment however does happen, and I can see this reflected in the metanetworks UI. Possibly the api is returning an error that the mapped_service is already attached?

Problems with Delete/Update metanetworks_metaport_attachment

I'm struggling with an Delete/Update actions on metanetworks_metaport_attachment.
I think that provider can't update metaport attachments correctly.
Observed issues:

  1. Deleting
    If I remove metanetworks_metaport_attachment TF reports that object was successfully deleted while it is still visible in the MetaNetworks console.
  2. Updating TF resource with a new id of metaport will leave old assignment in the metanetworks console and it will add a new one (in the end - specific mapped service instead of getting new ID of metaport it will end containing two metaport assignments

Steps to reproduce:

  1. Add resource with:
resource "metanetworks_metaport_attachment" "test" {
  metaport_id = "mp-10"
  network_element_id = "ne-30"
}
  1. run terraform apply (resource will be properly added)
  2. Remove or comment that resource:
#resource "metanetworks_metaport_attachment" "test" {
#  metaport_id = "mp-10"
#  network_element_id = "ne-30"
#}
  1. Run terraform apply (terraform will report that resource was deleted while it is still available in metanetworks console)

Here is the output from TRACE:

Terraform will perform the following actions:

  # metanetworks_metaport_attachment.test will be destroyed
  - resource "metanetworks_metaport_attachment" "test" {
      - id                 = "mp-10ne-30" -> null
      - metaport_id        = "mp-10" -> null
      - network_element_id = "ne-30" -> null
    }

Plan: 0 to add, 0 to change, 1 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

2020/11/17 10:43:57 [INFO] backend/local: apply calling Apply
2020/11/17 10:43:57 [INFO] terraform: building graph: GraphTypeApply
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_mapped_service_alias.this (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_policy.policy (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_protocol_group.api-protocol-group (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "data.metanetworks_group.user_groups (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_metaport_attachment.test (destroy)" (*terraform.NodeDestroyResourceInstance) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_routing_group.this (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_mapped_service.this (prepare state)" (*terraform.NodeApplyableResource) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_routing_group.this (prepare state)" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_mapped_service.this (prepare state)" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.services" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policies_by_src" references: [local.policy_files]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.policies_combined" references: [local.policies]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_mapped_service_alias.this (prepare state)" references: [local.service_aliases]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.service_aliases" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.service_metaports" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policy_files" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_policy.policy (prepare state)" references: [local.policies]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_metaport_attachment.test (clean up state)" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.services" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.policy_files" references: [local.policy_files]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.metaports" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.metanetworks_mapped_service" references: [metanetworks_mapped_service.this (prepare state)]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.user_groups" references: [data.metanetworks_group.user_groups (prepare state)]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.service_aliases" references: [local.service_aliases]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_protocol_group.api-protocol-group (prepare state)" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "data.metanetworks_group.user_groups (prepare state)" references: [local.policies_by_src]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_metaport_attachment.test (destroy)" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policies" references: [local.policies_by_src]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "provider.metanetworks" references: []
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_metaport_attachment.test (destroy)" (*terraform.NodeDestroyResourceInstance) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ProviderTransformer: "metanetworks_metaport_attachment.test" (*terraform.NodeAbstractResourceInstance) needs provider.metanetworks
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policies_by_src" references: [local.policy_files]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.service_metaports" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policy_files" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.metanetworks_mapped_service" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_metaport_attachment.test" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.policies" references: [local.policies_by_src]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.policies_combined" references: [local.policies]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.services" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.user_groups" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.service_aliases" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.service_aliases" references: [local.service_aliases]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.policy_files" references: [local.policy_files]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "output.services" references: [local.services]
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "provider.metanetworks" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "metanetworks_metaport_attachment.test (destroy)" references: []
2020/11/17 10:43:57 [DEBUG] ReferenceTransformer: "local.metaports" references: []
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node metanetworks_routing_group.this (prepare state)
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node metanetworks_mapped_service.this (prepare state)
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node metanetworks_mapped_service_alias.this (prepare state)
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node metanetworks_policy.policy (prepare state)
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node metanetworks_protocol_group.api-protocol-group (prepare state)
2020/11/17 10:43:57 DestroyEdgeTransformer: pruning unused resource node data.metanetworks_group.user_groups (prepare state)
2020/11/17 10:43:57 [DEBUG] Starting graph walk: walkApply
2020-11-17T10:43:57.144+0100 [INFO]  plugin: configuring client automatic mTLS
2020-11-17T10:43:57.172+0100 [DEBUG] plugin: starting plugin: path=/Users/krzysztof.kozlowski/.terraform.d/plugins/terraform-provider-metanetworks args=[/Users/krzysztof.kozlowski/.terraform.d/plugins/terraform-provider-metanetworks]
2020-11-17T10:43:57.176+0100 [DEBUG] plugin: plugin started: path=/Users/krzysztof.kozlowski/.terraform.d/plugins/terraform-provider-metanetworks pid=1637
2020-11-17T10:43:57.176+0100 [DEBUG] plugin: waiting for RPC address: path=/Users/krzysztof.kozlowski/.terraform.d/plugins/terraform-provider-metanetworks
2020-11-17T10:43:57.187+0100 [INFO]  plugin.terraform-provider-metanetworks: configuring server automatic mTLS: timestamp=2020-11-17T10:43:57.186+0100
2020-11-17T10:43:57.214+0100 [DEBUG] plugin: using plugin: version=5
2020-11-17T10:43:57.214+0100 [DEBUG] plugin.terraform-provider-metanetworks: plugin address: address=/var/folders/zz/cs0w38kj537fxlx1ldv7510nzxl43h/T/plugin867957400 network=unix timestamp=2020-11-17T10:43:57.214+0100
metanetworks_metaport_attachment.test: Destroying... [id=mp-10ne-30]
2020/11/17 10:43:57 [DEBUG] metanetworks_metaport_attachment.test: applying the planned Delete change
2020-11-17T10:43:57.922+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:57 [DEBUG] Locking "mp-10ne-30"
2020-11-17T10:43:57.922+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:57 [DEBUG] Locked "mp-10ne-30"
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Response: {
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "allow_support": true,
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "connection": {
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "connected": true,
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "connected_at": "2020-11-16T05:46:05Z",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "disconnected_at": "2020-10-27T17:03:07Z",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "location": "FRA",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "src_underlay_ip": "185.68.14.4",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "vpn_proto": "ipsec"
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   },
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "created_at": "2020-09-14T06:35:26.130Z",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "description": "",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "dns_name": "10.9358.nsof",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "enabled": true,
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "expires_at": "2023-09-29T11:20:06.368Z",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "id": "mp-10",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "mapped_elements": [
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "ne-9",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "ne-30"
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   ],
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "modified_at": "2020-11-17T09:35:01.624Z",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "name": "PAYUDC PL4 NPP",
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "org_id": "org-9358"
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: }
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Returning Metaport from Get: mp-10
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Field Name Name with PAYUDC PL4 NPP
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Field Name Description with
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Update Field Name Enabled with <bool Value>
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Field Name MappedElements with <[]string Value>
2020-11-17T10:43:58.053+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Update Field Name AllowSupport with <bool Value>
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Response: {
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "allow_support": true,
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "created_at": "2020-09-14T06:35:26.130Z",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "description": "",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "dns_name": "10.9358.nsof",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "enabled": true,
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "expires_at": "2023-09-29T11:20:06.368Z",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "id": "mp-10",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "mapped_elements": [
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:     "ne-30"
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   ],
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "modified_at": "2020-11-17T09:43:58.172Z",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "name": "PAYUDC PL4 NPP",
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks:   "org_id": "org-9358"
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks: }
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 Returning Metaport from Update: mp-10
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 [DEBUG] Unlocking "mp-10ne-30"
2020-11-17T10:43:58.229+0100 [DEBUG] plugin.terraform-provider-metanetworks: 2020/11/17 10:43:58 [DEBUG] Unlocked "mp-10ne-30"
metanetworks_metaport_attachment.test: Destruction complete after 0s
2020-11-17T10:43:58.249+0100 [DEBUG] plugin: plugin process exited: path=/Users/krzysztof.kozlowski/.terraform.d/plugins/terraform-provider-metanetworks pid=1637
2020-11-17T10:43:58.249+0100 [DEBUG] plugin: plugin exited

OTAC has extra unofficial parameter that causes it to fail

The resource metanetworks_metaport_otac has triggers specified as required but does not exist anywhere else in code, nor is it specified in the API. This causes it to fail. Removing that component fixes it and it works as intended

Removing attached protocol group Error

Describe the bug
When trying to delete protocol group, that attached to policies, there is an error :
"Protocol Group is in use."
The reason : TF tries to delete the protocol group before updating the policies and removing the protocol group from the policies.

To Reproduce
Steps to reproduce the behavior:

  1. Remove protocol group code
  2. Remove all attachments of the protocol group in the policies
  3. Run "Terraform Apply"
  4. See error

Expected behavior
The policy should be updated before the protocol group deletion, and then it will work

Mapped Subnets should allow for empty mapped subnet CIDR's

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.