{"id":1918,"library":"aws-cdk-asset-node-proxy-agent-v6","title":"AWS CDK Node.js Asset Proxy Agent v6","description":"This Python package provides a proxy agent for AWS CDK applications that build Node.js assets (e.g., Lambda functions) behind an HTTP/HTTPS proxy. It wraps the `@aws-cdk/asset-node-proxy-agent-v6` Node.js package, enabling the `cdk` CLI to automatically route Node.js asset bundling traffic through configured proxy servers. The current version is 2.1.1, with releases typically aligning with updates to the underlying Node.js agent or CDK ecosystem.","status":"active","version":"2.1.1","language":"en","source_language":"en","source_url":"https://github.com/cdklabs/awscdk-asset-node-proxy-agent.git","tags":["aws","cdk","proxy","node.js","asset","environment"],"install":[{"cmd":"pip install aws-cdk-asset-node-proxy-agent-v6","lang":"bash","label":"Install package"}],"dependencies":[],"imports":[{"note":"This package is primarily an environmental utility. Direct import of its contents for typical API calls is not usually required, as its functionality is triggered via environment variables and the CDK CLI.","symbol":"aws_cdk_asset_node_proxy_agent_v6","correct":"import aws_cdk_asset_node_proxy_agent_v6"}],"quickstart":{"code":"import os\nfrom aws_cdk import App, Stack\nfrom aws_cdk.aws_lambda_nodejs import NodejsFunction\nfrom aws_cdk import aws_lambda as _lambda\nfrom constructs import Construct\n\n# This package's functionality relies on its installation and environment variables.\n# No direct Python code interaction with aws_cdk_asset_node_proxy_agent_v6 is typical.\n\n# Simulate proxy environment variables that the CDK CLI will pick up.\n# In a real scenario, these would be set in your shell before running 'cdk deploy'.\nos.environ['HTTPS_PROXY'] = os.environ.get('HTTPS_PROXY', 'http://your.proxy.server:8080')\nos.environ['NO_PROXY'] = os.environ.get('NO_PROXY', 'localhost,127.0.0.1,.internal.domain')\n\nclass MyProxyAwareNodejsStack(Stack):\n    def __init__(self, scope: Construct, id: str, **kwargs) -> None:\n        super().__init__(scope, id, **kwargs)\n\n        # A Node.js Lambda function, which will trigger the asset bundling process.\n        # If this package is installed and proxy env vars are set, the bundling\n        # process will automatically use the proxy agent.\n        NodejsFunction(\n            self, \"MyProxyAwareLambda\",\n            entry=\"lambda/handler.ts\", # Placeholder: this file would need to exist for a real deploy\n            handler=\"handler\",\n            runtime=_lambda.Runtime.NODEJS_18_X,\n            # Bundling will automatically pick up proxy settings if configured\n        )\n\n# Create a CDK app and synthesize the stack\napp = App()\nMyProxyAwareNodejsStack(app, \"ProxyTestStack\")\napp.synth()\n\n# Note: For a real deployment, ensure 'lambda/handler.ts' exists, Node.js and the\n# AWS CDK CLI are installed, and proxy environment variables are correctly set.\n# This package should be installed in the same Python environment where you run 'cdk synth' or 'cdk deploy'.\n","lang":"python","description":"This package primarily functions by being installed in the Python environment where `cdk` commands are run, and by the presence of standard proxy environment variables (e.g., `HTTPS_PROXY`). The `cdk` CLI automatically detects and uses it when building Node.js assets. The example below shows a basic CDK app with a Node.js Lambda, which would implicitly benefit from the proxy agent if environment variables are set."},"warnings":[{"fix":"Simply install the package in the Python environment used by the `cdk` CLI and ensure proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) are set correctly in the shell.","message":"This library is primarily an environmental utility, not a Python library with direct callable APIs. Its effect is on the `cdk` CLI's behavior when bundling Node.js assets, rather than through direct Python code execution.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify that `node --version` and `cdk --version` commands execute successfully. Install Node.js and `aws-cdk` globally if not already present (`npm install -g aws-cdk`).","message":"Requires Node.js and the AWS CDK CLI to be installed and correctly configured in your environment. This package acts as an add-on for existing CDK development workflows behind a proxy.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the official `awscdk-asset-node-proxy-agent` GitHub repository and AWS CDK release notes for compatibility announcements when upgrading your CDK CLI or Node.js version.","message":"The `v6` in the package name indicates compatibility with a specific version or approach of the underlying Node.js proxy agent. Future major versions of AWS CDK or Node.js might introduce breaking changes that require an updated version of this proxy agent.","severity":"breaking","affected_versions":"All versions"},{"fix":"Ensure your Python environment is running Python 3.9 or a newer compatible version.","message":"The package requires Python 3.9 or higher. Using it with older Python versions will result in an installation error.","severity":"gotcha","affected_versions":"<=2.1.1"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}