hallowed-postman-2096
03/24/2023, 11:32 PMimport pulumi_aws_native as aws_native
aws_native.dynamodb.Table(
table_id,
table_name="example",
billing_mode="PROVISIONED",
opts=pulumi.ResourceOptions(protect=True),
attribute_definitions=[
aws_native.dynamodb.TableAttributeDefinitionArgs(
attribute_name="PrimaryKey",
attribute_type="S",
)
],
provisioned_throughput=aws_native.dynamodb.TableProvisionedThroughputArgs(
read_capacity_units=100,
write_capacity_units=1,
),
key_schema=[
aws_native.dynamodb.TableKeySchemaArgs(
attribute_name="PrimaryKey",
key_type="HASH",
),
],
)
And here is the error:
raise AssertionError(f"Unexpected type. Expected 'list' got '{typ}'")
AssertionError: Unexpected type. Expected 'list' got 'typing.Union[typing.Sequence[typing.Union[pulumi_aws_native.dynamodb._inputs.TableKeySchemaArgs, typing.Awaitable[pulumi_aws_native.dynamodb._inputs.TableKeySchemaArgs], pulumi.output.Output[NoneType]]], typing.Any, typing.Awaitable[typing.Union[typing.Sequence[typing.Union[pulumi_aws_native.dynamodb._inputs.TableKeySchemaArgs, typing.Awaitable[pulumi_aws_native.dynamodb._inputs.TableKeySchemaArgs], pulumi.output.Output[NoneType]]], typing.Any]], pulumi.output.Output[NoneType]]'
More info here. Appreciate any guidance, Thanks !creamy-monkey-35142
03/25/2023, 1:15 PMUnion typing is only needed when you have a statically typed language, as you need to declare that an object can return one of multiple types (in your case an int or str, or in the other example str or NoneType)
hallowed-postman-2096
03/27/2023, 4:45 PM