https://github.com/terraform-do-modules/terraform-digitalocean-container-registry
Terraform module to create container registry. The DigitalOcean Container Registry (DOCR) is a private Docker image registry with additional tooling support that enables integration with your Docker environment and DigitalOcean Kubernetes clusters.
https://github.com/terraform-do-modules/terraform-digitalocean-container-registry
clouddrove devops digitalocean digitalocean-container-registry digitalocean-terraform-module hackoctoberfest iac-terraform terraform terraform-module
Last synced: 4 months ago
JSON representation
Terraform module to create container registry. The DigitalOcean Container Registry (DOCR) is a private Docker image registry with additional tooling support that enables integration with your Docker environment and DigitalOcean Kubernetes clusters.
- Host: GitHub
- URL: https://github.com/terraform-do-modules/terraform-digitalocean-container-registry
- Owner: terraform-do-modules
- License: apache-2.0
- Created: 2023-06-28T07:37:41.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2026-02-06T12:54:58.000Z (4 months ago)
- Last Synced: 2026-02-06T20:47:16.014Z (4 months ago)
- Topics: clouddrove, devops, digitalocean, digitalocean-container-registry, digitalocean-terraform-module, hackoctoberfest, iac-terraform, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 34.2 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README

Terraform Digitalocean Container Registry
Terraform module to create Digitalocean container registry service resource on Digitalocean.
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy Bigger problems are always solved by breaking them into smaller manageable problems. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller connected yet manageable pieces within the infrastructure.
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
We have [*fifty plus terraform modules*][terraform_modules]. A few of them are comepleted and are available for open source usage while a few others are in progress.
## Prerequisites
This module has a few dependencies:
- [Terraform 1.4.6](https://learn.hashicorp.com/terraform/getting-started/install.html)
## Examples
**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/terraform-do-modules/terraform-digitalocean-container-registry/releases).
### Simple Example
Here is an example of how you can use this module in your inventory structure:
```hcl
module "container-registry" {
source = "terraform-do-modules/container-registry/digitalocean"
version = "1.0.0"
name = local.name
environment = local.environment
region = local.region
subscription_tier_slug = "starter"
}
```
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| enabled | Whether to create the resources. Set to `false` to prevent the module from creating any resources. | `bool` | `true` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no |
| expiry\_seconds | The amount of time to pass before the Docker credentials expire in seconds. Defaults to 1576800000, or roughly 50 years. Must be greater than 0 and less than 1576800000. | `number` | `1576800000` | no |
| label\_order | Label order, e.g. `name`,`application`. | `list(any)` |
[
"name",
"environment"
]
| no |
| managedby | ManagedBy, eg 'terraform-do-modules' or 'hello@clouddrove.com' | `string` | `"terraform-do-modules"` | no |
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no |
| region | The region to create VPC, like `london-1` , `bangalore-1` ,`newyork-3` `toronto-1`. | `string` | `"syd1"` | no |
| subscription\_tier\_slug | The slug identifier for the subscription tier to use (starter, basic, or professional). | `string` | `"starter"` | no |
| write | Allow for write access to the container registry. Defaults to false. | `bool` | `false` | no |
## Outputs
| Name | Description |
|------|-------------|
| created\_at | The date and time when the registry was created. |
| credential\_expiration\_time | The date and time the registry access token will expire. |
| docker\_credentials | Credentials for the container registry. |
| endpoint | The URL endpoint of the container registry. |
| expiry\_seconds | Number of seconds after creation for token to expire. |
| id | The id of the container registry. |
| name | The name of the container registry. |
| region | The slug identifier for the region. |
| server\_url | The domain of the container registry. |
| storage\_usage\_bytes | The amount of storage used in the registry in bytes. |
| subscription\_tier\_slug | The slug identifier for the subscription tier. |
## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
You need to run the following command in the testing folder:
```hcl
go test -run Test
```
## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/terraform-do-modules/terraform-digitalocean-container-registry/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).
If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/terraform-do-modules/terraform-digitalocean-container-registry)!
## About us
At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.
We are The Cloud Experts!
We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.
[website]: https://clouddrove.com
[github]: https://github.com/clouddrove
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
[email]: https://clouddrove.com/contact-us.html
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=