-
Notifications
You must be signed in to change notification settings - Fork 212
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
Add support for pagerduty_automation_actions_runner
and data.pagerduty_automation_actions_runner
#595
Add support for pagerduty_automation_actions_runner
and data.pagerduty_automation_actions_runner
#595
Conversation
`go mod edit -replace github.com/heimweh/go-pagerduty=github.com/mrdubr/go-pagerduty@a2getrunner-support && go mod tidy && go mod vendor`
…:mrdubr/terraform-provider-pagerduty into mrdubr-data_pagerduty_automation_actions_runner
…unner Data pagerduty automation actions runner
`go mod edit -dropreplace github.com/heimweh/go-pagerduty@d82f94f && go get github.com/heimweh/go-pagerduty/pagerduty && go mod tidy && go mod vendor`
1b94809
to
21f0f96
Compare
Schema: map[string]*schema.Schema{ | ||
"id": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
}, | ||
"name": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"type": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"runner_type": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"creation_time": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
"last_seen": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Optional: true, | ||
}, | ||
"description": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Optional: true, | ||
}, | ||
"runbook_base_uri": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Optional: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to reuse the resource schema directly here: https://github.com/PagerDuty/terraform-provider-pagerduty/pull/595/files#diff-c9f4179acaed6ea87351f857cb6180d4d178550a76e5e14bb54d18102123c33eR21-R65
And then reuse the resourcePagerDutyAutomationActionsRunnerRead()
function too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an example of how it is done in the Google terraform provider, see: https://github.com/hashicorp/terraform-provider-google/blob/v4.45.0/google/data_source_cloud_run_service.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree this would be a less repetitive way of creating data source schemas I would vote that we keep the code base consistent with the other data sources in the PageDuty provider. So, if we were to adopt this approach we should use it for all the applicable data sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🌮 🎉 Users are going to love this!
Add support for
pagerduty_automation_actions_runner
anddata.pagerduty_automation_actions_runner
New test cases introduced...
Depends on heimweh/go-pagerduty#103