Hello I am trying to rerun pulumi up but i get ...
# typescript
r
Hello I am trying to rerun pulumi up but i get below error
Copy code
aws:eks:Addon (coredns):

    error: 1 error occurred:

    	* error creating EKS Add-On : ResourceInUseException: Addon already exists.

    {

      RespMetadata: {

        StatusCode: 409,

        RequestID: "4c48c30e-3c0d-43d3-aa0b-2cca66f8335d"

      },

      Message_: "Addon already exists."

    }
earlier i created resource from pulumi itself and pulumi state refelcts that resource already exists I was expecting if the resource exists its should not complain that resource already exists
l
Why is it being created? Do you have a new Pulumi name which is different from the Pulumi name of he resource in state?
r
yes earlier it was like this
Copy code
const eksAddonCoredns = new aws.eks.Addon(
    "eksAddon",
    {
      addonName: "coredns",
      clusterName: prefix,
      resolveConflicts: "OVERWRITE",
      addonVersion: eksAddonCorednsVersion,
    },

    {
      dependsOn: [k8sCluster],
    },
  );
now it is updated like this
Copy code
const eksAddonCoredns = new aws.eks.Addon(
    "Coredns",
    {
      addonName: "coredns",
      clusterName: prefix,
      resolveConflicts: "OVERWRITE",
      addonVersion: eksAddonCorednsVersion,
    },

    {
      dependsOn: [k8sCluster],
    },
  );
this part is updated
Copy code
new aws.eks.Addon(
    "Coredns"
l
So that means that there two different resources. "eksAddon" is being deleted, and "Codedns" is being created.
Pulumi creates new resources before deleting old ones, in order reduce the risk of service interruption.
But because these are both the same resource, with the same ID, the creation fails, because you can't have 2 resources with the same AWS ID.
r
oh so i should first remove the resource and then recreate reosurce with new name is that right
l
You could, but Pulumi has a better way.
You can add an alias to the opts of the resource, so that Pulumi knows that the new resource is actually the old one.
1
r
oh what us the better way ?
l
It won't delete it.
r
oh is there link on how to add alias ?
l
Looking for it now.