quaint-tailor-52411
04/16/2024, 9:56 PMgcp.compute.FirewallAllowArgs
sometimes the dicts work, sometimes they don'tgreat-sunset-355
04/17/2024, 11:31 AMArgs
, all other SDKs have the same API Resource("name", args, opts)
hundreds-gpu-71155
04/17/2024, 3:10 PMhundreds-gpu-71155
04/17/2024, 3:11 PM*Args
classes for things. I think it's common for them to accept dict
as well, I don't think it's documented so I wouldn't be surprised if this support is spotty.great-sunset-355
04/17/2024, 4:07 PM__init__
overrides with
def __init__(__self__,
resource_name: str,
args: Optional[CertificateArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
or
def __init__(__self__, resource_name: str, *args, **kwargs)
# or
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
certificate_authority_arn: Optional[pulumi.Input[str]] = None,
certificate_body: Optional[pulumi.Input[str]] = None,
certificate
This is not the case for other SDKs (TS, Go, .NET) where the structure follows this style with args
and opts
def __init__(__self__,
resource_name: str,
args: Optional[CertificateArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
also, properties have Args eg CertificateOptionsArgs
-> https://github.com/pulumi/pulumi-aws/blob/master/sdk/python/pulumi_aws/acm/certificate.py#L641C67-L641C89
The reason I recommend this style
Certificate("name", CertificateArgs(certificate_options=CertificateOptionsArgs()...), ResourceOptions())
while pretty ugly (IMO) it gives the best intellisense / code completion with typing.
This pattern is super elegant in TypeScript where it would look like:
new Certificate("name", {certificateOptions:{} }, {parent:""})
And IDE gives you all you need and more when you expand {}
Hence my high hopes for TypedDict in python because it would make it also quite eleganthundreds-gpu-71155
04/17/2024, 4:08 PMhundreds-gpu-71155
04/17/2024, 4:08 PMquaint-tailor-52411
04/17/2024, 8:01 PMquaint-tailor-52411
04/17/2024, 8:02 PMwhile pretty ugly (IMO) it gives the best intellisense / code completion with typing.is that constructor style supported for all resources? can start to use those if the intellisense works