https://pulumi.com logo
#general
Title
# general
b

busy-island-31180

03/16/2022, 2:52 AM
I just want some arbitrary resource that fits the
pulumi.Resource
interface
e

echoing-dinner-19531

03/16/2022, 9:14 AM
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

03/16/2022, 3:10 PM
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.
5 Views