Skip to content

Allow setting project at the provider level #517

@lgfa29

Description

@lgfa29

Overview

Currently the Oxide project used in API calls needs to be set for each resource and data source. This creates a lot of unnecessary duplication and boilerplate.

Other providers (like aws and google), have similar concepts (region and project) that need to be defined on every API call, but they allow users to set them at the provider level. This becomes the default when resources and data sources don't specify a different value.

Implementation details

The provider schema needs to be update to accept a new (optional) project string attribute, and each resource and data source that have a project or project_id attribute needs to be updated to set this attribute to optional as well.

When making API calls, the provider must check the resource or data source value first, then fallback to the provider if not specified.

The provider variable could also be tied to a OXIDE_PROJECT environment variable.

Anything else you would like to add?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions