-
Notifications
You must be signed in to change notification settings - Fork 4k
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
aws_ec2: ipAddresses is an invalid key for Python, but CIDR gives deprecation warning to use it #30510
Comments
This may be a confusion with the way deprecation warnings are currently performed in Python.
|
@andrewvaughan Good morning. Thanks for reporting the issue. You are right, from aws_cdk import (
# Duration,
Stack,
aws_ec2 as ec2,
)
from constructs import Construct
class PythonStack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
vpc = ec2.Vpc(self,
"vpc-common",
ip_addresses=ec2.IpAddresses.cidr("10.0.0.0/16")
) Refer Python Vpc documentation. Regarding the warning message, the Python code is converted to TypeScript code via JSII layer and then the CFN template is synthesized from converted TypeScript code. The warning message is thrown in the converted TypeScript code. Please let us know if you are unblocked and is this issue could be closed. Thanks, |
|
Thank you for the detailed response! You nailed it exactly. Even if the documentation can't be updated, this issue will likely help people Googling for the issue like I was. Cheers! |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the bug
The
VPC.cidr
prop is deprecated to be removed in the next major release. The deprecation notice and documentation state to useipAddresses
, instead.If you use
ipAddresses
in Python, you get an Exception:Expected Behavior
Replacing the
cidr
prop for a VPC with anipAddresses
prop, as directed by the deprecation warning, should succeed.Current Behavior
Reproduction Steps
Possible Solution
Add the
ipAddresses
as a valid keyword for Python.Additional Information/Context
No response
CDK CLI Version
2.145.0 (build fdf53ba)
Framework Version
No response
Node.js Version
v22.2.0
OS
macOS
Language
Python
Language Version
Python 3.12.0
Other information
No response
The text was updated successfully, but these errors were encountered: