Skip to content

Using provider.environment as replacement for exporting outputs can lead to circular dependencies #58

@btisdall

Description

@btisdall

Sorry if I'm missing somnething here but the suggested workaround for cases that previously used exported outputs is to make use of provider.environment can result in circular dependencies. Placing a reference in provider.environment of course this places the ref in all functions' environments and can lead to this situation:

Resource B [via environment] <-- Resource A <-- Resource B [referenced in provider.environment]

The hack I'm using to work around this is to create a dummy lambda purely to export Resouce B's reference:

  dummyHandler:
    handler: functions/dummy.handler
    environment:
      RESOURCE_B_REF: !Ref CognitoUserPool

Thus Resource A no longer depends on Resource B but the plugin is still able to aggregate the exports.

The above is pretty horrible and I would not use this in production but it unblocks me at a moment when I don't have time to use a new solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions