This message was deleted.
# aws
s
This message was deleted.
b
Does your state already have that name used elsewhere from a prior run or something?
w
Nope. I just added them now. Comment them both out => no change. Uncomment just one of them => unique name error 😖
(I also checked the state and definitely not there)
b
Interesting - that is frustrating.
w
Yeah, feels like a bug.
b
Do you have a repro that isn’t your full program?
or if not, willingness to show your full program?
w
This is just bizarre. I tried a workaround with a cloudformation stack and get a similar error:
Copy code
Duplicate resource URN 'urn:pulumi:alpha::aws-eks::aws:cloudformation/stack:Stack::alpha-aws-eks-sg-rules'; try giving it a unique name
@billowy-army-68599 any ideas?
Copy code
// cluster security group rules for legacy ingress; work around duplicate resource urn issue
Logger.LogDebug("Creating eks cluster security group rules");
var clusterSgrTemplate = Output.Tuple(clusterSgId, eksNodeInternalElbSgId, eksNodePublicElbSgId)
    .Apply(((string ClusterSgId, string InternalSgId, string InternetSgId) tuple) =>
        RenderTemplate("EksSecurityGroupRules.yaml", ReadResource, new { tuple.ClusterSgId, tuple.InternalSgId, tuple.InternetSgId }));

new Pulumi.Aws.CloudFormation.Stack($"{awsEksPrefix}-sg-rules",
    new StackArgs { TemplateBody = clusterSgrTemplate },
    new CustomResourceOptions { Provider = awsProvider });
Copy code
AWSTemplateFormatVersion: 2010-09-09
Resources:
  InternalIngress:
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      GroupId: {{ clusterSgId }}
      IpProtocol: tcp
      FromPort: 0
      ToPort: 65535
      SourceSecurityGroupId: {{ internalSgId }}
  InternetIngress:
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      GroupId: {{ clusterSgId }}
      IpProtocol: tcp
      FromPort: 0
      ToPort: 65535
      SourceSecurityGroupId: {{ internetSgId }}
It doesn't matter what's in the cf template as it fails with the cf template resource urn, which is definitely unique.
b
@worried-city-86458 are you creating the resources inside an apply?
w
No
b
would you mind doing a
pulumi stack export
and/or sharing the full code with me so I can try repro? DM is okay