Skip to content

Commit

Permalink
fix(eks): undefined constructor in custom resource (#26782)
Browse files Browse the repository at this point in the history
When we [upgraded the proxy-agent v6](#26722) we did not update how we were importing from the package. Where [in 5.0 commonjs exports were used](https://github.com/TooTallNate/node-proxy-agent/blob/5.0.0/index.js#L25) , in [6.0 a named esm export is used](https://github.com/TooTallNate/proxy-agents/blob/proxy-agent%406.1.0/packages/proxy-agent/src/index.ts#L71).

Updated to use a named import statement instead of a default require. Typescript also confirms the old import was an error now since we use `import` instead of `require`.

Fixes: #26771

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
MrArnoldPalmer authored Aug 16, 2023
1 parent cef7136 commit 0b8f31d
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 93 deletions.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import { EKS } from '@aws-sdk/client-eks';
import { fromTemporaryCredentials } from '@aws-sdk/credential-providers';
// eslint-disable-next-line import/no-extraneous-dependencies
import { NodeHttpHandler } from '@aws-sdk/node-http-handler';
// eslint-disable-next-line import/no-extraneous-dependencies
import { ProxyAgent } from 'proxy-agent';
import { ClusterResourceHandler } from './cluster';
import { EksClient } from './common';
import * as consts from './consts';
import { FargateProfileResourceHandler } from './fargate';
import { IsCompleteResponse } from '../../../custom-resources/lib/provider-framework/types';

// eslint-disable-next-line @typescript-eslint/no-require-imports, import/no-extraneous-dependencies
const ProxyAgent = require('proxy-agent');

const proxyAgent = new ProxyAgent();
const awsConfig = {
logger: console,
Expand Down

This file was deleted.

Loading

0 comments on commit 0b8f31d

Please sign in to comment.