This message was deleted.
# python
s
This message was deleted.
d
The constructor types aren't as correct as they should be in python, there's an issue tracking it already for improving type hints in general. For now, you could use the Args classes which don't have the Optional problem: https://github.com/pulumi/pulumi-aws/blob/d5769a074562fabb115bd3b8a73e355ce9380c34/sdk/python/pulumi_aws/s3/bucket_replication_config.py#L17
a
OK, will try, thank you.
This is my call
Copy code
aws.s3.BucketReplicationConfig(
            resource_name="source-to-replica",
            args=aws.s3.BucketReplicationConfigArgs(
                bucket=destination_bucket_id
                role=replication_role_arn
        )
getting
Copy code
TypeError: BucketReplicationConfigArgs.__init__() missing 1 required keyword-only argument: 'rules'
d
Yes, you need to specify rules
a
So it’s a documentation bug?
d
a
Sorry, I was referring back to the question that started the thread.
Copy code
def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 bucket: Optional[pulumi.Input[str]] = None,
                 role: Optional[pulumi.Input[str]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['BucketReplicationConfigRuleArgs']]]]] = None,
                 token: Optional[pulumi.Input[str]] = None,
                 __props__=None):
d
Oh. Yes, there's a bug in the code gen that marks all inputs as optional for resources in python. Using the Args class gives you correct types
a
Thank you
Sorry, side-bar, the way I’m trying to create bucket replication, is it more or less “depricated” ? I see this “replicatedbucket” https://pypi.org/project/pulumi-aws-s3-replicated-bucket/
d
I generally don't use the component packages like what you've just linked. They're not maintained well and rarely add much
a
Great, thank you!