https://pulumi.com logo
Title
v

victorious-sugar-42620

04/09/2021, 6:41 PM
Hey, I am having a problem with SecurityGroups
[WARN] A duplicate Security Group rule was found on (sg-example). This may be a side effect of a now-fixed Terraform issue causing two security groups with
identical attributes but different source_security_group_ids to overwrite each other in the state.
but the only way I managed to work around this is: Delete conflicting rule -> pulumi up -> Recreate conflicting rule manually. Should I set the
sourceSecurityGroupId
?
Or there is some kind of
deleteBeforeUpdate
b

billowy-army-68599

04/09/2021, 6:44 PM
can you share your currtent code?
v

victorious-sugar-42620

04/09/2021, 7:36 PM
@billowy-army-68599 Sure
new awsx.ec2.SecurityGroup(
  'platform-lb-sg',
  {
    vpc,
    ingress: [
      { fromPort: 80, toPort: 80, protocol: 'tcp', cidrBlocks: ['0.0.0.0/0'] },
      { fromPort: 1234, toPort: 1234, protocol: 'tcp', cidrBlocks: ['0.0.0.0/0'] },
      { fromPort: 8000, toPort: 8000, protocol: 'tcp', cidrBlocks: ['0.0.0.0/0'] }
    ],
    egress: [{ fromPort: 0, toPort: 65535, protocol: 'tcp', cidrBlocks: [ '0.0.0.0/0' ] }],
  }
)
It is just an example, but the thing is that it tries to recreate the rule but it already exists
destroying and recreating also works. But if I include a new rule in later on I get the same error.
b

billowy-army-68599

04/09/2021, 7:54 PM
this looks to be a bug in
awsx
to me, it should be autonaming to prevent this kind of conflict
if you do use
aws.ec2.SecurityGroup
(not the missing x) does it work?