terraform-provider-azurerm
terraform-provider-azurerm copied to clipboard
Support for Caching feature in Azure Container Registry(ACR)
Is there an existing issue for this?
- [X] I have searched the existing issues
Community Note
- Please vote on this issue by adding a :thumbsup: reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
Caching for ACR allows you to create a cache rule and cache container images from Docker Hub and Microsoft Artifact Registry. Caching images lets you pull images directly from your cache ensuring faster and more reliable pull operations.
New or Affected Resource(s)/Data Source(s)
azurerm_container_registry
Potential Terraform Configuration
resource "azurerm_container_registry" "acr" {
name = "containerRegistry1"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "Premium"
admin_enabled = false
georeplications {
location = "East US"
zone_redundancy_enabled = true
tags = {}
}
cache_rule {
name = "name"
registry = "registry"
source-repo = "source-repo"
target-repo = "target-repo"
}
georeplications {
location = "North Europe"
zone_redundancy_enabled = true
tags = {}
}
}
References
https://aka.ms/acr/cache
Hey guys,
any update on this, we hit the dockerhub rate limit lately..
I want to try implementing this as we also need it. Before starting however, we the go-azure-sdk needs to support the latest containerRegistry api (2023-01-01-preview), which includes support for caching.
Since yesterday the go-azure-sdk supports apiversion 2023-07-01 of the containerregistry api, which has support for cacherules. Now the functionality can be implemented in the terraform provider. I am not sure when I will find time to start on it, so if someone else wants to give it a go, be my guest. More details can be found here
@tombuildsstuff he ACR Cache rules are not our of preview and in production. Are you able to add support for it in terraform? Many thanks
We're longing for this as well, by September 30 new dockerhub rate limiting will come into effect and this would make things easier to manage.
Hi there
Did you find some time to work on it? @nclaeys
@JoachimHansEDDI I did not get to it yet. Feel free to take it over, I am a bit swamped with other work in the coming weeks.
@JoachimHansEDDI I did not get to it yet. Feel free to take it over, I am a bit swamped with other work in the coming weeks.
I have no clue about development. ;-)
Please, any update on this?
Any update, currently a BIG gap in azurerm support IMHO
I'm an independent contributor, started working on it!
I'm an independent contributor, started working on it!
Thanks a lot @mhaligowski
Morning @mhaligowski
I see your PR https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform-provider-azurerm%2Fissues%2F21258
What/Who is the showstopper here or how is the process to get this merged?
@JoachimHansEDDI evening, I'm still working on it! I think core of the development is done, I was able to run some base tests. The things left are:
- optional credentials,
- tests.
I've been busy with my professional project, which actually requires this change! I hope to get it finished within the next two weeks, with some more spotty people's availability over the holidays.
Sorry if this is putting you in an inconvenient position, I'm working on it in my spare time.
Hi @mhaligowski
Did you find any time to push that forward?
any news on that?
Any latest news on this please?
There is currently looking that not supported by terraform yet. However I am using azapi terraform functions and it works.
MS Docs: https://learn.microsoft.com/en-us/azure/templates/microsoft.containerregistry/2023-01-01-preview/registries/cacherules?pivots=deployment-language-terraform
It's been a year since this feature was introduced 🎂
Heads-up that I've springboarded off @mhaligowski's work and have a PR ready for review. I've run the acceptance tests locally (and built the provider and poked around manually). Everything seems to work.
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.