bored-barista-2348001/25/2022, 12:42 PM
. I could not find any mention of this error specific to this class. I also could't find any helpful examples of how to use transformations other than the mentioned one. Anyone have a clue why it does not work and how to fix it?
TypeError: 'ResourceTransformationArgs' object is not subscriptable
prehistoric-activity-6102301/25/2022, 1:40 PM
, you try to use
(it’s copy’n’paste example from the docs)
import pulumi import pulumi_kubernetes as k8s # Create resources from standard Kubernetes guestbook YAML example. def make_frontend_public(obj): if obj['kind'] == "Service" and obj['metadata']['name'] == "frontend": obj['spec']['type'] = "LoadBalancer" guestbook = k8s.yaml.ConfigFile('guestbook', 'guestbook-all-in-one.yaml', transformations=[make_frontend_public])
• pulumi cli version
• python modules
You can also try to upgrade the dependencies first and see if that resolves the issue.
(within venv) pip freeze | grep pulumi
bored-barista-2348001/25/2022, 2:31 PM
Obviously I am trying to use the subscript functionality. But that's how it is used in the example as well. I think I even used it like that before. That's why I'm irritated.
pulumi==3.22.1 pulumi-aws==4.35.0 pulumi-eks==0.36.0 pulumi-kubernetes==3.14.1
prehistoric-activity-6102301/25/2022, 3:00 PM
field and not using generic resource transformations available through
and `pulumi.ResourceOptions`: WORKING EXAMPLE
guestbook = k8s.yaml.ConfigFile( 'guestbook', 'guestbook-all-in-one.yaml', transformations=[make_frontend_public], )
guestbook = k8s.yaml.ConfigFile( 'guestbook', 'guestbook-all-in-one.yaml', opts=pulumi.ResourceOptions(transformations=[make_frontend_public]), )
bored-barista-2348001/25/2022, 3:23 PM