Skip to content

banyan_service_tcp resource is requiring "backend_domain" & "backend_port" as an attribute, but it appears that it should be optional.  #153

@lodotek

Description

@lodotek

Using 1.2.5 of the tf provider, I have a banyan_service_tcp defined in my terraform as follows (and it currently works):

resource "banyan_service_tcp" "k8s_api" {
  name                           = "${var.cluster_name}-k8s-api"
  description                    = "[Managed by Terraform] from ${local.module_rel_path}"
  access_tier                    = banyan_accesstier.prodwatch_netagent.name
  domain                         = banyan_accesstier.prodwatch_netagent.address
  backend_domain                 = var.cluster_endpoint
  backend_port                   = 8443
  policy                         = data.banyan_policy_infra.default.id
  http_connect                   = true
  client_banyanproxy_listen_port = var.k8s_api_proxy_port != null ? var.k8s_api_proxy_port : null
}

Since upgrading from 1.2.5 of the provider, TF now shows a perma-diff on this resource as follows:

  # module.netagent[0].banyan_service_tcp.k8s_api will be updated in-place
  ~ resource "banyan_service_tcp" "k8s_api" {
      + backend_domain                     = "10.100.xxx.xxx:6443" ## IP obfuscated by me
      ~ backend_port                       = 0 -> 8443
        id                                 = "oke-myregion-k8s-api.cluster1.bnn"
        name                               = "oke-myregion-k8s-api"
        # (13 unchanged attributes hidden)
    }

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

Note that it is trying to add backend_domain and change the backend_port. The web console in the command center does not require these fields populated, however the terraform does. If I try to null the values for these two fields, it states: Required attribute "backend_domain" not specified: An attribute named "backend_domain" is required hereTerraform & Required attribute "backend_port" not specified: An attribute named "backend_port" is required here

For your reference, here is the service currently defined in the command center (Some values changed for privacy reasons):

{
    "kind": "BanyanService",
    "apiVersion": "rbac.banyanops.com/v1",
    "type": "origin",
    "metadata": {
        "name": "oke-myregion-k8s-api",
        "description": "[Managed by Terraform] from tf/_modules/accesstier-oke",
        "cluster": "cluster1",
        "autorun": false,
        "tags": {
            "template": "TCP_USER",
            "user_facing": "true",
            "protocol": "tcp",
            "domain": "cluster1.at.oke-myregion.banyanops.com",
            "port": "8443",
            "icon": "",
            "service_app_type": "GENERIC",
            "banyanproxy_mode": "CHAIN",
            "app_listen_port": "8094",
            "allow_user_override": true,
            "description_link": "",
            "include_domains": []
        }
    },
    "spec": {
        "attributes": {
            "tls_sni": [
                "cluster1.at.oke-myregion.banyanops.com"
            ],
            "frontend_addresses": [
                {
                    "cidr": "",
                    "port": "8443"
                }
            ],
            "host_tag_selector": [
                {
                    "com.banyanops.hosttag.site_name": "oke-myregion"
                }
            ],
            "disable_private_dns": false
        },
        "backend": {
            "target": {
                "name": "",
                "port": "",
                "tls": false,
                "tls_insecure": false,
                "client_certificate": false
            },
            "dns_overrides": {},
            "whitelist": [],
            "allow_patterns": [
                {}
            ],
            "http_connect": true,
            "connector_name": ""
        },
        "cert_settings": {
            "dns_names": [
                "cluster1.at.oke-myregion.banyanops.com"
            ],
            "custom_tls_cert": {
                "enabled": false,
                "cert_file": "",
                "key_file": ""
            },
            "letsencrypt": false
        },
        "http_settings": {
            "enabled": false,
            "oidc_settings": {
                "enabled": false,
                "service_domain_name": "",
                "post_auth_redirect_path": "",
                "api_path": "",
                "trust_callbacks": null,
                "suppress_device_trust_verification": false
            },
            "http_health_check": {
                "enabled": false,
                "addresses": null,
                "method": "",
                "path": "",
                "user_agent": "",
                "from_address": [],
                "https": false
            },
            "http_redirect": {
                "enabled": false,
                "addresses": null,
                "from_address": null,
                "url": "",
                "status_code": 0
            },
            "exempted_paths": {
                "enabled": false,
                "patterns": [
                    {
                        "hosts": [
                            {
                                "origin_header": [],
                                "target": []
                            }
                        ],
                        "methods": [],
                        "paths": [],
                        "mandatory_headers": []
                    }
                ]
            },
            "headers": {}
        },
        "client_cidrs": []
    }
}

Please advise.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions