Terraform script is not executing curl command inside null_resource

I’m trying to build jenkins API job using terraform and using null_resource to execute curl inside it, also using MySQL provisioner in same .tf file to create user in MySQL server. Terraform is provisioning MySQL user but not creating API job in jenkins? Also run the curl command from local it is creating job in jenkins.

provider "mysql" {
endpoint = "${var.db_endpoint}"
username = "${var.database_username}"
password = "${var.database_password}"

resource "mysql_database" "app" {
name = "${var.database_name}"

resource "mysql_user" "Anviton" {
user               = "${var.db_user}"
host               = "${var.host}"
plaintext_password = "${var.db_user_password}"

resource "mysql_grant" "Anviton" {
user       = "${mysql_user.Anviton.user}"
host       = "${mysql_user.Anviton.host}"
database   = "app"
privileges = ["SELECT", "UPDATE"]

resource "null_resource" "ott-jenkins-api-job" {
provisioner "local-exec" {
   curl -s -o /dev/null -w "%%{http_code}" -X POST   "" -u  username:password  --data-binary @Phando_BhaktiNow_Ott_Prod.xml -H  "Content-Type:text/xml" 

The null_resource gets run before the sql resource (to visualize run terraform graph | dot -Tsvg and paste the output to an online svg renderer).
You can try dropping the resource “null_resource” entirely and move the provisioner “local-exec” into the sql resource, or a more robust solution would be to add a trigger into the null_resource that depends on an output of the sql resource.