Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EscalationPolicy errors on Teams Parameter being Absent on upgrade from v2.2.0 to 3.1.X #70

Closed
mstrisoline opened this issue Nov 19, 2021 · 2 comments
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@mstrisoline
Copy link

mstrisoline commented Nov 19, 2021

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)

Issue details

When trying to upgrade from v2.2.0 to v3.1.0 there appears to be breaking change around teams now being required. There is noted breaking change here or in the Terraform Provider documents around Teams This is a paid feature of Pagerduty.

 error: unmarshaling urn:pulumi:prod::monitoring::pagerduty:index/escalationPolicy:EscalationPolicy::engineering-escalation-policy's instance state: could not read field teams: '' expected type 'string', got unconvertible type '[]interface ***', value: '[]'

Code

            var EscalationPolicy = new Pagerduty.EscalationPolicy("escalation-policy",
                new Pagerduty.EscalationPolicyArgs
                {
                    NumLoops = 2,
                    Rules =
                    {
                        new Pagerduty.Inputs.EscalationPolicyRuleArgs
                        {
                            EscalationDelayInMinutes = 15,
                            Targets =
                            {
                                new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                                {
                                    Type = "schedule",
                                    Id = schedule.Id,
                                }
                            }
                        }
                    }
                })

Steps to reproduce

CSharp Dotnet 5.0

  1. Create an Escalation Policy without a team at provider version v2.2.0 without Teams
  2. Create the Escalation Policy
  3. Upgrade provider to v3.1.1 or v3.1.0
  4. Re-Run

Expected:
I expected a provider update and work as before with no noted breaking changes.

Actual:
The code errors on Teams as if its a required parameter now.

@mstrisoline mstrisoline added the kind/bug Some behavior is incorrect or out of spec label Nov 19, 2021
@leezen
Copy link

leezen commented Nov 20, 2021

This reads more like an issue with state than a required property to me? I suspect this may have to do with the fact that teams now has a MaxItems of 1 in the upstream provider (PagerDuty/terraform-provider-pagerduty#412) and specifically the type changed from an array to a string. I think there are a couple workarounds that can help you migrate:

  1. You can try to pulumi stack export the state and fix up the underlying teams value to be a string, then pulumi stack import the resulting file.
  2. You could try running PULUMI_ENABLE_LEGACY_PLUGIN_SEARCH=true pulumi refresh with the new version of the pagerduty plugin on your path. This should hopefully rewrite the teams part of the state as part of performing the refresh.

@mstrisoline
Copy link
Author

Yes this is a conflict in state rather than the provider. I will work to fix this on my end. Thank you for pointing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants