# Rotating DB Credentials Programatically - DBT CLOUD

**URL:** <https://discourse.getdbt.com/t/rotating-db-credentials-programatically-dbt-cloud/8291>\
**Category:** Help\
**Tags:** snowflake, dbt-cloud\
**Created:** [May 15, 2023, 2:52pm UTC](https://discourse.getdbt.com/t/rotating-db-credentials-programatically-dbt-cloud/8291 "2023-05-15T14:52:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![benjaminifaught](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/benjaminifaught/32/1738_2.png) [@benjaminifaught](https://discourse.getdbt.com/u/benjaminifaught)\
**Post date:** [May 15, 2023, 2:52pm UTC](https://discourse.getdbt.com/t/rotating-db-credentials-programatically-dbt-cloud/8291/1 "2023-05-15T14:52:51Z")

</div>

Hi everyone! My organization is in the planning stages of implementing rotating passwords for service accounts, which our Snowflake DB credentials falls into. Does anyone know if there is a way to programmatically update these credentials in dbt cloud?

I have found this [Terraform Registry](https://registry.terraform.io/providers/GtheSheep/dbt-cloud/latest) but the documentation is a little lacking… for instance how do I find the credential id in the dbt cloud gui?

---

<div class="post-metadata">

**Author:** ![bper](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@bper](https://discourse.getdbt.com/u/bper)\
**Post date:** [August 9, 2023, 12:55pm UTC](https://discourse.getdbt.com/t/rotating-db-credentials-programatically-dbt-cloud/8291/2 "2023-08-09T12:55:14Z")

</div>

Hi! Sorry for the delay in the response. I just happened to see this message right now.

First, I just wanted to mention that there is [a new provider](https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest) maintained by dbt Labs. It is based on the one you shared and the repo was handed over from the community member to dbt Labs

Second, the credential\_id is not the easiest to find in the dbt Cloud UI without inspecting the browser. What you could do though is use the [dbtcloud\_environment data source](https://registry.terraform.io/providers/dbt-labs/dbtcloud/latest/docs/data-sources/environment) for your environment (you will see its id in the url), and it will tell you what is the credential\_id for this environment

Let me know if you have more questions!
