ChainArgs

data class ChainArgs(val chainConfigs: Output<List<ChainChainConfigArgs>>? = null, val chainName: Output<String>? = null, val description: Output<String>? = null, val instanceId: Output<String>? = null, val repoName: Output<String>? = null, val repoNamespaceName: Output<String>? = null) : ConvertibleToJava<ChainArgs>

Provides a CR Chain resource. For information about CR Chain and how to use it, see What is Chain.

NOTE: Available since v1.161.0.

Example Usage

Basic Usage

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.cr.Chain;
import com.pulumi.alicloud.cr.ChainArgs;
import com.pulumi.alicloud.cr.inputs.ChainChainConfigArgs;
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 defaultRegistryEnterpriseInstance = new RegistryEnterpriseInstance("defaultRegistryEnterpriseInstance", RegistryEnterpriseInstanceArgs.builder()
.paymentType("Subscription")
.period(1)
.renewPeriod(0)
.renewalStatus("ManualRenewal")
.instanceType("Advanced")
.instanceName(name)
.build());
var defaultRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("defaultRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()
.instanceId(defaultRegistryEnterpriseInstance.id())
.autoCreate(false)
.defaultVisibility("PUBLIC")
.build());
var defaultRegistryEnterpriseRepo = new RegistryEnterpriseRepo("defaultRegistryEnterpriseRepo", RegistryEnterpriseRepoArgs.builder()
.instanceId(defaultRegistryEnterpriseInstance.id())
.namespace(defaultRegistryEnterpriseNamespace.name())
.summary("this is summary of my new repo")
.repoType("PUBLIC")
.detail("this is a public repo")
.build());
var defaultChain = new Chain("defaultChain", ChainArgs.builder()
.chainName(name)
.description(name)
.instanceId(defaultRegistryEnterpriseNamespace.instanceId())
.repoName(defaultRegistryEnterpriseRepo.name())
.repoNamespaceName(defaultRegistryEnterpriseNamespace.name())
.chainConfigs(ChainChainConfigArgs.builder()
.routers(
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("DOCKER_IMAGE_BUILD")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("DOCKER_IMAGE_PUSH")
.build())
.build(),
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("DOCKER_IMAGE_PUSH")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("VULNERABILITY_SCANNING")
.build())
.build(),
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("VULNERABILITY_SCANNING")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("ACTIVATE_REPLICATION")
.build())
.build(),
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("ACTIVATE_REPLICATION")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("TRIGGER")
.build())
.build(),
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("VULNERABILITY_SCANNING")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("SNAPSHOT")
.build())
.build(),
ChainChainConfigRouterArgs.builder()
.froms(ChainChainConfigRouterFromArgs.builder()
.nodeName("SNAPSHOT")
.build())
.tos(ChainChainConfigRouterToArgs.builder()
.nodeName("TRIGGER_SNAPSHOT")
.build())
.build())
.nodes(
ChainChainConfigNodeArgs.builder()
.enable(true)
.nodeName("DOCKER_IMAGE_BUILD")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(true)
.nodeName("DOCKER_IMAGE_PUSH")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(true)
.nodeName("VULNERABILITY_SCANNING")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies(ChainChainConfigNodeNodeConfigDenyPolicyArgs.builder()
.issueLevel("MEDIUM")
.issueCount(1)
.action("BLOCK_DELETE_TAG")
.logic("AND")
.build())
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(true)
.nodeName("ACTIVATE_REPLICATION")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(true)
.nodeName("TRIGGER")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(false)
.nodeName("SNAPSHOT")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build(),
ChainChainConfigNodeArgs.builder()
.enable(false)
.nodeName("TRIGGER_SNAPSHOT")
.nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
.denyPolicies()
.build())
.build())
.build())
.build());
}
}

Import

CR Chain can be imported using the id, e.g.

$ pulumi import alicloud:cr/chain:Chain example <instance_id>:<chain_id>

Constructors

Link copied to clipboard
fun ChainArgs(chainConfigs: Output<List<ChainChainConfigArgs>>? = null, chainName: Output<String>? = null, description: Output<String>? = null, instanceId: Output<String>? = null, repoName: Output<String>? = null, repoNamespaceName: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ChainArgs

Properties

Link copied to clipboard
val chainConfigs: Output<List<ChainChainConfigArgs>>? = null

The configuration of delivery chain. See chain_config below. NOTE: This parameter must specify the correct value, otherwise the created resource will be incorrect.

Link copied to clipboard
val chainName: Output<String>? = null

The name of delivery chain. The length of the name is 1-64 characters, lowercase English letters and numbers, and the separators "_", "-", "." can be used, noted that the separator cannot be at the first or last position.

Link copied to clipboard
val description: Output<String>? = null

The description delivery chain.

Link copied to clipboard
val instanceId: Output<String>? = null

The ID of CR Enterprise Edition instance.

Link copied to clipboard
val repoName: Output<String>? = null

The name of CR Enterprise Edition repository. NOTE: This parameter must specify a correct value, otherwise the created resource will be incorrect.

Link copied to clipboard
val repoNamespaceName: Output<String>? = null

The name of CR Enterprise Edition namespace. NOTE: This parameter must specify the correct value, otherwise the created resource will be incorrect.