datadrivers / terraform-provider-nexus

Terraform provider for Sonatype Nexus
https://registry.terraform.io/providers/datadrivers/nexus
Mozilla Public License 2.0
119 stars 53 forks source link

Support for Cleanup Policies #473

Closed Michenux closed 1 month ago

Michenux commented 1 month ago

Is there an existing issue for this?

Community Note

Description

I would like to be able to manage the cleanup policies in Terraform. The nexus API has been updated in 3.70 so you can now define cleanup policies with the API. https://help.sonatype.com/en/cleanup-policies-api.html

New or Affected Resource(s)/Data Source(s)

nexus_cleanup_policy

Pro feature

Community Plugin

No response

Potential Terraform Configuration

resource "nexus_cleanup_policy" {
  name: "delete-not-downloaded-after-30d",
  notes: "Delete artifacts if not downloaded within 30 days",
  criteriaLastBlobUpdated: 0,
  criteriaLastDownloaded: 30,
  criteriaReleaseType: "RELEASES",
  criteriaAssetRegex: "",
  retain: null,    # this attribute only for pro version.
  format: "maven2"
}

References

No response

chris-ruecker commented 1 month ago

Hi @Michenux , we are working on implementing this at the moment and it will be in the next release. There is a quite old issue for this already: https://github.com/datadrivers/terraform-provider-nexus/issues/226