Create connector is failing with 502 and permission error for openai embedding

I am following below blueprint for creating openai embedding connector with opensearch 2.11

when I execute below request it error out with “Request failed to get to the server (status code: 502)”

POST /_plugins/_ml/connectors/_create
{
  "name": "text-embedding-3-small",
  "description": "text-embedding-3-small",
  "version": "1",
  "protocol": "https",
  "parameters": {
    "model": "text-embedding-3-small",
    "endpoint": "api.openai.com"
  },
  "credential": {
    "openAI_key": "api-key"
  },
  "actions": [
    {
      "action_type": "predict",
      "method": "POST",
      "url": "${parameters.endpoint}/v1/embeddings",
      "headers": {
        "Authorization": "Bearer ${credential.openAI_key}"
      },
      "request_body": "{ \"input\": ${parameters.input}, \"model\": \"${parameters.model}\" }",
      "pre_process_function": "connector.pre_process.openai.embedding",
      "post_process_function": "connector.post_process.openai.embedding"
    }
  ]
}

It seems that in case of AWS Opensearch Service we have to provide role and secretto api-key

Now payload has been changed to

{
  "name": "text-embedding-3-small",
  "description": "text-embedding-3-small",
  "version": "1",
  "protocol": "https",
  "parameters": {
    "model": "text-embedding-3-small"
  },
  "credential": {
    "secretArn": "arn:aws:secretsmanager:ap-northeast-1:xxxx:secret:openapikey-bRLaNi",
    "roleArn": "arn:aws:iam::xxxx:role/opensearch-secretmanager-role"
  },
  "actions": [
    {
      "action_type": "predict",
      "method": "POST",
      "url": "https://api.openai.com/v1/embeddings",
      "headers": {
        "Authorization": "Bearer ${credential.secretArn.key}"
      },
      "request_body": "{ \"input\": ${parameters.input}, \"model\": \"${parameters.model}\" }",
      "pre_process_function": "connector.pre_process.openai.embedding",
      "post_process_function": "connector.post_process.openai.embedding"
    }
  ]
}

But now it is erroring out with

no permissions for [cluster:admin/opensearch/ml/create_connector] and User [name=arn:aws:iam::xxxx:user/opensearch-user, backend_roles=, requestedTenant=null]