1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. TcrTagRetentionExecutionConfig
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.TcrTagRetentionExecutionConfig

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to configure a tcr tag retention execution.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const exampleTcrInstance = new tencentcloud.TcrInstance("exampleTcrInstance", {
        instanceType: "basic",
        deleteBucket: true,
        tags: {
            createdBy: "terraform",
        },
    });
    const exampleTcrNamespace = new tencentcloud.TcrNamespace("exampleTcrNamespace", {
        instanceId: exampleTcrInstance.tcrInstanceId,
        isPublic: true,
        isAutoScan: true,
        isPreventVul: true,
        severity: "medium",
        cveWhitelistItems: [{
            cveId: "cve-xxxxx",
        }],
    });
    const exampleTcrTagRetentionRule = new tencentcloud.TcrTagRetentionRule("exampleTcrTagRetentionRule", {
        registryId: exampleTcrInstance.tcrInstanceId,
        namespaceName: exampleTcrNamespace.name,
        retentionRule: {
            key: "nDaysSinceLastPush",
            value: 2,
        },
        cronSetting: "manual",
        disabled: true,
    });
    const exampleTcrTagRetentionExecutionConfig = new tencentcloud.TcrTagRetentionExecutionConfig("exampleTcrTagRetentionExecutionConfig", {
        registryId: exampleTcrTagRetentionRule.registryId,
        retentionId: exampleTcrTagRetentionRule.retentionId,
        dryRun: false,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example_tcr_instance = tencentcloud.TcrInstance("exampleTcrInstance",
        instance_type="basic",
        delete_bucket=True,
        tags={
            "createdBy": "terraform",
        })
    example_tcr_namespace = tencentcloud.TcrNamespace("exampleTcrNamespace",
        instance_id=example_tcr_instance.tcr_instance_id,
        is_public=True,
        is_auto_scan=True,
        is_prevent_vul=True,
        severity="medium",
        cve_whitelist_items=[{
            "cve_id": "cve-xxxxx",
        }])
    example_tcr_tag_retention_rule = tencentcloud.TcrTagRetentionRule("exampleTcrTagRetentionRule",
        registry_id=example_tcr_instance.tcr_instance_id,
        namespace_name=example_tcr_namespace.name,
        retention_rule={
            "key": "nDaysSinceLastPush",
            "value": 2,
        },
        cron_setting="manual",
        disabled=True)
    example_tcr_tag_retention_execution_config = tencentcloud.TcrTagRetentionExecutionConfig("exampleTcrTagRetentionExecutionConfig",
        registry_id=example_tcr_tag_retention_rule.registry_id,
        retention_id=example_tcr_tag_retention_rule.retention_id,
        dry_run=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleTcrInstance, err := tencentcloud.NewTcrInstance(ctx, "exampleTcrInstance", &tencentcloud.TcrInstanceArgs{
    			InstanceType: pulumi.String("basic"),
    			DeleteBucket: pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"createdBy": pulumi.String("terraform"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleTcrNamespace, err := tencentcloud.NewTcrNamespace(ctx, "exampleTcrNamespace", &tencentcloud.TcrNamespaceArgs{
    			InstanceId:   exampleTcrInstance.TcrInstanceId,
    			IsPublic:     pulumi.Bool(true),
    			IsAutoScan:   pulumi.Bool(true),
    			IsPreventVul: pulumi.Bool(true),
    			Severity:     pulumi.String("medium"),
    			CveWhitelistItems: tencentcloud.TcrNamespaceCveWhitelistItemArray{
    				&tencentcloud.TcrNamespaceCveWhitelistItemArgs{
    					CveId: pulumi.String("cve-xxxxx"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleTcrTagRetentionRule, err := tencentcloud.NewTcrTagRetentionRule(ctx, "exampleTcrTagRetentionRule", &tencentcloud.TcrTagRetentionRuleArgs{
    			RegistryId:    exampleTcrInstance.TcrInstanceId,
    			NamespaceName: exampleTcrNamespace.Name,
    			RetentionRule: &tencentcloud.TcrTagRetentionRuleRetentionRuleArgs{
    				Key:   pulumi.String("nDaysSinceLastPush"),
    				Value: pulumi.Float64(2),
    			},
    			CronSetting: pulumi.String("manual"),
    			Disabled:    pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewTcrTagRetentionExecutionConfig(ctx, "exampleTcrTagRetentionExecutionConfig", &tencentcloud.TcrTagRetentionExecutionConfigArgs{
    			RegistryId:  exampleTcrTagRetentionRule.RegistryId,
    			RetentionId: exampleTcrTagRetentionRule.RetentionId,
    			DryRun:      pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleTcrInstance = new Tencentcloud.TcrInstance("exampleTcrInstance", new()
        {
            InstanceType = "basic",
            DeleteBucket = true,
            Tags = 
            {
                { "createdBy", "terraform" },
            },
        });
    
        var exampleTcrNamespace = new Tencentcloud.TcrNamespace("exampleTcrNamespace", new()
        {
            InstanceId = exampleTcrInstance.TcrInstanceId,
            IsPublic = true,
            IsAutoScan = true,
            IsPreventVul = true,
            Severity = "medium",
            CveWhitelistItems = new[]
            {
                new Tencentcloud.Inputs.TcrNamespaceCveWhitelistItemArgs
                {
                    CveId = "cve-xxxxx",
                },
            },
        });
    
        var exampleTcrTagRetentionRule = new Tencentcloud.TcrTagRetentionRule("exampleTcrTagRetentionRule", new()
        {
            RegistryId = exampleTcrInstance.TcrInstanceId,
            NamespaceName = exampleTcrNamespace.Name,
            RetentionRule = new Tencentcloud.Inputs.TcrTagRetentionRuleRetentionRuleArgs
            {
                Key = "nDaysSinceLastPush",
                Value = 2,
            },
            CronSetting = "manual",
            Disabled = true,
        });
    
        var exampleTcrTagRetentionExecutionConfig = new Tencentcloud.TcrTagRetentionExecutionConfig("exampleTcrTagRetentionExecutionConfig", new()
        {
            RegistryId = exampleTcrTagRetentionRule.RegistryId,
            RetentionId = exampleTcrTagRetentionRule.RetentionId,
            DryRun = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TcrInstance;
    import com.pulumi.tencentcloud.TcrInstanceArgs;
    import com.pulumi.tencentcloud.TcrNamespace;
    import com.pulumi.tencentcloud.TcrNamespaceArgs;
    import com.pulumi.tencentcloud.inputs.TcrNamespaceCveWhitelistItemArgs;
    import com.pulumi.tencentcloud.TcrTagRetentionRule;
    import com.pulumi.tencentcloud.TcrTagRetentionRuleArgs;
    import com.pulumi.tencentcloud.inputs.TcrTagRetentionRuleRetentionRuleArgs;
    import com.pulumi.tencentcloud.TcrTagRetentionExecutionConfig;
    import com.pulumi.tencentcloud.TcrTagRetentionExecutionConfigArgs;
    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 exampleTcrInstance = new TcrInstance("exampleTcrInstance", TcrInstanceArgs.builder()
                .instanceType("basic")
                .deleteBucket(true)
                .tags(Map.of("createdBy", "terraform"))
                .build());
    
            var exampleTcrNamespace = new TcrNamespace("exampleTcrNamespace", TcrNamespaceArgs.builder()
                .instanceId(exampleTcrInstance.tcrInstanceId())
                .isPublic(true)
                .isAutoScan(true)
                .isPreventVul(true)
                .severity("medium")
                .cveWhitelistItems(TcrNamespaceCveWhitelistItemArgs.builder()
                    .cveId("cve-xxxxx")
                    .build())
                .build());
    
            var exampleTcrTagRetentionRule = new TcrTagRetentionRule("exampleTcrTagRetentionRule", TcrTagRetentionRuleArgs.builder()
                .registryId(exampleTcrInstance.tcrInstanceId())
                .namespaceName(exampleTcrNamespace.name())
                .retentionRule(TcrTagRetentionRuleRetentionRuleArgs.builder()
                    .key("nDaysSinceLastPush")
                    .value(2)
                    .build())
                .cronSetting("manual")
                .disabled(true)
                .build());
    
            var exampleTcrTagRetentionExecutionConfig = new TcrTagRetentionExecutionConfig("exampleTcrTagRetentionExecutionConfig", TcrTagRetentionExecutionConfigArgs.builder()
                .registryId(exampleTcrTagRetentionRule.registryId())
                .retentionId(exampleTcrTagRetentionRule.retentionId())
                .dryRun(false)
                .build());
    
        }
    }
    
    resources:
      exampleTcrInstance:
        type: tencentcloud:TcrInstance
        properties:
          instanceType: basic
          deleteBucket: true
          tags:
            createdBy: terraform
      exampleTcrNamespace:
        type: tencentcloud:TcrNamespace
        properties:
          instanceId: ${exampleTcrInstance.tcrInstanceId}
          isPublic: true
          isAutoScan: true
          isPreventVul: true
          severity: medium
          cveWhitelistItems:
            - cveId: cve-xxxxx
      exampleTcrTagRetentionRule:
        type: tencentcloud:TcrTagRetentionRule
        properties:
          registryId: ${exampleTcrInstance.tcrInstanceId}
          namespaceName: ${exampleTcrNamespace.name}
          retentionRule:
            key: nDaysSinceLastPush
            value: 2
          cronSetting: manual
          disabled: true
      exampleTcrTagRetentionExecutionConfig:
        type: tencentcloud:TcrTagRetentionExecutionConfig
        properties:
          registryId: ${exampleTcrTagRetentionRule.registryId}
          retentionId: ${exampleTcrTagRetentionRule.retentionId}
          dryRun: false
    

    Create TcrTagRetentionExecutionConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TcrTagRetentionExecutionConfig(name: string, args: TcrTagRetentionExecutionConfigArgs, opts?: CustomResourceOptions);
    @overload
    def TcrTagRetentionExecutionConfig(resource_name: str,
                                       args: TcrTagRetentionExecutionConfigArgs,
                                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def TcrTagRetentionExecutionConfig(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       registry_id: Optional[str] = None,
                                       retention_id: Optional[float] = None,
                                       dry_run: Optional[bool] = None,
                                       tcr_tag_retention_execution_config_id: Optional[str] = None)
    func NewTcrTagRetentionExecutionConfig(ctx *Context, name string, args TcrTagRetentionExecutionConfigArgs, opts ...ResourceOption) (*TcrTagRetentionExecutionConfig, error)
    public TcrTagRetentionExecutionConfig(string name, TcrTagRetentionExecutionConfigArgs args, CustomResourceOptions? opts = null)
    public TcrTagRetentionExecutionConfig(String name, TcrTagRetentionExecutionConfigArgs args)
    public TcrTagRetentionExecutionConfig(String name, TcrTagRetentionExecutionConfigArgs args, CustomResourceOptions options)
    
    type: tencentcloud:TcrTagRetentionExecutionConfig
    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 TcrTagRetentionExecutionConfigArgs
    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 TcrTagRetentionExecutionConfigArgs
    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 TcrTagRetentionExecutionConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TcrTagRetentionExecutionConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TcrTagRetentionExecutionConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    TcrTagRetentionExecutionConfig 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 TcrTagRetentionExecutionConfig resource accepts the following input properties:

    RegistryId string
    instance id.
    RetentionId double
    retention id.
    DryRun bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    TcrTagRetentionExecutionConfigId string
    ID of the resource.
    RegistryId string
    instance id.
    RetentionId float64
    retention id.
    DryRun bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    TcrTagRetentionExecutionConfigId string
    ID of the resource.
    registryId String
    instance id.
    retentionId Double
    retention id.
    dryRun Boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    tcrTagRetentionExecutionConfigId String
    ID of the resource.
    registryId string
    instance id.
    retentionId number
    retention id.
    dryRun boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    tcrTagRetentionExecutionConfigId string
    ID of the resource.
    registry_id str
    instance id.
    retention_id float
    retention id.
    dry_run bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    tcr_tag_retention_execution_config_id str
    ID of the resource.
    registryId String
    instance id.
    retentionId Number
    retention id.
    dryRun Boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    tcrTagRetentionExecutionConfigId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TcrTagRetentionExecutionConfig resource produces the following output properties:

    ExecutionId double
    execution id.
    Id string
    The provider-assigned unique ID for this managed resource.
    ExecutionId float64
    execution id.
    Id string
    The provider-assigned unique ID for this managed resource.
    executionId Double
    execution id.
    id String
    The provider-assigned unique ID for this managed resource.
    executionId number
    execution id.
    id string
    The provider-assigned unique ID for this managed resource.
    execution_id float
    execution id.
    id str
    The provider-assigned unique ID for this managed resource.
    executionId Number
    execution id.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TcrTagRetentionExecutionConfig Resource

    Get an existing TcrTagRetentionExecutionConfig 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?: TcrTagRetentionExecutionConfigState, opts?: CustomResourceOptions): TcrTagRetentionExecutionConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dry_run: Optional[bool] = None,
            execution_id: Optional[float] = None,
            registry_id: Optional[str] = None,
            retention_id: Optional[float] = None,
            tcr_tag_retention_execution_config_id: Optional[str] = None) -> TcrTagRetentionExecutionConfig
    func GetTcrTagRetentionExecutionConfig(ctx *Context, name string, id IDInput, state *TcrTagRetentionExecutionConfigState, opts ...ResourceOption) (*TcrTagRetentionExecutionConfig, error)
    public static TcrTagRetentionExecutionConfig Get(string name, Input<string> id, TcrTagRetentionExecutionConfigState? state, CustomResourceOptions? opts = null)
    public static TcrTagRetentionExecutionConfig get(String name, Output<String> id, TcrTagRetentionExecutionConfigState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:TcrTagRetentionExecutionConfig    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.
    The following state arguments are supported:
    DryRun bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    ExecutionId double
    execution id.
    RegistryId string
    instance id.
    RetentionId double
    retention id.
    TcrTagRetentionExecutionConfigId string
    ID of the resource.
    DryRun bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    ExecutionId float64
    execution id.
    RegistryId string
    instance id.
    RetentionId float64
    retention id.
    TcrTagRetentionExecutionConfigId string
    ID of the resource.
    dryRun Boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    executionId Double
    execution id.
    registryId String
    instance id.
    retentionId Double
    retention id.
    tcrTagRetentionExecutionConfigId String
    ID of the resource.
    dryRun boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    executionId number
    execution id.
    registryId string
    instance id.
    retentionId number
    retention id.
    tcrTagRetentionExecutionConfigId string
    ID of the resource.
    dry_run bool
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    execution_id float
    execution id.
    registry_id str
    instance id.
    retention_id float
    retention id.
    tcr_tag_retention_execution_config_id str
    ID of the resource.
    dryRun Boolean
    Whether to simulate execution, the default value is false, that is, non-simulation execution.
    executionId Number
    execution id.
    registryId String
    instance id.
    retentionId Number
    retention id.
    tcrTagRetentionExecutionConfigId String
    ID of the resource.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack