Hi, does anyone know how I can get past a 'duplica...
# aws
a
Hi, does anyone know how I can get past a 'duplicate security group' error. The issue seems to have been fixed in Terraform about 6 years ago!
Copy code
aws:ec2:SecurityGroupRule (wiki-https-external-0-egress):
    error: 1 error occurred:
    	* [WARN] A duplicate Security Group rule was found on (sg-002096ed4ca1220a3). 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: InvalidPermission.Duplicate: the specified rule "peer: 0.0.0.0/0, TCP, from port: 443, to port: 443, ALLOW" already exists
    	status code: 400, request id: 1b6001e7-2dc7-437f-aa56-c92a32fa707b
Here's my about:
Copy code
lloyd@xps13:~/Code/pulumi-templates/wiki$ pulumi about
CLI          
Version      3.36.0
Go Version   go1.17.12
Go Compiler  gc

Plugins
NAME    VERSION
aws     5.10.0
docker  3.2.0
nodejs  unknown

Host     
OS       ubuntu
Version  20.04
Arch     x86_64

This project is written in nodejs: executable='/home/lloyd/.nvm/versions/node/v16.13.1/bin/node' version='v16.13.1'

Backend        
Name           <http://pulumi.com|pulumi.com>
URL            <https://app.pulumi.com/lloydwatkin>
User           lloydwatkin
Organizations  lloydwatkin, OLIOEX

Dependencies:
NAME            VERSION
@pulumi/aws     5.10.0
@pulumi/awsx    0.40.0
@pulumi/docker  3.2.0
@pulumi/pulumi  3.36.0
@types/node     8.10.66

Pulumi locates its logs in /tmp by default
warning: Failed to get information about the current stack: No current stack
m
@adorable-summer-21974 did you try to use the AWS Native provider that doesnโ€™t depend on Terraform? https://www.pulumi.com/registry/packages/aws-native/ -> EC2 - getSecurityGroup.ts
a
Thanks for the reply @mammoth-electrician-64525, not yet, I'm just getting started with Pulumi ๐Ÿ™‚
I've commented out the following part of my load balancer setup and it seems to have fixed things:
Copy code
const alb = new awsx.elasticloadbalancingv2.ApplicationLoadBalancer(
  'wiki-loadbalancer',
  { external: true, /*securityGroups: cluster.securityGroups,*/ vpc }
)
๐Ÿ‘ 1
b
@adorable-summer-21974 can you share your code? this is usually because the security group is going to the wrong vpc
๐Ÿ™ 1
a
That might have been it. The above change (commenting out the above) fixed everything, so I now have a nice fargate running stack ๐Ÿ‘
614 Views