-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
providers/heroku: import heroku_pipeline_coupling resource #14495
providers/heroku: import heroku_pipeline_coupling resource #14495
Conversation
db7800d
to
1b2c2d1
Compare
Hey @cmorent is this still |
Hey @catsby, yep, this is still |
1b2c2d1
to
33118e6
Compare
Hey again @catsby, I am testing using the |
33118e6
to
9f80bce
Compare
Hey @cmorent so I dug in here a bit and found some things:
I tinkered this morning and came up with this patch, which I think makes everything nice. It also adds a computed value diff --git a/builtin/providers/heroku/resource_heroku_pipeline_coupling.go b/builtin/providers/heroku/resource_heroku_pipeline_coupling.go
index 4d513c363..cc0668af4 100644
--- a/builtin/providers/heroku/resource_heroku_pipeline_coupling.go
+++ b/builtin/providers/heroku/resource_heroku_pipeline_coupling.go
@@ -20,6 +20,10 @@ func resourceHerokuPipelineCoupling() *schema.Resource {
},
Schema: map[string]*schema.Schema{
+ "app_id": {
+ Type: schema.TypeString,
+ Computed: true,
+ },
"app": {
Type: schema.TypeString,
Required: true,
@@ -85,9 +89,16 @@ func resourceHerokuPipelineCouplingRead(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Error retrieving pipeline: %s", err)
}
- d.Set("app", p.App)
- d.Set("pipeline", p.Pipeline)
+ // grab App info
+ app, err := client.AppInfo(context.TODO(), p.App.ID)
+ if err != nil {
+ log.Printf("[WARN] Error looking up addional App info for pipeline coupling (%s): %s", d.Id(), err)
+ }
+
+ d.Set("app_id", p.App.ID)
+ d.Set("app", app.Name)
d.Set("stage", p.Stage)
+ d.Set("pipeline", p.Pipeline.ID)
return nil
} With that,
Feel free to take the patch above and add it here 😄 |
ack, of course I just noticed that we should only set the |
9f80bce
to
f90e26e
Compare
Hey @catsby ! Thanks a lot for your inputs and for the time you've spent! It works perfectly with your patch and the tests for the import feature are passing too:
Also, if I try to import a
Everything looks good to me now, thanks again! |
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.
👍
Looks good, thanks! |
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. |
Adds support for importing pipelines with the heroku_pipeline_coupling resource.
Resolves #14491