sparse-intern-71089
12/14/2021, 9:52 AMprehistoric-activity-61023
12/14/2021, 10:06 AMprehistoric-activity-61023
12/14/2021, 10:07 AMproviders
is of type:
Optional[Union[Mapping[str, 'ProviderResource'], List['ProviderResource']]]
prehistoric-activity-61023
12/14/2021, 10:07 AMprehistoric-activity-61023
12/14/2021, 10:07 AMprehistoric-activity-61023
12/14/2021, 10:08 AM...
providers=[classic_aws_provider, aws_native_provider])
...
prehistoric-activity-61023
12/14/2021, 10:09 AMself
as a parent)prehistoric-activity-61023
12/14/2021, 10:10 AMNote: do not provide both provider and providers.
prehistoric-activity-61023
12/14/2021, 10:12 AMand later onI’m afraid you might somehow set both parameters and that’s the root cause of this.is modified to useopts
parameterproviders
great-sunset-355
12/14/2021, 10:25 AMyou don’t need to explicitly specify providers
- this lead to many problems that created a silent default provider for whatever reason and that's what I want to avoid.
I also tried the list
and it did not go well. Because pulumi silently used a default
provider.
This is what I'm trying to achieve, but I may be misunderstanding something
self._opts = pulumi.ResourceOptions.merge(
opts,
pulumi.ResourceOptions(
parent=self,
providers=[aws_classic_provider, aws_native_provider],
),
)
classic_role = aws_classic.iam.Role(
f"{self._config.name}-classic-role",
args=aws_classic.iam.RoleArgs(assume_role_policy=json.dumps(assume_policy), tags=self._config.tags),
opts=self._opts, # here I expect Pulumi to pick my classic provider
)
native_role = aws_native.iam.Role(
f"{self._config.name}-native-role",
args=aws_native.iam.RoleArgs(
assume_role_policy_document=assume_policy
),
opts=self._opts # here I expect my native provider
)
but the code below ends with
pulumi:providers:aws-native default_4_32_0 1 error
pulumi:providers:aws-native (default_4_32_0):
error: no resource plugin 'aws-native-v4.32.0' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource aws-native v4.32.0`
It looks like something is confused by the mappingprehistoric-activity-61023
12/14/2021, 10:58 AMprehistoric-activity-61023
12/14/2021, 11:02 AMprovider
and providers
.
Can you add a simple print debugging statement and check how this self._opts
actually looks like?
Plus, can you confirm that these resources are created within ComponentResource definition (this is what I assumed based on parent=self
)? If so, how are you creating this resource? Do you specify any opts
in the constructor?great-sunset-355
12/14/2021, 11:19 AMRegarding the default providerYes me too, that's why I inspect the state to make sure that the default provider is not created somehow.
that you defined both provider and providers.No only
providers
heck how this self._opts actually looks like?, ... ComponentResource definition (this...yes it is a ComponentResource and I do not pass
provider
to the constructor, nor providers
. When my ComponentResources need provider I ask for that explicitly rather than assuming it from opts
.prehistoric-activity-61023
12/14/2021, 11:22 AMprehistoric-activity-61023
12/14/2021, 11:22 AMpulumi.ResourceOptions.merge
prehistoric-activity-61023
12/14/2021, 11:23 AMgreat-sunset-355
12/14/2021, 11:26 AMprint
{'merge': <bound method ResourceOptions._merge_instance of <pulumi.resource.ResourceOptions object at 0x7f42bfb39910>>, 'parent': <tqs_infrastructure.components.native_fargate.FargateApp object at 0x7f42bfb39370>, 'protect': None, 'provider': None, 'providers': {'aws': <pulumi_aws.provider.Provider object at 0x7f42bfbd2d90>, 'aws-native': <pulumi_aws_native.provider.Provider object at 0x7f42bfb64370>}, 'delete_before_replace': None, 'ignore_changes': None, 'version': None, 'aliases': None, 'additional_secret_outputs': None, 'custom_timeouts': None, 'id': None, 'import_': None, 'transformations': None, 'urn': None, 'replace_on_changes': None, 'depends_on': []}
to me this looks as expected, though the result is unexpectedNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by