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:

    • additionalSecretOutputs: specify properties that must be encrypted as secrets.
    • aliases: specify aliases for this resource, so that renaming or refactoring doesn’t replace it.
    • customTimeouts: override the default retry/timeout behavior for resource provisioning. The default value varies by resource.
    • deleteBeforeReplace: override the default create-before-delete behavior when replacing a resource.
    • deletedWith: If set, the provider’s Delete method will not be called for this resource if the specified resource is being deleted as well.
    • replaceWith: If set, the resource will be replaced if one of the specified resources is replaced.
    • dependsOn: specify additional explicit dependencies in addition to the ones in the dependency graph.
    • hideDiffs: compact the display of diffs for specified properties in CLI output without affecting update behavior.
    • hooks: specify a set of resource hooks that will be executed at specific points in the resource lifecycle.
    • ignoreChanges: declare that changes to certain properties should be ignored during a diff.
    • import: bring an existing cloud resource into Pulumi.
    • parent: establish a parent/child relationship between resources.
    • protect: prevent accidental deletion of a resource by marking it as protected.
    • provider: pass an explicitly configured provider, instead of using the default global provider.
    • providers: pass a set of explicitly configured providers. These are used if provider is not given, and are passed to child resources.
    • replaceOnChanges: declare that changes to certain properties should be treated as forcing a replacement.
    • retainOnDelete: if true the resource will be retained in the backing cloud provider during a Pulumi delete operation.
    • transformations: dynamically transform a resource’s properties on the fly. Prefer transforms if possible. transformations will be deprecated in the future in favor of transforms.
    • transforms: dynamically transform a resource’s properties on the fly.
    • version: pass a provider plugin version that should be used when operating on a resource.

    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).

    Resource optionApplies to components?Notes
    additionalSecretOutputsNoComponents don’t have provider-managed outputs
    aliasesYesWorks for renaming or refactoring components
    customTimeoutsNoComponents don’t have provider operations to time out
    deleteBeforeReplaceNoComponents are not replaced by providers
    deletedWithYesControls deletion behavior
    dependsOnYesCreates explicit dependencies on the component
    hideDiffsNoComponents don’t have provider-generated diffs
    hooksNoComponents don’t have provider lifecycle events
    ignoreChangesNoComponents don’t have provider-managed inputs. The component implementation may choose to propagate this to children.
    importNoComponents cannot be imported from cloud providers
    parentYesEstablishes parent-child relationships
    protectYesProtects the component from deletion
    providerNoUse providers instead for component resources
    providersYesPass providers to use for child resources
    replaceOnChangesNoComponents are not replaced by providers
    replaceWithNoComponents are not replaced by providers
    retainOnDeleteNoComponents don’t have cloud resources to retain
    transformationsYesTransform child resources within the component
    transformsYesTransform child resources within the component
    versionNoComponents don’t use provider plugins
    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.
      Neo just got smarter about infrastructure policy automation