damp-fall-55922
06/07/2022, 8:46 PMaws
and aws-native
providers, preferring the native one where available and working.
it works fine, outperforms cloudformation as expected
I then moved that exact same code into a new file and wrapped it in class MyCustomFargateApp(pulumi.ComponentResource):
I passed `opts=pulumi.ResourceOptions(parent=self)`everywhere, and that’s all the changes I did
when I tried to deploy it, I got this error:
Diagnostics:
pulumi:providers:aws-native (default_5_7_0):
error: no resource plugin 'pulumi-resource-aws-native' found in the workspace at version v5.7.0 or on your $PATH, install the plugin using `pulumi plugin install resource aws-native v5.7.0`
which makes no sense because aws-native
is in v0.18.0 and it’s aws
that’s v5.7.0
to debug:
• I nuked venv and __pycache__
• I changed the name of the stack in Pulumi.yaml
• I removed both providers using pulumi plugin rm resource aws
etc
the results are the same
I did the same steps with the working stack without a ComponentResource, it deploys fine from scratch
I repeated the same steps with my broken stack but I commented out *every resource*… it deploys fine, just shows an empty MyCustomFargateApp resource. swell.
I then proceeded to remove comments from resources one by one.
working fine:
• pulumi_aws.route53.Record
• pulumi_aws.iam.Role
• pulumi_aws_native.logs.LogGroup
• pulumi_aws_native.ecs.TaskDefinition
• pulumi_aws.lb.TargetGroup
it blows up when I uncomment the pulumi_aws_native.elasticloadbalancingv2.ListenerRule
it does reference the TargetGroup which comes from aws-classic… but exact same stuff works if not wrapped in a ComponentResource
please advise, I’m losing my mindgreat-queen-39697
06/07/2022, 9:06 PMdamp-fall-55922
06/07/2022, 9:09 PM__init__.py
great-queen-39697
06/07/2022, 9:10 PMdamp-fall-55922
06/07/2022, 9:10 PMmycomponent/__init__.py
and then wrapped it in `class MyCustomFargateApp(pulumi.ComponentResource):``great-queen-39697
06/07/2022, 9:11 PMpulumi up
(or preview) from the root, or from mycomponent
?damp-fall-55922
06/07/2022, 9:11 PM__main__.py
I referenced it as:
app = mycomponent.MyCustomFargateApp(ServiceName, ImageUrl, HealthCheckPath, DesiredCount=DesiredCount, AppListenPort=AppListenPort)
great-queen-39697
06/07/2022, 9:12 PMdamp-fall-55922
06/07/2022, 9:13 PMpulumi_aws.lb.ListenerRule
great-queen-39697
06/07/2022, 9:13 PMdamp-fall-55922
06/07/2022, 9:13 PMgreat-queen-39697
06/07/2022, 9:13 PMdamp-fall-55922
06/07/2022, 9:14 PMgreat-queen-39697
06/07/2022, 9:14 PMdamp-fall-55922
06/07/2022, 9:15 PMgreat-queen-39697
06/07/2022, 9:15 PMdamp-fall-55922
06/07/2022, 9:15 PMgreat-queen-39697
06/07/2022, 9:15 PMdamp-fall-55922
06/07/2022, 9:15 PMgreat-queen-39697
06/07/2022, 9:16 PMbillowy-army-68599
06/07/2022, 10:39 PMpulumi stack export
(which should give you a JSON representation of the entire project) and look through it for the offending resource? it should have a provider associated with itdamp-fall-55922
06/07/2022, 10:46 PMpulumi_aws.lb.ListenerRule
implementation and uncommented the pulumi_aws_native.elasticloadbalancingv2.ListenerRule
implementation and this is what pulumi up
looks like https://l.hr/GRqqe9billowy-army-68599
06/07/2022, 10:59 PMdamp-fall-55922
06/07/2022, 11:00 PMopts=pulumi.ResourceOptions(parent=self, version="0.18.0")
it works exactly like I’d want it to 😄opts=child_opts
over and over again — it failsopts=pulumi.ResourceOptions(parent=self)
, it works fineaws
package versionpulumi.ResourceOptions
, and then pass that into a mixture of pulumi_aws
and pulumi_aws_native
resources via opts=my_opts
, the first one will
if opts.version is None:
opts.version = _utilities.get_version()
which will set “version” on the my_opts object and that will then get passed into the next resource which will reuse the version as if it was hardcodedbillowy-army-68599
06/07/2022, 11:11 PMdamp-fall-55922
06/07/2022, 11:12 PMgreat-queen-39697
06/08/2022, 3:41 PMdamp-fall-55922
06/08/2022, 3:44 PMbillowy-army-68599
06/08/2022, 3:49 PM