Python GCP部署管理器-“;配置文件无效:模板获取失败:找不到导入的模板';api.py';对于资源“;

Python GCP部署管理器-“;配置文件无效:模板获取失败:找不到导入的模板';api.py';对于资源“;,python,api,google-cloud-platform,yaml,google-deployment-manager,Python,Api,Google Cloud Platform,Yaml,Google Deployment Manager,获取以下.yaml文件: imports: - path: apis.py resources: - name: test-project type: cloudresourcemanager.v1.project properties: name: test-project projectId: test-project parent: type: folder id: '' - name: billing_test-project

获取以下.yaml文件:

imports:
- path: apis.py
resources:
- name: test-project
  type: cloudresourcemanager.v1.project
  properties:
    name: test-project
    projectId: test-project
    parent:
      type: folder
      id: ''
- name: billing_test-project
  type: deploymentmanager.v2.virtual.projectBillingInfo
  metadata:
    dependsOn:
    - test-project
  properties:
    name: projects/test-project
    billingAccountName: billingAccountName
- name: apis
  type: apis.py
  properties:
    project: test-project
    billing: billing_test-project
    apis:
    - compute.googleapis.com
    concurrent_api_activation: true
- name: set-export-bucket
  action: gcp-types/compute-v1:compute.projects.setUsageExportBucket
  properties:
    project: test-project
    bucketName: gs://export-bucket
    reportNamePrefix: usage_gce_
  metadata:
    dependsOn:
    - test-project
    - test-project-compute.googleapis.com
使用GCP部署管理器API发布此YAML时,我收到以下错误消息:

无效的配置文件:模板获取失败:找不到资源{name=api,属性{api=[compute.googleapis.com],计费=billing\u test-project,并发\u api\u activation=true,project=test project},type=api.py}的导入模板“api.py”

我遵循了创建模板()的文档,“api.py”文件取自项目创建示例:

我真的不确定我做错了什么。我在另一篇帖子中发现了另一位用户遇到的类似问题,但答案是使用模式: (

但是,我发现最近的一篇文章说,您不需要指定模式:


那么,是哪一个呢?如果我确实需要指定一个模式,那么仅使用.py文件会是什么样子?(我的配置中根本没有任何.jinja文件。)

可能需要在YAML上指定将API.py放入计算机的路径才能找到它。

这是最可能的情况。
路径
字段必须是绝对或相对路径。