简体   繁体   English

没有AWS凭证的Terraform运行计划

[英]Terraform run plan without AWS credentials

I wish to run a terraform plan to verify a terraform plan file uploaded by a user and detect the resources. 我希望运行一个Terraform计划,以验证用户上传的Terraform计划文件并检测资源。

However, running terraform plan as of now requires AWS credentials. 但是,从现在开始运行terraform计划需要AWS凭证。

Is there a way to run plan without using the credentials or extract the list of resources in another way from the .tf file? 有没有一种方法可以在不使用凭据的情况下运行计划,或者以其他方式从.tf文件中提取资源列表?

Found a solution here, 在这里找到了解决方案,

https://github.com/terraform-providers/terraform-provider-aws/issues/5584#issuecomment-433203543 https://github.com/terraform-providers/terraform-provider-aws/issues/5584#issuecomment-433203543

Along with the skip_credentials_validation flag, a mock secret_key is also required. 除了skip_credentials_validation标志外,还需要一个模拟secret_key。

provider "aws" {
  region                      = "${var.region}"
  skip_credentials_validation = true
  skip_requesting_account_id  = true
  skip_metadata_api_check     = true
  s3_force_path_style         = true
  access_key                  = "mock_access_key"
  secret_key                  = "mock_secret_key"

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM