Skip to content

terraform-ibm-modules/terraform-ibm-container-registry

Repository files navigation

IBM Container Registry module

Graduated (Supported) semantic-release pre-commit latest release Renovate enabled

You can use this module to provision and configure an IBM Container Registry namespace and optionally, a container registry retention policy.

Overview

terraform-ibm-container-registry

Usage

module "namespace" {
  source            = "terraform-ibm-modules/container-registry/ibm"
  version           = "X.X.X" # Replace "X.X.X" with a release version to lock into a specific release
  name              = "my-namespace"
  resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
  images_per_repo   = 2
}

Required IAM access policies

  • Account Management
    • IBM Cloud Container Registry service
      • Writer, Manager service access

Access roles for using Container Registry

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.49.0, < 2.0.0

Modules

No modules.

Resources

Name Type
ibm_cr_namespace.cr_namespace resource
ibm_cr_retention_policy.cr_retention_policy resource

Inputs

Name Description Type Default Required
images_per_repo (Optional, Integer) Determines how many images are retained in each repository when the retention policy is processed. The value -1 denotes Unlimited (all images are retained). The value 0 denotes no retention policy will be created (default) number 0 no
name Name of the container registry namespace string n/a yes
resource_group_id The resource group ID where the IBM container namespace will be created. string n/a yes
retain_untagged (Optional, Bool) Determines whether untagged images are retained when the retention policy is processed. Default value is false, means untagged images can be deleted when the policy runs. bool false no
tags Optional list of tags to be added to the IBM container namespace. list(string) [] no

Outputs

Name Description
namespace_crn CRN representing the namespace

Contributing

You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.

To set up your local development environment, see Local development setup in the project documentation.