F5Networks / f5-bigip-runtime-init

Apache License 2.0
14 stars 15 forks source link

metadataProvider does not provide the ability to query all valid attributes #36

Closed njculver closed 2 years ago

njculver commented 2 years ago

When using runtime-init for the various cloud providers, the metadataProvider config only allows you to query specific values due to schema constraints (see: https://github.com/F5Networks/f5-bigip-runtime-init/blob/main/src/schema/base_schema.json#L187-L239) despite the cloudClient.ts functions being parameterized to allow passing any valid fields (example for gcp: https://github.com/F5Networks/f5-bigip-runtime-init/blob/main/src/lib/cloud/gcp/cloudClient.ts#L105-L180).

The schema should be updated to allow for querying all valid values using the metadata provider rather than having to query the metadata URL directly.

andreykashcheev commented 2 years ago

Using type:URL parameter should allow to workaround this problem; here is an example how to get zone/region value from Google Cloud Metadata Service:

    runtime_parameters:
      - name: REGION
        type: url
        value: http://metadata.google.internal/computeMetadata/v1/instance/zone
        headers:
            - name: Metadata-Flavor
              value: Google

https://github.com/F5Networks/f5-bigip-runtime-init#runtime-parameters

here is link to Google Cloud Docs with more info around accessing metadata: https://cloud.google.com/compute/docs/metadata/default-metadata-values

shyawnkarim commented 2 years ago

Closing.

Please reopen if you would still like additional help.