Skip to content

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
  namespace_name    = "my-namespace"
  namespace_region  = "us-south"
  resource_group_id = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
  images_per_repo   = 2
}

module "upgrade-plan" {
  source  = "terraform-ibm-modules/container-registry/ibm//modules/plan"
  version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
}
module "set_quota" {
  source  = "terraform-ibm-modules/container-registry/ibm//modules/quotas"
  version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
  update_storage_quota        = true
  storage_megabytes           = 5 * 1024 # 5GiB
  update_traffic_quota        = true
  traffic_megabytes           = 500 # 500 MB
}

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
ibm_cr_namespaces.existing_cr_namespaces data source

Inputs

Name Description Type Default Required
existing_namespace_name The name of an existing namespace. Required if 'namespace_name' is not provided. string null no
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
namespace_name Name of the container registry namespace, if var.existing_namespace_name is not inputted, a new namespace will be created in a region set by provider. 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
namespace_name Name of ICR namespace
retention_policy_id ID of retentation policy

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.