https://pulumi.com logo
#typescript
Title
# typescript
p

plain-spring-19734

10/21/2019, 12:46 AM
Hi, can anyone help? I'm having an issue where I can create an Azure Front Door but can't update it. If I change any configuration, then
pulumi up
again to apply the update, I get this error:
Copy code
error: Plan apply failed: 1 error occurred:
* updating urn:pulumi:lab::app-service::azure:frontdoor/frontdoor:Frontdoor::myfrontdoor: A resource with the ID "/subscriptions/{guid}/resourcegroups/my-rg/providers/Microsoft.Network/frontdoors/myfrontdoor" already exists - to be managed via Terraform this resource needs to be imported into the State.
It seems as if it's trying to create the resource again? Here's my code:
Copy code
const frontDoor = new azure.frontdoor.Frontdoor('myfrontdoor', {
    resourceGroupName: resourceGroup.name,
    tags: defaultTags,
    name: 'myfrontdoor',
    frontendEndpoints: [{
        name: 'myfrontdoor-azurefd-net',
        hostName: '<http://myfrontdoor.azurefd.net|myfrontdoor.azurefd.net>',
    }],
    backendPools: [{
        name: 'backendPoolAll',
        backends: [{
            address: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
            hostHeader: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
            httpPort: 80,
            httpsPort: 443,
            priority: 1,
            weight: 100,
            enabled: true
        },
        ],
        healthProbeName: 'tdylabHealthProbeSettings',
        loadBalancingName: 'tdylabLoadBalancingSettings',
    }],
    // etc.
    // <other config snipped>
});
I also tried again using the example code from the docs and ran into the same issue. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/azure/frontdoor/#Frontdoor
g

gentle-diamond-70147

10/21/2019, 3:45 AM
If you run
pulumi stack
, do you see the
myfrontdoor
resource in the resource list in the output?
p

plain-spring-19734

10/21/2019, 3:56 AM
Yes it's showing up there:
Copy code
TYPE                                    NAME
pulumi:pulumi:Stack                     my-lab
azure:frontdoor/frontdoor:Frontdoor     myfrontdoor
g

gentle-diamond-70147

10/21/2019, 4:19 AM
Can you provide the full output of
pulumi preview --diff
? It seems like Pulumi might be trying to replace the resource and by default Pulumi will try to create the new resource first before deleting the old and this is causing the conflict (maybe).
p

plain-spring-19734

10/21/2019, 4:49 AM