def create_resource(client, module, rest_api_id, parent_id, path_part):
resource = None
try:
resource = client.create_resource(
restApiId=rest_api_id,
pathPart=path_part,
parentId=parent_id
)
except (ClientError, ParamValidationError, MissingParametersError) as e:
module.fail_json(msg="Error creating API resource {0} pid: {1}: {2}".format(path_part, parent_id, e))
return resource
评论列表
文章目录