Closed mittonface closed 1 year ago
Hey! Thanks so much for submitting this! Just a couple of questions:
retrieve_deploy_key
param on the RepositoryResource with a default of false
, then deciding whether or not to set this URL param based on that, what do you think?thanks so much for taking the time to do this! 🥳
The way that I'm intending to use this is so that DBT can automatically gain read-access to a private bitbucket repo. In my TF I will take this deploy key and pass it through a bitbucket provider and automate that setup.
I've got a few more sprint obligations to get through, but I'll try to take your feedback and tidy things up a bit in the next few days/week.
(feel free to get rid of my Draft PR if you don't want it junking up your repo until I'm ready to go)
Made the changes that you suggested.
I do think setting a parameter to decide whether or not to retrieve the key feels a little clumsy, but I'm not sure of any other solutions. Seems to all be working, though I stumbled my way through it a bit.
/ok-to-test sha=9bebc413e97142f8339ce47d89a5764d18260643
⁉️ weird! I ran acceptance and unit tests locally. Let me take another look!
/ok-to-test sha=d727675fe8d966a11faaf9887ee2553341059922
For one of my projects I'm able to more fully automate my infrastructure if I can retrieve the public key from DBT. Through a bit of snooping how DBT builds their own pages I found that you can do this by passing
?include_related=['deploy_key']
on therepositories
endpoint.I've not worked on a terraform provider before, so this was a bit of guesswork on my part. Ideally I don't think you'd want to include this new query-parameter all of the time.
Happy to clean this up & write some tests if you want to give some feedback.