sparse-tomato-5980
05/13/2021, 6:08 PM.ingress
(or .egress
) after it's already been constructed - i.e.
ingress_rules: List[aws.ec2.SecurityGroupIngressArgs] = ...
security_group = aws.ec2.SecurityGroup(
"SwarmSecurityGroup",
...
ingress=ingress_rules,
)
# ... and later...
new_ingress_rule: aws.ec2.SecurityGroupIngressArgs = ...
# might need a .apply or something, but you get the gist - add something to this list
security_group.ingress = [new_ingress_rule, *security_group.ingress]
The problem is that SecurityGroup#ingress
isn't of type IngressArgs, but an outputs.SecurityGroupIngress
What makes me think this is forbidden:
I could probably convert my IngressArgs into a SecurityGroupIngress, but the roundabout-ness of all this makes me wonder if I'm doing something wrong.
What makes me think this is allowable:
aws.ec2.SecurityGroup has getter-setters for .ingress
bored-oyster-3147
05/13/2021, 6:12 PMaws.ec2.SecurityGroupRule
to add rules to an aws.ec2.SecurityGroup
that you have already declaredsparse-tomato-5980
05/13/2021, 6:12 PMbillowy-army-68599
05/13/2021, 6:13 PMsparse-tomato-5980
05/13/2021, 6:13 PMbillowy-army-68599
05/13/2021, 6:18 PMsparse-tomato-5980
05/13/2021, 6:25 PMbillowy-army-68599
05/13/2021, 6:26 PMsparse-tomato-5980
05/13/2021, 6:27 PMbillowy-army-68599
05/13/2021, 6:30 PMfull-artist-27215
05/13/2021, 7:09 PMbillowy-army-68599
05/13/2021, 7:40 PMfull-artist-27215
05/13/2021, 8:13 PMsparse-tomato-5980
05/13/2021, 9:14 PM