ibm.CrRetentionPolicy
Explore with Pulumi AI
Create, update, and delete about the IBM Cloud Container Registry retention policy resource. For more information, about IBM Cloud Container Registry retention policy, see Managing access for Container Registry.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const crRetentionPolicy = new ibm.CrRetentionPolicy("crRetentionPolicy", {
imagesPerRepo: 10,
namespace: "birds",
retainUntagged: false,
});
import pulumi
import pulumi_ibm as ibm
cr_retention_policy = ibm.CrRetentionPolicy("crRetentionPolicy",
images_per_repo=10,
namespace="birds",
retain_untagged=False)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewCrRetentionPolicy(ctx, "crRetentionPolicy", &ibm.CrRetentionPolicyArgs{
ImagesPerRepo: pulumi.Float64(10),
Namespace: pulumi.String("birds"),
RetainUntagged: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var crRetentionPolicy = new Ibm.CrRetentionPolicy("crRetentionPolicy", new()
{
ImagesPerRepo = 10,
Namespace = "birds",
RetainUntagged = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.CrRetentionPolicy;
import com.pulumi.ibm.CrRetentionPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var crRetentionPolicy = new CrRetentionPolicy("crRetentionPolicy", CrRetentionPolicyArgs.builder()
.imagesPerRepo(10)
.namespace("birds")
.retainUntagged(false)
.build());
}
}
resources:
crRetentionPolicy:
type: ibm:CrRetentionPolicy
properties:
imagesPerRepo: 10
namespace: birds
retainUntagged: false
Create CrRetentionPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CrRetentionPolicy(name: string, args: CrRetentionPolicyArgs, opts?: CustomResourceOptions);
@overload
def CrRetentionPolicy(resource_name: str,
args: CrRetentionPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CrRetentionPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
images_per_repo: Optional[float] = None,
namespace: Optional[str] = None,
cr_retention_policy_id: Optional[str] = None,
retain_untagged: Optional[bool] = None)
func NewCrRetentionPolicy(ctx *Context, name string, args CrRetentionPolicyArgs, opts ...ResourceOption) (*CrRetentionPolicy, error)
public CrRetentionPolicy(string name, CrRetentionPolicyArgs args, CustomResourceOptions? opts = null)
public CrRetentionPolicy(String name, CrRetentionPolicyArgs args)
public CrRetentionPolicy(String name, CrRetentionPolicyArgs args, CustomResourceOptions options)
type: ibm:CrRetentionPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CrRetentionPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args CrRetentionPolicyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args CrRetentionPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CrRetentionPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CrRetentionPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var crRetentionPolicyResource = new Ibm.CrRetentionPolicy("crRetentionPolicyResource", new()
{
ImagesPerRepo = 0,
Namespace = "string",
CrRetentionPolicyId = "string",
RetainUntagged = false,
});
example, err := ibm.NewCrRetentionPolicy(ctx, "crRetentionPolicyResource", &ibm.CrRetentionPolicyArgs{
ImagesPerRepo: pulumi.Float64(0),
Namespace: pulumi.String("string"),
CrRetentionPolicyId: pulumi.String("string"),
RetainUntagged: pulumi.Bool(false),
})
var crRetentionPolicyResource = new CrRetentionPolicy("crRetentionPolicyResource", CrRetentionPolicyArgs.builder()
.imagesPerRepo(0)
.namespace("string")
.crRetentionPolicyId("string")
.retainUntagged(false)
.build());
cr_retention_policy_resource = ibm.CrRetentionPolicy("crRetentionPolicyResource",
images_per_repo=0,
namespace="string",
cr_retention_policy_id="string",
retain_untagged=False)
const crRetentionPolicyResource = new ibm.CrRetentionPolicy("crRetentionPolicyResource", {
imagesPerRepo: 0,
namespace: "string",
crRetentionPolicyId: "string",
retainUntagged: false,
});
type: ibm:CrRetentionPolicy
properties:
crRetentionPolicyId: string
imagesPerRepo: 0
namespace: string
retainUntagged: false
CrRetentionPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CrRetentionPolicy resource accepts the following input properties:
- Images
Per doubleRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - Namespace string
- The namespace to which the retention policy is attached.
- Cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- Retain
Untagged 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.
- Images
Per float64Repo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - Namespace string
- The namespace to which the retention policy is attached.
- Cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- Retain
Untagged 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.
- images
Per DoubleRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace String
- The namespace to which the retention policy is attached.
- cr
Retention StringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- retain
Untagged Boolean - 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.
- images
Per numberRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace string
- The namespace to which the retention policy is attached.
- cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- retain
Untagged boolean - 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.
- images_
per_ floatrepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace str
- The namespace to which the retention policy is attached.
- cr_
retention_ strpolicy_ id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- retain_
untagged 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.
- images
Per NumberRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace String
- The namespace to which the retention policy is attached.
- cr
Retention StringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- retain
Untagged Boolean - 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the CrRetentionPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CrRetentionPolicy Resource
Get an existing CrRetentionPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: CrRetentionPolicyState, opts?: CustomResourceOptions): CrRetentionPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cr_retention_policy_id: Optional[str] = None,
images_per_repo: Optional[float] = None,
namespace: Optional[str] = None,
retain_untagged: Optional[bool] = None) -> CrRetentionPolicy
func GetCrRetentionPolicy(ctx *Context, name string, id IDInput, state *CrRetentionPolicyState, opts ...ResourceOption) (*CrRetentionPolicy, error)
public static CrRetentionPolicy Get(string name, Input<string> id, CrRetentionPolicyState? state, CustomResourceOptions? opts = null)
public static CrRetentionPolicy get(String name, Output<String> id, CrRetentionPolicyState state, CustomResourceOptions options)
resources: _: type: ibm:CrRetentionPolicy get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- Images
Per doubleRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - Namespace string
- The namespace to which the retention policy is attached.
- Retain
Untagged 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.
- Cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- Images
Per float64Repo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - Namespace string
- The namespace to which the retention policy is attached.
- Retain
Untagged 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.
- cr
Retention StringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- images
Per DoubleRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace String
- The namespace to which the retention policy is attached.
- retain
Untagged Boolean - 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.
- cr
Retention stringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- images
Per numberRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace string
- The namespace to which the retention policy is attached.
- retain
Untagged boolean - 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.
- cr_
retention_ strpolicy_ id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- images_
per_ floatrepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace str
- The namespace to which the retention policy is attached.
- retain_
untagged 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.
- cr
Retention StringPolicy Id - The unique identifier of the cr_retention_policy. This identifier is the same as the name of namespace to which the retention policy is attached.
- images
Per NumberRepo - Determines how many images are retained in each repository when the retention policy is processed. The value
-1
denotesUnlimited
(all images are retained). - namespace String
- The namespace to which the retention policy is attached.
- retain
Untagged Boolean - 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.
Import
You can import the ibm_cr_retention_policy
resource by adding the namespace
option, where namespace
is the namespace to which the retention policy is attached.
$ pulumi import ibm:index/crRetentionPolicy:CrRetentionPolicy cr_retention_policy <namespace>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.