* Implement first-class providers for Python First-class providers are an explicit projection of providers themselves into Pulumi programs. For the most post, providers are just regular resources, but the addition of providers to the fray (and the ability of resources to be constructed by providers in the same program) requires some changes to the Python resource model. A summary of the changes: 1. Added ProviderResource, a custom resource that is the base class of all providers. 2. ResourceOptions now has 'provider' and 'providers' fields. 'provider', when passed to a custom resource, allows users to override the provider that is used to construct a resource to an instance of a ProviderResource. 'providers', when passed to a component resource, allows users to override providers used to construct children of the component resource. 3. 'protect', 'providers', and 'provider' are all now inherited from a resource's parent if they aren't specified in the child. This commit adds the requisite code for the above changes and, in addition, adds a number of new tests that exercise them and related code paths. * Rebase against master
13 lines
589 B
Python
13 lines
589 B
Python
# Copyright 2016-2018, Pulumi Corporation.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|