Hi guys. I need a little help with automation API ...
# automation-api
b
Hi guys. I need a little help with automation API with Python. I am implementing an internal tool for my company were the devs can spin up instances in different AWS regions to test customer integrations. I am using
Component Resources
to create VPC and internet gateways. I need to fetch availability zones for the given region for subnets and the region will be passed as JSON in the API. Here is my code looks like:
Copy code
class VPC(pulumi.ComponentResource):
    def __init__(self, name: str, stack_args: AWSStackBase, opts: pulumi.ResourceOptions=None):

        super().__init__("Custom:Component:VPC", name, {}, opts)
       
        self.availability_zones = aws.get_availability_zones(filters[{
           "name": "region-name",
           "values": [f"{stack_args.region}"]         
        }])
This is giving this error:
Copy code
AttributeError: 'NoneType' object has no attribute 'Invoke'
Any help in solving this would be highly appreciated.