Hi, I’m not sure if this is the correct medium to ...
# python
a
Hi, I’m not sure if this is the correct medium to ask if something is a bug. I’m looking at
pulumi_aws/s3/bucket_replication_config.py
. `class BucketReplicationConfig(pulumi.CustomResource).`` pulumi-aws==6.13.0 The first constructor at bucket_replication_config.py:163, the rules argument says it’s optional, however, when I called BucketReplicationConfig with resource_name, bucket, role I get an error/Exception
Copy code
raise TypeError("Missing required property 'rules'")
    TypeError: Missing required property 'rules'
Is this a bug? If so, is this the right place to report it?
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!