使用地形進行叢集部署疑難排解 - AWS ParallelCluster

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用地形進行叢集部署疑難排解

本節與使用 Terraform 部署的叢集相關。

ParallelCluster 找不到 API

規劃可能會失敗,因為找不到 ParallelCluster API。在這種情況下,返回的錯誤將是這樣的:

Planning failed. Terraform encountered an error while generating this plan. ╷ │ Error: Unable to retrieve ParallelCluster API cloudformation stack. │ │ with provider["registry.terraform.io/aws-tf/aws-parallelcluster"], │ on providers.tf line 6, in provider "aws-parallelcluster": │ 6: provider "aws-parallelcluster" { │ │ operation error CloudFormation: DescribeStacks, https response error StatusCode: 400, RequestID: REQUEST_ID, api error ValidationError: Stack with id PCAPI_STACK_NAME does not exist

若要解決此錯誤,請在要建立叢集的帳戶中部署 ParallelCluster API。請參閱使用地形建立叢集

未授權呼叫 ParallelCluster API 的使用者

規劃可能會失敗,因為您假設部署 Terraform 專案的 IAM 角色/使用者沒有與 API 互動的權限。 ParallelCluster 在這種情況下,返回的錯誤將是這樣的:

Planning failed. Terraform encountered an error while generating this plan. │ Error: 403 Forbidden │ │ with module.parallelcluster_clusters.module.clusters[0].pcluster_cluster.managed_configs["DemoCluster01"], │ on .terraform/modules/parallelcluster_clusters/modules/clusters/main.tf line 35, in resource "pcluster_cluster" "managed_configs": │ 35: resource "pcluster_cluster" "managed_configs" { │ │ {{"Message":"User: USER_ARN is not authorized to perform: execute-api:Invoke on resource: PC_API_REST_RESOURCE with an explicit deny"} │ }

若要解決此錯誤,請設定 ParallelCluster 提供者,使其使用 ParallelCluster API 角色與 API 互動。

provider "aws-parallelcluster" { region = var.region profile = var.profile api_stack_name = var.api_stack_name **use_user_role** **= true** }