https://pulumi.com logo
#aws
Title
# aws
b

bumpy-garden-89740

08/21/2020, 7:57 AM
And second one - I cannot create security groups with error:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (ss-servers-staging):
    error: update failed

  aws:ec2:SecurityGroupRule (EcsSecurityGroupHTTPinbound):
    error: [WARN] A duplicate Security Group rule was found on (sg-0d4217ba67f301afc). 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. See <https://github.com/hashicorp/terraform/pull/2376> for more
    information and instructions for recovery. Error message: the specified rule "peer: 0.0.0.0/0, TCP, from port: 80, to port: 80, ALLOW" already exists
I see issue https://github.com/pulumi/pulumi-awsx/issues/293 , but I still have no idea how to solve this or find workaround.
Code:
Copy code
export const createSecurityGroup = (name: string): awsx.ec2.SecurityGroup => new awsx.ec2
  .SecurityGroup(`${ name }-${ env }-sg`, {
    description: 'EcsSecurityGroup',
    ingress: [
      {
        fromPort: 80,
        toPort: 80,
        protocol: 'tcp',
        cidrBlocks: [ '0.0.0.0/0' ],
        description: 'EcsSecurityGroupHTTPinbound'
      },
      {
        fromPort: 22,
        toPort: 22,
        protocol: 'tcp',
        cidrBlocks: [ '0.0.0.0/0' ],
        description: 'EcsSecurityGroupSSHinbound'
      },
      {
        fromPort: 443,
        toPort: 443,
        protocol: 'tcp',
        cidrBlocks: [ '0.0.0.0/0' ],
        description: 'ALBSecurityGroupInHttpsWorld'
      },
      {
        fromPort: 31000,
        toPort: 61000,
        protocol: 'tcp',
        cidrBlocks: [ '0.0.0.0/0' ],
        description: 'EcsSecurityGroupALBports'
      },
      { fromPort: 80, toPort: 80, protocol: 'tcp', self: true, description: 'EcsSecurityGroupInHttpAuthProxy' },
      { fromPort: 443, toPort: 443, protocol: 'tcp', self: true, description: 'EcsSecurityGroupInHttpsAuthProxy' },
    ]
  });
b

bright-policeman-55860

08/25/2020, 5:51 PM
I use this to solve that type of problem:
opts=pulumi.ResourceOptions(delete_before_replace=True,