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

Parameters of ibm_logs_router_tenant should be required instead of Optional #5616

Closed
lionelmace opened this issue Sep 5, 2024 · 1 comment · Fixed by #5634
Closed

Parameters of ibm_logs_router_tenant should be required instead of Optional #5616

lionelmace opened this issue Sep 5, 2024 · 1 comment · Fixed by #5634

Comments

@lionelmace
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

New or Affected Resource(s) or Datasource(s)

  • ibm_logs_router_tenant

Description

Parameters are marked Optional in the doc. They are actually Required as you can see in the API Docs
https://cloud.ibm.com/apidocs/logs-router-service-api/logs-router-v1#create-tenant

Forgetting the parameters will make the terraform apply failed.

[parameters](https://registry.terraform.io/providers/IBM-Cloud/ibm/1.69.0/docs/resources/logs-router_tenant#parameters) - (Optional, List) List of properties returned from a successful list operation for a log-sink of type IBM Log Analysis (logdna). Nested schema for parameters:

Please mark the parameters as required.

@lionelmace
Copy link
Author

The example in the doc

resource "ibm_logs_router_tenant" "logs_router_tenant_instance" {
  name = "my-logging-tenant"
  targets {
        log_sink_crn = "crn:v1:bluemix:public:logdna:eu-de:a/3516b8fa0a174a71899f5affa4f18d78:3517d2ed-9429-af34-ad52-34278391cbc8::"
        name = "my-log-sink"
        parameters {
            host = "www.example.com"
            port = 1
            access_credential = "credential"
        }
  }
}

should be replaced by

resource "ibm_resource_instance" "logs_instance" {
  resource_group_id = local.resource_group_id
  name              = "my-cloud-logs"
  service           = "logs"
  plan              = "standard"
  location          = var.region
  tags              = var.tags
  service_endpoints = "private"

  parameters = {
    ...
  }
}

resource "ibm_logs_router_tenant" "logs_router_tenant_instance" {
  name = "cloud-logs-router"
  targets {
    log_sink_crn = ibm_resource_instance.logs_instance.id
    name = "my-cloud-logs-target"
    parameters {
      host = ibm_resource_instance.logs_instance.extensions.external_ingress_private
      port = 443
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant