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

powerful-printer-57241

04/03/2021, 2:48 PM
I am probably missing something crucial, because Pulumi just deleted a resource after I confirmed a preview with no change indicated. How is it possible?
For what it's worth, here's how the stack looks like:
Copy code
public sealed class AzureFeaturePulumiAlertStack : Stack
{
    public AzureFeaturePulumiAlertStack()
    {
        var redisStackReference = new StackReference("mews-admin/Mews.Server.Environments/FeaturePulumiRedis");
        var redisId = redisStackReference.GetOutput(nameof(AzureFeaturePulumiRedisStack.RedisId));

        redisId.Apply(id => CreateMetricAlert(AzureFeaturePulumiAlerts.RedisMemoryHigh, id.ToString()).Id);
    }

    private static Pulumi.AzureNative.Insights.MetricAlert CreateMetricAlert<TResource>(MetricAlert<TResource> alert, string scopeId)
    {
        return new Pulumi.AzureNative.Insights.MetricAlert(...);
    }
}
Ok, so it's probably this issue: https://github.com/pulumi/pulumi/issues/3991 Other than that, is it considered ok to create resources inside the function passed to
Apply
?