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

routing_keys is still not returned by the pagerduty_ruleset data source #307

Closed
DoctorPolski opened this issue Feb 28, 2021 · 2 comments
Closed

Comments

@DoctorPolski
Copy link

Terraform Version

0.14.7

Affected Resource(s)

  • pagerduty_ruleset

Expected Behavior

pagerduty_ruleset data source should contain routing_keys

Actual Behavior

Despite the recent update the ruleset data source still does not return routing_keys.

Steps to Reproduce

  1. terraform plan
  2. "This object does not have an attribute named "routing_keys"."

References

PR: #305

Discussion

The function requires the routing_keys schema to be added in order for it to return them:

func dataSourcePagerDutyRuleset() *schema.Resource {
	return &schema.Resource{
		Read: dataSourcePagerDutyRulesetRead,

		Schema: map[string]*schema.Schema{
			"name": {
				Type:     schema.TypeString,
				Required: true,
			},
		},
	}
}

should be:

func dataSourcePagerDutyRuleset() *schema.Resource {
	return &schema.Resource{
		Read: dataSourcePagerDutyRulesetRead,

		Schema: map[string]*schema.Schema{
			"name": {
				Type:     schema.TypeString,
				Required: true,
			},
			"routing_keys": {
				Type:     schema.TypeList,
				Computed: true,
				Elem: &schema.Schema{
					Type: schema.TypeString,
				},
			},
		},
	}
}

When compiled and used locally the above works.

I originally requested this functionality last week directly via the PagerDuty helpdesk. I would be happy to submit this as a PR if given the required repo permissions.

Many thanks :)

DoctorPolski pushed a commit to DoctorPolski/terraform-provider-pagerduty that referenced this issue Mar 4, 2021
PagerDuty#307

It adds the relevant schema to allow the ruleset data source to return
routing keys.
DoctorPolski pushed a commit to DoctorPolski/terraform-provider-pagerduty that referenced this issue Mar 4, 2021
PagerDuty#307

It adds the required extra schema definition to fully enable the
ruleset data source to return routing_keys.
@stmcallister
Copy link
Contributor

Thanks for submitting the PR!

@stmcallister
Copy link
Contributor

Going to close this issue. Please reopen if the issue still persists.

mLupine pushed a commit to nordcloud/terraform-provider-pagerduty that referenced this issue Apr 2, 2021
* upstream-master: (33 commits)
  adding spaces to username test
  add details to event rules actions
  fix fmt errors
  add suppress case diff to user email
  response_play.responder to optional
  update changelog to release v1.9.5
  Adding 1.9.5 to CHANGELOG
  Updated go-pagerduty dependency
  Added "template" field for rule extraction object
  This commit is an extension of the following issue: PagerDuty#307
  adding retry and user.name trim
  update ruleset docs to add routing_keys
  preparing changelog for v1.9.4
  getting paginated getMembers
  update Changelog for v1.9.3
  fixing bug in ruleAction.suppress
  Update CHANGELOG for v1.9.2
  fixed bug in event rule positioning
  Update to CHANGELOG to v1.9.1
  Update CHANGELOG for v.1.9.0
  ...

# Conflicts:
#	go.mod
#	go.sum
#	pagerduty/data_source_pagerduty_business_service.go
#	pagerduty/data_source_pagerduty_escalation_policy.go
#	pagerduty/data_source_pagerduty_extension_schema.go
#	pagerduty/data_source_pagerduty_priority.go
#	pagerduty/data_source_pagerduty_ruleset.go
#	pagerduty/data_source_pagerduty_schedule.go
#	pagerduty/data_source_pagerduty_service.go
#	pagerduty/data_source_pagerduty_team.go
#	pagerduty/data_source_pagerduty_user.go
#	pagerduty/data_source_pagerduty_user_contact_method.go
#	pagerduty/data_source_pagerduty_user_contact_method_test.go
#	pagerduty/data_source_pagerduty_vendor.go
#	pagerduty/provider.go
#	pagerduty/resource_pagerduty_ruleset_rule.go
#	vendor/github.com/heimweh/go-pagerduty/pagerduty/pagerduty.go
#	vendor/github.com/heimweh/go-pagerduty/pagerduty/ruleset.go
#	vendor/github.com/heimweh/go-pagerduty/pagerduty/service.go
#	vendor/github.com/heimweh/go-pagerduty/pagerduty/team.go
#	vendor/modules.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants