Instance Profile creation via the Databricks REST API returns "INVALID_PARAMETER_VALUE"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 02:46 AM
# Problem Statement
We have a need to create Instance Profiles via the Databricks REST API, but the endpoint returns an "INVALID_PARAMETER_VALUE" error with "Syntactically invalid AWS instance profile ARN" message even when provided an appropriate ARN as input.
# What's been done
- Creating Role and Instance Profile on Databricks AWS account via AWS CLI
- Calling /instance-profiles/add to register Instance Profile in Databricks
# Code
def create_instance_profile(instance_profile_arn, skip_validation = False):
api_command = '/instance-profiles/add'
api_version = f'/api/2.0'
url = f"https://{DATABRICKS_HOST}{api_version}{api_command}"
params = {
"instance_profile_arn" : instance_profile_arn,
"skip_validation" : skip_validation,
"is_meta_instance_profile" : False
}
header = {
"accept": "application/scim+json",
"Authorization": f"Bearer {DATABRICKS_TOKEN}"
}
response = requests.post(url, params = params, headers=header)
print(json.dumps(json.loads(response.text), indent = 2))
arn = "arn:aws:iam::<account_id>:instance-profile/my-instance-profile-name"
create_instance_profile(arn)
- Labels:
-
Instance Profile
-
Rest API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2023 11:10 PM
Hi, Is this a constant error or intermittent? For newly added profiles AWS has a buffer time and sometimes it is intermittent. Also, could you please provide the full error here along with the screenshot? (Also, you can refer: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_iam-ec2.html)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 12:38 AM
Hi @Debayan Mukherjee , I havn't been able to make a successful request via the API (although I'm able to list the instance profiles on our Databricks account via the API), but I can add the instance profile via the Databricks UI without problem.
Here's the response from the Databricks API.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 09:53 PM
Hi @lasse Lidegaard
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!

