Hi, I am trying to deploy a VPC with `pulumi-awsx`...
# general
g
Hi, I am trying to deploy a VPC with
pulumi-awsx
to a newly created account using `assume_role`:
Copy code
import pulumi
import pulumi_aws as aws
import pulumi_awsx as awsx

config: dict = {
    "skip_credentials_validation": True,
    "skip_metadata_api_check": False,
}

org_provider = aws.Provider("org-provider", **config)

account = aws.organizations.Account(
    "account", email="<mailto:test@example.com|test@example.com>", role_name="account-role", opts=pulumi.ResourceOptions(provider=org_provider)
)

provider = aws.Provider(
    "account-provider",
    assume_role=aws.ProviderAssumeRoleArgs(
        role_arn=pulumi.Output.concat("arn:aws:iam::", account.id, ":role/", account.role_name)
    ),
    **config
)

vpc = awsx.ec2.Vpc("vpc", opts=pulumi.ResourceOptions(provider=provider))
This throws an error on
pulumi preview
already:
Copy code
Exception: Cannot read properties of undefined (reading 'length')
    error: TypeError: Cannot read properties of undefined (reading 'length')
        at Vpc.getDefaultAzs (/snapshot/awsx/bin/ec2/vpc.js:184:26)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at Vpc.initialize (/snapshot/awsx/bin/ec2/vpc.js:45:103)
My dependencies are:
Copy code
pulumi==3.48.0
pulumi-aws==5.23.0
pulumi-awsx==1.0.0
When I comment out
assume_role
it works. It looks like it cannot resolve tha availability zones. When I add
availability_zone_names=["eu-central-1a", "eu-central-1b"]
to
awsx.ec2.Vpc
explicitly, it works as well. Is that intended behaviour? Am I missing something?
@billowy-army-68599 Is that a bug or intended behaviour?
b
Looks like a bug, please file an issue
g