glamorous-answer-86536
12/07/2022, 11:23 AMpulumi-awsx
to a newly created account using `assume_role`:
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:
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:
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
glamorous-answer-86536
12/07/2022, 12:07 PM