-
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
invoking add_ingress_rule() on an imported security group throws AttributeError: 'Resource' object has no attribute 'add_ingress_rule' #4966
Comments
I suspect a JSII bug here, @RomainMuller can you see if my hunch is right? |
@skinny85 @RomainMuller - I don't see this issue happening in Javascript when I tried replicating using the below .ts code (using CDK v1.16.1): const sg = ec2.SecurityGroup.fromSecurityGroupId(
this,
'sg1',
'sg-fc0acb82'
)
sg.addIngressRule(
ec2.Peer.prefixList('sg-fc0acb82'),
ec2.Port.tcp(443),
'test inbound rule'
) Got the expected output on doing 'cdk diff':
So, probably a JSII bug? |
This is also an issue when using jsii 0.20.4. |
Have you also upgraded to CDK |
I tried with CDK 1.16.2 as well as JSII 0.20.4. Still getting the same error.
|
Alright I can definitely reproduce this. |
The result of {"ok":{"result":{"$jsii.byref":"@aws-cdk/core.Resource@10002","$jsii.interfaces":["@aws-cdk/aws-ec2.ISecurityGroup"]}}} This would be the Python jsii runtime not correctly using the interfaces list. |
Probably the wire type negotiation changes |
Oh it's definitely that. |
I thought we had enough tests there to cover the changes |
The workaround you've proposed on #4979 goes only so far in being able to get the parameter value from ssm... The overall deployment fails with jsii errors (sepecific error below)...
|
Internal ticket reference: A fix to the jsii bug was submitted (aws/jsii#980). |
This appears to be fixed for me using aws-cdk 1.16.2 and jsii 0.20.5. |
@RomainMuller still seeing this issue after upgrading to the latest version of jsii and aws-cdk
|
@tarunaroraonline I don't think that's the same error...
|
After upgrading CDK to v1.16.x and jsii to 0.20.3 today, add_ingress_rule() suddenly started throwing the below error when trying to add an inbound rule to an imported security group.
AttributeError: 'Resource' object has no attribute 'add_ingress_rule'
Reproduction Steps
Error Log
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: