RegistryEnterpriseSyncRule

class RegistryEnterpriseSyncRule : KotlinCustomResource

This resource will help you to manager Container Registry Enterprise Edition sync rules. For information about Container Registry Enterprise Edition sync rules and how to use it, see Create a Sync Rule

NOTE: Available since v1.90.0. NOTE: You need to set your registry password in Container Registry Enterprise Edition console before use this resource.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const source = new alicloud.cr.RegistryEnterpriseInstance("source", {
paymentType: "Subscription",
period: 1,
renewPeriod: 0,
renewalStatus: "ManualRenewal",
instanceType: "Advanced",
instanceName: `${name}-source`,
});
const target = new alicloud.cr.RegistryEnterpriseInstance("target", {
paymentType: "Subscription",
period: 1,
renewPeriod: 0,
renewalStatus: "ManualRenewal",
instanceType: "Advanced",
instanceName: `${name}-target`,
});
const sourceRegistryEnterpriseNamespace = new alicloud.cs.RegistryEnterpriseNamespace("source", {
instanceId: source.id,
name: name,
autoCreate: false,
defaultVisibility: "PUBLIC",
});
const targetRegistryEnterpriseNamespace = new alicloud.cs.RegistryEnterpriseNamespace("target", {
instanceId: target.id,
name: name,
autoCreate: false,
defaultVisibility: "PUBLIC",
});
const sourceRegistryEnterpriseRepo = new alicloud.cs.RegistryEnterpriseRepo("source", {
instanceId: source.id,
namespace: sourceRegistryEnterpriseNamespace.name,
name: name,
summary: "this is summary of my new repo",
repoType: "PUBLIC",
detail: "this is a public repo",
});
const targetRegistryEnterpriseRepo = new alicloud.cs.RegistryEnterpriseRepo("target", {
instanceId: target.id,
namespace: targetRegistryEnterpriseNamespace.name,
name: name,
summary: "this is summary of my new repo",
repoType: "PUBLIC",
detail: "this is a public repo",
});
const default = alicloud.getRegions({
current: true,
});
const defaultRegistryEnterpriseSyncRule = new alicloud.cs.RegistryEnterpriseSyncRule("default", {
instanceId: source.id,
namespaceName: sourceRegistryEnterpriseNamespace.name,
name: name,
targetRegionId: _default.then(_default => _default.regions?.[0]?.id),
targetInstanceId: target.id,
targetNamespaceName: targetRegistryEnterpriseNamespace.name,
tagFilter: ".*",
repoName: sourceRegistryEnterpriseRepo.name,
targetRepoName: targetRegistryEnterpriseRepo.name,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
source = alicloud.cr.RegistryEnterpriseInstance("source",
payment_type="Subscription",
period=1,
renew_period=0,
renewal_status="ManualRenewal",
instance_type="Advanced",
instance_name=f"{name}-source")
target = alicloud.cr.RegistryEnterpriseInstance("target",
payment_type="Subscription",
period=1,
renew_period=0,
renewal_status="ManualRenewal",
instance_type="Advanced",
instance_name=f"{name}-target")
source_registry_enterprise_namespace = alicloud.cs.RegistryEnterpriseNamespace("source",
instance_id=source.id,
name=name,
auto_create=False,
default_visibility="PUBLIC")
target_registry_enterprise_namespace = alicloud.cs.RegistryEnterpriseNamespace("target",
instance_id=target.id,
name=name,
auto_create=False,
default_visibility="PUBLIC")
source_registry_enterprise_repo = alicloud.cs.RegistryEnterpriseRepo("source",
instance_id=source.id,
namespace=source_registry_enterprise_namespace.name,
name=name,
summary="this is summary of my new repo",
repo_type="PUBLIC",
detail="this is a public repo")
target_registry_enterprise_repo = alicloud.cs.RegistryEnterpriseRepo("target",
instance_id=target.id,
namespace=target_registry_enterprise_namespace.name,
name=name,
summary="this is summary of my new repo",
repo_type="PUBLIC",
detail="this is a public repo")
default = alicloud.get_regions(current=True)
default_registry_enterprise_sync_rule = alicloud.cs.RegistryEnterpriseSyncRule("default",
instance_id=source.id,
namespace_name=source_registry_enterprise_namespace.name,
name=name,
target_region_id=default.regions[0].id,
target_instance_id=target.id,
target_namespace_name=target_registry_enterprise_namespace.name,
tag_filter=".*",
repo_name=source_registry_enterprise_repo.name,
target_repo_name=target_registry_enterprise_repo.name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var source = new AliCloud.CR.RegistryEnterpriseInstance("source", new()
{
PaymentType = "Subscription",
Period = 1,
RenewPeriod = 0,
RenewalStatus = "ManualRenewal",
InstanceType = "Advanced",
InstanceName = $"{name}-source",
});
var target = new AliCloud.CR.RegistryEnterpriseInstance("target", new()
{
PaymentType = "Subscription",
Period = 1,
RenewPeriod = 0,
RenewalStatus = "ManualRenewal",
InstanceType = "Advanced",
InstanceName = $"{name}-target",
});
var sourceRegistryEnterpriseNamespace = new AliCloud.CS.RegistryEnterpriseNamespace("source", new()
{
InstanceId = source.Id,
Name = name,
AutoCreate = false,
DefaultVisibility = "PUBLIC",
});
var targetRegistryEnterpriseNamespace = new AliCloud.CS.RegistryEnterpriseNamespace("target", new()
{
InstanceId = target.Id,
Name = name,
AutoCreate = false,
DefaultVisibility = "PUBLIC",
});
var sourceRegistryEnterpriseRepo = new AliCloud.CS.RegistryEnterpriseRepo("source", new()
{
InstanceId = source.Id,
Namespace = sourceRegistryEnterpriseNamespace.Name,
Name = name,
Summary = "this is summary of my new repo",
RepoType = "PUBLIC",
Detail = "this is a public repo",
});
var targetRegistryEnterpriseRepo = new AliCloud.CS.RegistryEnterpriseRepo("target", new()
{
InstanceId = target.Id,
Namespace = targetRegistryEnterpriseNamespace.Name,
Name = name,
Summary = "this is summary of my new repo",
RepoType = "PUBLIC",
Detail = "this is a public repo",
});
var @default = AliCloud.GetRegions.Invoke(new()
{
Current = true,
});
var defaultRegistryEnterpriseSyncRule = new AliCloud.CS.RegistryEnterpriseSyncRule("default", new()
{
InstanceId = source.Id,
NamespaceName = sourceRegistryEnterpriseNamespace.Name,
Name = name,
TargetRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
TargetInstanceId = target.Id,
TargetNamespaceName = targetRegistryEnterpriseNamespace.Name,
TagFilter = ".*",
RepoName = sourceRegistryEnterpriseRepo.Name,
TargetRepoName = targetRegistryEnterpriseRepo.Name,
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tf-example"
if param := cfg.Get("name"); param != "" {
name = param
}
source, err := cr.NewRegistryEnterpriseInstance(ctx, "source", &cr.RegistryEnterpriseInstanceArgs{
PaymentType: pulumi.String("Subscription"),
Period: pulumi.Int(1),
RenewPeriod: pulumi.Int(0),
RenewalStatus: pulumi.String("ManualRenewal"),
InstanceType: pulumi.String("Advanced"),
InstanceName: pulumi.String(fmt.Sprintf("%v-source", name)),
})
if err != nil {
return err
}
target, err := cr.NewRegistryEnterpriseInstance(ctx, "target", &cr.RegistryEnterpriseInstanceArgs{
PaymentType: pulumi.String("Subscription"),
Period: pulumi.Int(1),
RenewPeriod: pulumi.Int(0),
RenewalStatus: pulumi.String("ManualRenewal"),
InstanceType: pulumi.String("Advanced"),
InstanceName: pulumi.String(fmt.Sprintf("%v-target", name)),
})
if err != nil {
return err
}
sourceRegistryEnterpriseNamespace, err := cs.NewRegistryEnterpriseNamespace(ctx, "source", &cs.RegistryEnterpriseNamespaceArgs{
InstanceId: source.ID(),
Name: pulumi.String(name),
AutoCreate: pulumi.Bool(false),
DefaultVisibility: pulumi.String("PUBLIC"),
})
if err != nil {
return err
}
targetRegistryEnterpriseNamespace, err := cs.NewRegistryEnterpriseNamespace(ctx, "target", &cs.RegistryEnterpriseNamespaceArgs{
InstanceId: target.ID(),
Name: pulumi.String(name),
AutoCreate: pulumi.Bool(false),
DefaultVisibility: pulumi.String("PUBLIC"),
})
if err != nil {
return err
}
sourceRegistryEnterpriseRepo, err := cs.NewRegistryEnterpriseRepo(ctx, "source", &cs.RegistryEnterpriseRepoArgs{
InstanceId: source.ID(),
Namespace: sourceRegistryEnterpriseNamespace.Name,
Name: pulumi.String(name),
Summary: pulumi.String("this is summary of my new repo"),
RepoType: pulumi.String("PUBLIC"),
Detail: pulumi.String("this is a public repo"),
})
if err != nil {
return err
}
targetRegistryEnterpriseRepo, err := cs.NewRegistryEnterpriseRepo(ctx, "target", &cs.RegistryEnterpriseRepoArgs{
InstanceId: target.ID(),
Namespace: targetRegistryEnterpriseNamespace.Name,
Name: pulumi.String(name),
Summary: pulumi.String("this is summary of my new repo"),
RepoType: pulumi.String("PUBLIC"),
Detail: pulumi.String("this is a public repo"),
})
if err != nil {
return err
}
_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
Current: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = cs.NewRegistryEnterpriseSyncRule(ctx, "default", &cs.RegistryEnterpriseSyncRuleArgs{
InstanceId: source.ID(),
NamespaceName: sourceRegistryEnterpriseNamespace.Name,
Name: pulumi.String(name),
TargetRegionId: pulumi.String(_default.Regions[0].Id),
TargetInstanceId: target.ID(),
TargetNamespaceName: targetRegistryEnterpriseNamespace.Name,
TagFilter: pulumi.String(".*"),
RepoName: sourceRegistryEnterpriseRepo.Name,
TargetRepoName: targetRegistryEnterpriseRepo.Name,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cr.RegistryEnterpriseInstance;
import com.pulumi.alicloud.cr.RegistryEnterpriseInstanceArgs;
import com.pulumi.alicloud.cs.RegistryEnterpriseNamespace;
import com.pulumi.alicloud.cs.RegistryEnterpriseNamespaceArgs;
import com.pulumi.alicloud.cs.RegistryEnterpriseRepo;
import com.pulumi.alicloud.cs.RegistryEnterpriseRepoArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
import com.pulumi.alicloud.cs.RegistryEnterpriseSyncRule;
import com.pulumi.alicloud.cs.RegistryEnterpriseSyncRuleArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var source = new RegistryEnterpriseInstance("source", RegistryEnterpriseInstanceArgs.builder()
.paymentType("Subscription")
.period(1)
.renewPeriod(0)
.renewalStatus("ManualRenewal")
.instanceType("Advanced")
.instanceName(String.format("%s-source", name))
.build());
var target = new RegistryEnterpriseInstance("target", RegistryEnterpriseInstanceArgs.builder()
.paymentType("Subscription")
.period(1)
.renewPeriod(0)
.renewalStatus("ManualRenewal")
.instanceType("Advanced")
.instanceName(String.format("%s-target", name))
.build());
var sourceRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("sourceRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()
.instanceId(source.id())
.name(name)
.autoCreate(false)
.defaultVisibility("PUBLIC")
.build());
var targetRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("targetRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()
.instanceId(target.id())
.name(name)
.autoCreate(false)
.defaultVisibility("PUBLIC")
.build());
var sourceRegistryEnterpriseRepo = new RegistryEnterpriseRepo("sourceRegistryEnterpriseRepo", RegistryEnterpriseRepoArgs.builder()
.instanceId(source.id())
.namespace(sourceRegistryEnterpriseNamespace.name())
.name(name)
.summary("this is summary of my new repo")
.repoType("PUBLIC")
.detail("this is a public repo")
.build());
var targetRegistryEnterpriseRepo = new RegistryEnterpriseRepo("targetRegistryEnterpriseRepo", RegistryEnterpriseRepoArgs.builder()
.instanceId(target.id())
.namespace(targetRegistryEnterpriseNamespace.name())
.name(name)
.summary("this is summary of my new repo")
.repoType("PUBLIC")
.detail("this is a public repo")
.build());
final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
var defaultRegistryEnterpriseSyncRule = new RegistryEnterpriseSyncRule("defaultRegistryEnterpriseSyncRule", RegistryEnterpriseSyncRuleArgs.builder()
.instanceId(source.id())
.namespaceName(sourceRegistryEnterpriseNamespace.name())
.name(name)
.targetRegionId(default_.regions()[0].id())
.targetInstanceId(target.id())
.targetNamespaceName(targetRegistryEnterpriseNamespace.name())
.tagFilter(".*")
.repoName(sourceRegistryEnterpriseRepo.name())
.targetRepoName(targetRegistryEnterpriseRepo.name())
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
source:
type: alicloud:cr:RegistryEnterpriseInstance
properties:
paymentType: Subscription
period: 1
renewPeriod: 0
renewalStatus: ManualRenewal
instanceType: Advanced
instanceName: ${name}-source
target:
type: alicloud:cr:RegistryEnterpriseInstance
properties:
paymentType: Subscription
period: 1
renewPeriod: 0
renewalStatus: ManualRenewal
instanceType: Advanced
instanceName: ${name}-target
sourceRegistryEnterpriseNamespace:
type: alicloud:cs:RegistryEnterpriseNamespace
name: source
properties:
instanceId: ${source.id}
name: ${name}
autoCreate: false
defaultVisibility: PUBLIC
targetRegistryEnterpriseNamespace:
type: alicloud:cs:RegistryEnterpriseNamespace
name: target
properties:
instanceId: ${target.id}
name: ${name}
autoCreate: false
defaultVisibility: PUBLIC
sourceRegistryEnterpriseRepo:
type: alicloud:cs:RegistryEnterpriseRepo
name: source
properties:
instanceId: ${source.id}
namespace: ${sourceRegistryEnterpriseNamespace.name}
name: ${name}
summary: this is summary of my new repo
repoType: PUBLIC
detail: this is a public repo
targetRegistryEnterpriseRepo:
type: alicloud:cs:RegistryEnterpriseRepo
name: target
properties:
instanceId: ${target.id}
namespace: ${targetRegistryEnterpriseNamespace.name}
name: ${name}
summary: this is summary of my new repo
repoType: PUBLIC
detail: this is a public repo
defaultRegistryEnterpriseSyncRule:
type: alicloud:cs:RegistryEnterpriseSyncRule
name: default
properties:
instanceId: ${source.id}
namespaceName: ${sourceRegistryEnterpriseNamespace.name}
name: ${name}
targetRegionId: ${default.regions[0].id}
targetInstanceId: ${target.id}
targetNamespaceName: ${targetRegistryEnterpriseNamespace.name}
tagFilter: .*
repoName: ${sourceRegistryEnterpriseRepo.name}
targetRepoName: ${targetRegistryEnterpriseRepo.name}
variables:
default:
fn::invoke:
Function: alicloud:getRegions
Arguments:
current: true

Import

Container Registry Enterprise Edition sync rule can be imported using the id. Format to {instance_id}:{namespace_name}:{rule_id}, e.g.

$ pulumi import alicloud:cs/registryEnterpriseSyncRule:RegistryEnterpriseSyncRule default `cri-xxx:my-namespace:crsr-yyy`

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

ID of Container Registry Enterprise Edition source instance.

Link copied to clipboard
val name: Output<String>

Name of Container Registry Enterprise Edition sync rule.

Link copied to clipboard
val namespaceName: Output<String>

Name of Container Registry Enterprise Edition source namespace. It can contain 2 to 30 characters.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repoName: Output<String>?

Name of the source repository which should be set together with target_repo_name, if empty means that the synchronization scope is the entire namespace level.

Link copied to clipboard
val ruleId: Output<String>

The uuid of Container Registry Enterprise Edition sync rule.

Link copied to clipboard
val syncDirection: Output<String>

FROM or TO, the direction of synchronization. FROM means source instance, TO means target instance.

Link copied to clipboard
val syncScope: Output<String>

REPO or NAMESPACE,the scope that the synchronization rule applies.

Link copied to clipboard
val tagFilter: Output<String>

The regular expression used to filter image tags for synchronization in the source repository.

Link copied to clipboard

ID of Container Registry Enterprise Edition target instance to be synchronized.

Link copied to clipboard

Name of Container Registry Enterprise Edition target namespace to be synchronized. It can contain 2 to 30 characters.

Link copied to clipboard
val targetRegionId: Output<String>

The target region to be synchronized.

Link copied to clipboard
val targetRepoName: Output<String>?

Name of the target repository.

Link copied to clipboard
val urn: Output<String>