Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow for answers
- I've searched for previous similar issues and didn't find any solution
Describe the bug
#3398 resulted in TS libraries consuming the aws-sdk to break if referencing the ConfigurationOptions
type.
Is the issue in the browser/Node.js?
Node.js
If on Node.js, are you running this on AWS Lambda?
Yes (and also on users local machines)
Details of the browser/Node.js version
v12.18.2
SDK version number
v2.743.0
To Reproduce (observed behavior)
Create a typescript file w/ sdk dependency v1.739.0
Import ConfigurationOptions
like so
import { ConfigurationOptions } from 'aws-sdk/lib/config'
Upgrade to sdk >v1.740.0
Import statement can no longer resolve ConfigurationOptions
Expected behavior
ConfigurationOptions is still available at lib/config
entrypoint
Additional context
This is an issue within the aws-cdk. We use ConfigurationOptions
in multiple places to expose sdk configuration options to the user in order for them to customize various behaviors.
It is also used within our custom resource provider framework runtime which runs inside the aws lambda runtime.
This poses a couple of issues for us. We can upgrade our code to point to aws-sdk/lib/config-base
to reference this object, though if a user is running their code inside lambda we don't control the version of the sdk that is present. We have also considered not importing this type and instead writing our own interface that duplicates it. This obviously isn't ideal as if non-breaking changes are made to the interface in the future within aws-sdk-js, we would have to copy those changes in our code to make the feature available.
Since ConfigurationOptions
is exposed on the constructor of the Config
class, our assumption has been its okay to expose this type on our public API for use. Nested import paths can obviously be troublesome for refactoring, can ConfigurationOptions
be exported from the top level along with other TS types exposed by the public API for library authors to reference? This still will break some of our users if they are using an old version of the sdk with a newer version of the cdk and vice-versa, but at least we could provide a fix path to upgrade one or the other.