Skip to main content

alien_resource

Attribute Macro alien_resource 

Source
#[alien_resource]
Expand description

Makes a struct an extension’s resource type: #[alien_resource(type = "acme/dns-zone", outputs = DnsZoneOutputs, lifecycles = [Frozen, Live], holds_data = false)].

It writes the type’s RESOURCE_TYPE, ResourceDefinition for the struct (which needs an id: String field), ResourceOutputsDefinition for its outputs, and the extension SDK’s AlienResource, whose consts the type’s descriptor is built from. The expansion names alien_extension_sdk, so it is for an extension’s types crate.