Skip to main content
  1. Docs
  2. Infrastructure as Code
  3. Concepts
  4. Resources
  5. Resource options

Resource options

    All Pulumi IaC resources support a common set of options that allow you to customize how your resources are managed. Resource options allow you to do things like protect resources from being deleted, express more fine-grained control to the order in which resources are changed, or apply custom code that will allow you to change the properties of your resources.

    Resource constructors accept the following resource options. Each option’s reference page describes its behavior in depth and how the Pulumi SDKs enforce which resource types it applies to.

    Resource optionDescriptionApplies to
    additionalSecretOutputsSpecify output properties that must be encrypted as secrets.Custom only
    aliasesSpecify aliases so that renaming or refactoring doesn’t replace a resource.Custom and component
    customTimeoutsOverride the default retry/timeout behavior for resource provisioning.Custom only
    deleteBeforeReplaceDelete the existing resource before creating its replacement.Custom only
    deletedWithSkip this resource’s delete when the named resource is also being deleted.Custom and component
    dependsOnSpecify explicit dependencies in addition to those in the dependency graph.Custom and component
    envVarMappingsRemap environment variables to custom keys for provider authentication.Provider only
    hideDiffsCompact the display of diffs for specified properties in CLI output.Custom only
    hooksRun custom logic at specific points in the resource lifecycle.Custom only
    ignoreChangesIgnore changes to specified properties during a diff.Custom only
    importBring an existing cloud resource under Pulumi management.Custom only
    parentEstablish a parent/child relationship between resources.Custom and component
    protectPrevent accidental deletion by marking the resource as protected.Custom and component
    providerPass an explicitly configured provider instead of the default.Custom only
    providersPass explicitly configured providers for a component’s child resources.Component only
    replaceOnChangesTreat changes to specified properties as forcing a replacement.Custom only
    replaceWithReplace this resource whenever one of the named resources is replaced.Custom only
    replacementTriggerForce a replacement whenever a specified trigger value changes.Custom and component
    retainOnDeleteRetain the resource in the cloud provider when Pulumi deletes it.Custom only
    transformationsDynamically transform a resource’s properties (prefer transforms).Custom and component
    transformsDynamically transform a resource’s properties on the fly.Custom and component
    versionPin the provider plugin version used when operating on a resource.Custom only

    Resource options and component resources

    Not all resource options apply to component resources. Component resources are logical groupings that don’t have a backing cloud provider, so options that affect provider behavior have no effect on the component itself (though they may affect child resources). The Applies to column in the table above shows which options apply to component resources; each option’s reference page explains the behavior in detail.

    When you apply a resource option to a component that doesn’t support it, the option is silently ignored. To apply options like protect or ignoreChanges to the child resources within a component, use the transforms option to modify child resources as they’re created.