-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opensearch,elasticsearch,events-targets: Custom Resources provided in these modules always attempt to install latest version of AWS SDK v2 #23113
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Comments
mrgrain
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Nov 28, 2022
github-actions
bot
added
the
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
label
Nov 28, 2022
peterwoodworth
added
p1
effort/medium
Medium work item – several days of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Nov 29, 2022
Let's:
|
rix0rrr
added a commit
that referenced
this issue
Jan 6, 2023
The `AwsCustomResource` reaches out to the internet to install the latest AWS SDK by default. This will make it fail if it is being bound to a VPC that doesn't have internet connectivity, or in regions/partitions that are not able to freely connect to `npmjs.com`. This was a poorly chosen default from the time we didn't know any better, but we do know right now. Switch the behavior off by default (under feature flag), and explicitly disable it for all `AwsCustomResource`s the L2 library uses. Lambda advertises 2.1055.0 of the SDK everywhere, and I checked to make sure that all APIs we use are part of that SDK version, so we don't need any newer version. That version is a year old (!) so this is not the end of the story, but it's at least an improvement over what we currently have. Fixes #23113.
mergify bot
pushed a commit
that referenced
this issue
Jan 10, 2023
…#23591) The `AwsCustomResource` reaches out to the internet to install the latest AWS SDK by default. This will make it fail if it is being bound to a VPC that doesn't have internet connectivity, or in regions/partitions that are not able to freely connect to `npmjs.com`. This was a poorly chosen default from the time we didn't know any better, but we do know right now. Switch the behavior off by default (under feature flag), and explicitly disable it for all `AwsCustomResource`s the L2 library uses. Lambda advertises 2.1055.0 of the SDK everywhere, and I checked to make sure that all APIs we use are part of that SDK version, so we don't need any newer version. That version is a year old (!) so this is not the end of the story, but it's at least an improvement over what we currently have. Fixes #23113. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
DerkSchooltink
pushed a commit
to DerkSchooltink/aws-cdk
that referenced
this issue
Jan 23, 2023
…aws#23591) The `AwsCustomResource` reaches out to the internet to install the latest AWS SDK by default. This will make it fail if it is being bound to a VPC that doesn't have internet connectivity, or in regions/partitions that are not able to freely connect to `npmjs.com`. This was a poorly chosen default from the time we didn't know any better, but we do know right now. Switch the behavior off by default (under feature flag), and explicitly disable it for all `AwsCustomResource`s the L2 library uses. Lambda advertises 2.1055.0 of the SDK everywhere, and I checked to make sure that all APIs we use are part of that SDK version, so we don't need any newer version. That version is a year old (!) so this is not the end of the story, but it's at least an improvement over what we currently have. Fixes aws#23113. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/custom-resources
Related to AWS CDK Custom Resources
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Describe the bug
The following built-in Custom Resources force the install of the latest AWS SDK version in their Lambda which will fail in environments with restricted internet access (e.g. China Regions or when internet access is disabled in Lambdas):
OpenSearchAccessPolicy
inaws-elasticsearch
ElasticsearchAccessPolicy
inaws-opensearch
LogGroupResourcePolicy
inaws-elasticsearch
,aws-opensearch
andaws-events-targets
There is no way to disable this behavior, because the resources extend
AwsCustomResource
which defaultsinstallLatestAwsSdk
totrue
. They do not provide an option to disable this.Expected Behavior
The affected resources do not attempt to install the latest SDK version. All API request for these resources are known so it's not required to have the latest version available.
Current Behavior
They always attempt to install the latest SDK version.
Reproduction Steps
Possible Solution
It should be possible to ascertain if the used APIs are available in the default SDK
Then add
installLatestAwsSdk: false
to hereSimilar to how we provide the AWS CLI already
Additional Information/Context
Workaround:
CDK CLI Version
2.52.20
Framework Version
2.52.0
Node.js Version
any
OS
macos
Language
Typescript, Python, .NET, Java, Go
Language Version
No response
Other information
These Custom Resources currently run in
nodejs14.x
which defaults the AWS SDK for JS to version2.1055.0
(source).I have checked and confirm that the API for
OpenSearchAccessPolicy
&ElasticSearchAccessPolicy
is available in this particular version of the SDK.The text was updated successfully, but these errors were encountered: