terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Support for Caching feature in Azure Container Registry(ACR)

Open abilous-ti opened this issue 1 year ago • 19 comments

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

abilous-ti avatar Apr 03 '23 08:04 abilous-ti

Hey guys,

any update on this, we hit the dockerhub rate limit lately..

neko1101 avatar Jul 04 '23 15:07 neko1101

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.

nclaeys avatar Jul 13 '23 12:07 nclaeys

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

nclaeys avatar Aug 25 '23 14:08 nclaeys

@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

bkarakashev avatar Sep 14 '23 11:09 bkarakashev

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.

kevinharing avatar Sep 20 '23 11:09 kevinharing

It's now GA.

kevinharing avatar Sep 29 '23 09:09 kevinharing

Hi there

Did you find some time to work on it? @nclaeys

JoachimHansEDDI avatar Nov 07 '23 13:11 JoachimHansEDDI

@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.

nclaeys avatar Nov 07 '23 13:11 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.

I have no clue about development. ;-)

JoachimHansEDDI avatar Nov 07 '23 13:11 JoachimHansEDDI

Please, any update on this?

bkarakashev avatar Nov 23 '23 10:11 bkarakashev

Any update, currently a BIG gap in azurerm support IMHO

webstean avatar Nov 27 '23 23:11 webstean

I'm an independent contributor, started working on it!

mhaligowski avatar Nov 27 '23 23:11 mhaligowski

I'm an independent contributor, started working on it!

Thanks a lot @mhaligowski

JoachimHansEDDI avatar Nov 28 '23 06:11 JoachimHansEDDI

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 avatar Dec 20 '23 07:12 JoachimHansEDDI

@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.

mhaligowski avatar Dec 20 '23 07:12 mhaligowski

Hi @mhaligowski

Did you find any time to push that forward?

JoachimHansEDDI avatar Feb 13 '24 13:02 JoachimHansEDDI

any news on that?

janlauber-swissgrid avatar Mar 19 '24 14:03 janlauber-swissgrid

Any latest news on this please?

ashwajce avatar May 07 '24 09:05 ashwajce

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

nguyenhung1121990 avatar May 09 '24 08:05 nguyenhung1121990

It's been a year since this feature was introduced 🎂

danvy avatar May 16 '24 23:05 danvy

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.

npk-amperon avatar May 21 '24 13:05 npk-amperon

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.

github-actions[bot] avatar Jul 01 '24 02:07 github-actions[bot]