Terraform "google_api_gateway_api_config": params "openapi_documents.document.path" vs. "content"

85 Views Asked by At

I'm reading the sample code for the Terraform resource google_api_gateway_api_config:

resource "google_api_gateway_api_config" "api_cfg" {
  ...
  openapi_documents {
    document {
      path = "spec.yaml"
      contents = filebase64("test-fixtures/apigateway/openapi.yaml")

Question: Why are both path and contents needed (wouldn't path imply contents)? Why does the sample code use 2 different folders/filenames -- shouldn't they use the same folder/filename?

In comparison, the CLI gcloud api-gateway api-configs create has just 1 (as opposed to 2) param: --openapi-spec which is the local folder/filename such as /tmp/openapi_spec.yaml (and therefore implies the file content).

0

There are 0 best solutions below