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

provider/pagerduty: Import support for service integrations #12141

Merged
merged 2 commits into from
Feb 23, 2017

Conversation

heimweh
Copy link
Contributor

@heimweh heimweh commented Feb 21, 2017

This PR adds support for importing service integrations as well as fixes an issue where vendor would never be set in the state.

Since we need two IDs when importing a service integration (the serviceID and the serviceIntegrationID) the import just tries to locate a service with the matching service integration ID, but it would be even better to be explicit here and maybe have something like: terraform import pagerduty_service_integration.main <serviceID>_<serviceIntegrationID>
Update: Since it's only possible to have one service integration for one service at a time, this should be a safe to do.

This PR also removes the unnecessary use of custom imports for the other PagerDuty resources.
Since we're not doing anything fancy with those we can just use schema.ImportStatePassthrough instead.

Any feedback is more than welcome.

@heimweh heimweh changed the title provider/pagerduty: Import support for service integrations [WIP] provider/pagerduty: Import support for service integrations Feb 21, 2017
@heimweh heimweh changed the title [WIP] provider/pagerduty: Import support for service integrations provider/pagerduty: Import support for service integrations Feb 23, 2017
@heimweh
Copy link
Contributor Author

heimweh commented Feb 23, 2017

Import test passing:

$ make testacc TEST=./builtin/providers/pagerduty TESTARGS='-run=TestAccPagerDutyServiceIntegration*'                                                                                               20:14:34
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/02/23 20:14:46 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/pagerduty -v -run=TestAccPagerDutyServiceIntegration* -timeout 120m
=== RUN   TestAccPagerDutyServiceIntegration_import
--- PASS: TestAccPagerDutyServiceIntegration_import (17.20s)
=== RUN   TestAccPagerDutyServiceIntegration_Basic
--- PASS: TestAccPagerDutyServiceIntegration_Basic (26.01s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/pagerduty	43.238s

@stack72
Copy link
Contributor

stack72 commented Feb 23, 2017

LGTM Thanks for this @heimweh :)

@stack72 stack72 merged commit 229a134 into hashicorp:master Feb 23, 2017
stack72 pushed a commit that referenced this pull request Feb 23, 2017
* Remove custom imports

* Add import support for service integrations
catsby added a commit that referenced this pull request Feb 23, 2017
* master: (499 commits)
  provider/aws: Fix the panic in ssm_association with parameters (#12215)
  Setting incident_urgency_rule as optional (#12211)
  Latest Section (#12151)
  provider/pagerduty: Import support for service integrations (#12141)
  command: fix test for new Meta type
  terraform: InstanceState.Meta is value type interface{}
  Update CHANGELOG.md
  flatmap: mark computed list as a computed value in Expand
  provider/azurerm: Bump AzureRM SDK to v8.0.1-beta (#11866)
  provider/profitbricks: fmt changes post cherry-pick
  provider/aws: Add missing SSM Links to documentation nav bar (#12202)
  update azure_network_interface documentation to say required for ip_configuration (#12185)
  Profitbricks primary nic fix (#12197)
  Update CHANGELOG.md
  Update CHANGELOG.md
  Update CHANGELOG.md
  Update CHANGELOG.md
  provider/aws: Lambda DeadLetterConfig support
  what was the value of the cluster id which caused the problem
  Corrected example code, cleared up token confusion (#12177)
  ...
@ghost
Copy link

ghost commented Apr 16, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants