b

    busy-island-31180

    6 months ago
    I just want some arbitrary resource that fits the
    pulumi.Resource
    interface
    e

    echoing-dinner-19531

    6 months ago
    There's some docs about tests and mocks at https://www.pulumi.com/docs/guides/testing/unit/ But it looks like your asking how to write a new simple type that is a
    Resource
    ? I think that would just be setting up the mocks as documented above and calling
    ctx.RegisterResource("package:module:type", name, args, &resource, opts...)
    with your made up resource type.
    b

    busy-island-31180

    6 months ago
    I found that I needed a struct that embeds pulumi.ResourceState or pulumi.CustomResourceState in order to get a struct that adheres to the Resource interface. In addition to what you mentioned, the registration.