Title
l

limited-pager-46264

04/01/2021, 1:55 PM
What is this warning supposed to mean?
warning: security_groups is deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates.
When creating instances using python, am I supposed to use
vpcSecurityGroupIds
instead of
security_groups
?
b

brave-planet-10645

04/01/2021, 2:31 PM
Reading the issue it looks like
security_groups
is a leftover from when VPCs weren't a thing, or you were able to have EC2 instances outside of a VPC. You should use
vpcSecurityGroupIds
l

limited-pager-46264

04/01/2021, 2:37 PM
Experienced its consequence now; when I updated the SG rules, pulumi ended replacing the instance using the SG 😱
Unfortunately,
vpcSecurityGroupIds
doesn’t seem to work
File "./__main__.py", line 30, in <module>
        du = aws.ec2.Instance(
    TypeError: __init__() got an unexpected keyword argument 'vpcSecurityGroupIds'
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
Ah..found the right parameter in the doc; it’s
vpc_security_group_ids