All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.cr.kotlin.Chain.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.cr.kotlin

import com.pulumi.alicloud.cr.kotlin.outputs.ChainChainConfig
import com.pulumi.alicloud.cr.kotlin.outputs.ChainChainConfig.Companion.toKotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [Chain].
 */
@PulumiTagMarker
public class ChainResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ChainArgs = ChainArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ChainArgsBuilder.() -> Unit) {
        val builder = ChainArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Chain {
        val builtJavaResource = com.pulumi.alicloud.cr.Chain(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Chain(builtJavaResource)
    }
}

/**
 * Provides a CR Chain resource.
 * For information about CR Chain and how to use it, see [What is Chain](https://www.alibabacloud.com/help/en/acr/developer-reference/api-cr-2018-12-01-createchain).
 * > **NOTE:** Available since v1.161.0.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * 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 _default = new alicloud.cr.RegistryEnterpriseInstance("default", {
 *     paymentType: "Subscription",
 *     period: 1,
 *     renewPeriod: 0,
 *     renewalStatus: "ManualRenewal",
 *     instanceType: "Advanced",
 *     instanceName: name,
 * });
 * const defaultRegistryEnterpriseNamespace = new alicloud.cs.RegistryEnterpriseNamespace("default", {
 *     instanceId: _default.id,
 *     name: name,
 *     autoCreate: false,
 *     defaultVisibility: "PUBLIC",
 * });
 * const defaultRegistryEnterpriseRepo = new alicloud.cs.RegistryEnterpriseRepo("default", {
 *     instanceId: _default.id,
 *     namespace: defaultRegistryEnterpriseNamespace.name,
 *     name: name,
 *     summary: "this is summary of my new repo",
 *     repoType: "PUBLIC",
 *     detail: "this is a public repo",
 * });
 * const defaultChain = new alicloud.cr.Chain("default", {
 *     chainConfigs: [{
 *         nodes: [
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: true,
 *                 nodeName: "DOCKER_IMAGE_BUILD",
 *             },
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: true,
 *                 nodeName: "DOCKER_IMAGE_PUSH",
 *             },
 *             {
 *                 enable: true,
 *                 nodeName: "VULNERABILITY_SCANNING",
 *                 nodeConfigs: [{
 *                     denyPolicies: [{
 *                         issueLevel: "MEDIUM",
 *                         issueCount: "1",
 *                         action: "BLOCK_DELETE_TAG",
 *                         logic: "AND",
 *                     }],
 *                 }],
 *             },
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: true,
 *                 nodeName: "ACTIVATE_REPLICATION",
 *             },
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: true,
 *                 nodeName: "TRIGGER",
 *             },
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: false,
 *                 nodeName: "SNAPSHOT",
 *             },
 *             {
 *                 nodeConfigs: [{
 *                     denyPolicies: [{}],
 *                 }],
 *                 enable: false,
 *                 nodeName: "TRIGGER_SNAPSHOT",
 *             },
 *         ],
 *         routers: [
 *             {
 *                 froms: [{
 *                     nodeName: "DOCKER_IMAGE_BUILD",
 *                 }],
 *                 tos: [{
 *                     nodeName: "DOCKER_IMAGE_PUSH",
 *                 }],
 *             },
 *             {
 *                 froms: [{
 *                     nodeName: "DOCKER_IMAGE_PUSH",
 *                 }],
 *                 tos: [{
 *                     nodeName: "VULNERABILITY_SCANNING",
 *                 }],
 *             },
 *             {
 *                 froms: [{
 *                     nodeName: "VULNERABILITY_SCANNING",
 *                 }],
 *                 tos: [{
 *                     nodeName: "ACTIVATE_REPLICATION",
 *                 }],
 *             },
 *             {
 *                 froms: [{
 *                     nodeName: "ACTIVATE_REPLICATION",
 *                 }],
 *                 tos: [{
 *                     nodeName: "TRIGGER",
 *                 }],
 *             },
 *             {
 *                 froms: [{
 *                     nodeName: "VULNERABILITY_SCANNING",
 *                 }],
 *                 tos: [{
 *                     nodeName: "SNAPSHOT",
 *                 }],
 *             },
 *             {
 *                 froms: [{
 *                     nodeName: "SNAPSHOT",
 *                 }],
 *                 tos: [{
 *                     nodeName: "TRIGGER_SNAPSHOT",
 *                 }],
 *             },
 *         ],
 *     }],
 *     chainName: name,
 *     description: name,
 *     instanceId: defaultRegistryEnterpriseNamespace.instanceId,
 *     repoName: defaultRegistryEnterpriseRepo.name,
 *     repoNamespaceName: defaultRegistryEnterpriseNamespace.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * config = pulumi.Config()
 * name = config.get("name")
 * if name is None:
 *     name = "tf-example"
 * default = alicloud.cr.RegistryEnterpriseInstance("default",
 *     payment_type="Subscription",
 *     period=1,
 *     renew_period=0,
 *     renewal_status="ManualRenewal",
 *     instance_type="Advanced",
 *     instance_name=name)
 * default_registry_enterprise_namespace = alicloud.cs.RegistryEnterpriseNamespace("default",
 *     instance_id=default.id,
 *     name=name,
 *     auto_create=False,
 *     default_visibility="PUBLIC")
 * default_registry_enterprise_repo = alicloud.cs.RegistryEnterpriseRepo("default",
 *     instance_id=default.id,
 *     namespace=default_registry_enterprise_namespace.name,
 *     name=name,
 *     summary="this is summary of my new repo",
 *     repo_type="PUBLIC",
 *     detail="this is a public repo")
 * default_chain = alicloud.cr.Chain("default",
 *     chain_configs=[{
 *         "nodes": [
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": True,
 *                 "node_name": "DOCKER_IMAGE_BUILD",
 *             },
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": True,
 *                 "node_name": "DOCKER_IMAGE_PUSH",
 *             },
 *             {
 *                 "enable": True,
 *                 "node_name": "VULNERABILITY_SCANNING",
 *                 "node_configs": [{
 *                     "deny_policies": [{
 *                         "issue_level": "MEDIUM",
 *                         "issue_count": "1",
 *                         "action": "BLOCK_DELETE_TAG",
 *                         "logic": "AND",
 *                     }],
 *                 }],
 *             },
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": True,
 *                 "node_name": "ACTIVATE_REPLICATION",
 *             },
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": True,
 *                 "node_name": "TRIGGER",
 *             },
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": False,
 *                 "node_name": "SNAPSHOT",
 *             },
 *             {
 *                 "node_configs": [{
 *                     "deny_policies": [{}],
 *                 }],
 *                 "enable": False,
 *                 "node_name": "TRIGGER_SNAPSHOT",
 *             },
 *         ],
 *         "routers": [
 *             {
 *                 "froms": [{
 *                     "node_name": "DOCKER_IMAGE_BUILD",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "DOCKER_IMAGE_PUSH",
 *                 }],
 *             },
 *             {
 *                 "froms": [{
 *                     "node_name": "DOCKER_IMAGE_PUSH",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "VULNERABILITY_SCANNING",
 *                 }],
 *             },
 *             {
 *                 "froms": [{
 *                     "node_name": "VULNERABILITY_SCANNING",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "ACTIVATE_REPLICATION",
 *                 }],
 *             },
 *             {
 *                 "froms": [{
 *                     "node_name": "ACTIVATE_REPLICATION",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "TRIGGER",
 *                 }],
 *             },
 *             {
 *                 "froms": [{
 *                     "node_name": "VULNERABILITY_SCANNING",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "SNAPSHOT",
 *                 }],
 *             },
 *             {
 *                 "froms": [{
 *                     "node_name": "SNAPSHOT",
 *                 }],
 *                 "tos": [{
 *                     "node_name": "TRIGGER_SNAPSHOT",
 *                 }],
 *             },
 *         ],
 *     }],
 *     chain_name=name,
 *     description=name,
 *     instance_id=default_registry_enterprise_namespace.instance_id,
 *     repo_name=default_registry_enterprise_repo.name,
 *     repo_namespace_name=default_registry_enterprise_namespace.name)
 * ```
 * ```csharp
 * 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 @default = new AliCloud.CR.RegistryEnterpriseInstance("default", new()
 *     {
 *         PaymentType = "Subscription",
 *         Period = 1,
 *         RenewPeriod = 0,
 *         RenewalStatus = "ManualRenewal",
 *         InstanceType = "Advanced",
 *         InstanceName = name,
 *     });
 *     var defaultRegistryEnterpriseNamespace = new AliCloud.CS.RegistryEnterpriseNamespace("default", new()
 *     {
 *         InstanceId = @default.Id,
 *         Name = name,
 *         AutoCreate = false,
 *         DefaultVisibility = "PUBLIC",
 *     });
 *     var defaultRegistryEnterpriseRepo = new AliCloud.CS.RegistryEnterpriseRepo("default", new()
 *     {
 *         InstanceId = @default.Id,
 *         Namespace = defaultRegistryEnterpriseNamespace.Name,
 *         Name = name,
 *         Summary = "this is summary of my new repo",
 *         RepoType = "PUBLIC",
 *         Detail = "this is a public repo",
 *     });
 *     var defaultChain = new AliCloud.CR.Chain("default", new()
 *     {
 *         ChainConfigs = new[]
 *         {
 *             new AliCloud.CR.Inputs.ChainChainConfigArgs
 *             {
 *                 Nodes = new[]
 *                 {
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = true,
 *                         NodeName = "DOCKER_IMAGE_BUILD",
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = true,
 *                         NodeName = "DOCKER_IMAGE_PUSH",
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         Enable = true,
 *                         NodeName = "VULNERABILITY_SCANNING",
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigDenyPolicyArgs
 *                                     {
 *                                         IssueLevel = "MEDIUM",
 *                                         IssueCount = "1",
 *                                         Action = "BLOCK_DELETE_TAG",
 *                                         Logic = "AND",
 *                                     },
 *                                 },
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = true,
 *                         NodeName = "ACTIVATE_REPLICATION",
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = true,
 *                         NodeName = "TRIGGER",
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = false,
 *                         NodeName = "SNAPSHOT",
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigNodeArgs
 *                     {
 *                         NodeConfigs = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigNodeNodeConfigArgs
 *                             {
 *                                 DenyPolicies = new[]
 *                                 {
 *                                     null,
 *                                 },
 *                             },
 *                         },
 *                         Enable = false,
 *                         NodeName = "TRIGGER_SNAPSHOT",
 *                     },
 *                 },
 *                 Routers = new[]
 *                 {
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "DOCKER_IMAGE_BUILD",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "DOCKER_IMAGE_PUSH",
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "DOCKER_IMAGE_PUSH",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "VULNERABILITY_SCANNING",
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "VULNERABILITY_SCANNING",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "ACTIVATE_REPLICATION",
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "ACTIVATE_REPLICATION",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "TRIGGER",
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "VULNERABILITY_SCANNING",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "SNAPSHOT",
 *                             },
 *                         },
 *                     },
 *                     new AliCloud.CR.Inputs.ChainChainConfigRouterArgs
 *                     {
 *                         Froms = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterFromArgs
 *                             {
 *                                 NodeName = "SNAPSHOT",
 *                             },
 *                         },
 *                         Tos = new[]
 *                         {
 *                             new AliCloud.CR.Inputs.ChainChainConfigRouterToArgs
 *                             {
 *                                 NodeName = "TRIGGER_SNAPSHOT",
 *                             },
 *                         },
 *                     },
 *                 },
 *             },
 *         },
 *         ChainName = name,
 *         Description = name,
 *         InstanceId = defaultRegistryEnterpriseNamespace.InstanceId,
 *         RepoName = defaultRegistryEnterpriseRepo.Name,
 *         RepoNamespaceName = defaultRegistryEnterpriseNamespace.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"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
 * 		}
 * 		_, err := cr.NewRegistryEnterpriseInstance(ctx, "default", &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(name),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegistryEnterpriseNamespace, err := cs.NewRegistryEnterpriseNamespace(ctx, "default", &cs.RegistryEnterpriseNamespaceArgs{
 * 			InstanceId:        _default.ID(),
 * 			Name:              pulumi.String(name),
 * 			AutoCreate:        pulumi.Bool(false),
 * 			DefaultVisibility: pulumi.String("PUBLIC"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegistryEnterpriseRepo, err := cs.NewRegistryEnterpriseRepo(ctx, "default", &cs.RegistryEnterpriseRepoArgs{
 * 			InstanceId: _default.ID(),
 * 			Namespace:  defaultRegistryEnterpriseNamespace.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
 * 		}
 * 		_, err = cr.NewChain(ctx, "default", &cr.ChainArgs{
 * 			ChainConfigs: cr.ChainChainConfigArray{
 * 				&cr.ChainChainConfigArgs{
 * 					Nodes: cr.ChainChainConfigNodeArray{
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(true),
 * 							NodeName: pulumi.String("DOCKER_IMAGE_BUILD"),
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(true),
 * 							NodeName: pulumi.String("DOCKER_IMAGE_PUSH"),
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							Enable:   pulumi.Bool(true),
 * 							NodeName: pulumi.String("VULNERABILITY_SCANNING"),
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										&cr.ChainChainConfigNodeNodeConfigDenyPolicyArgs{
 * 											IssueLevel: pulumi.String("MEDIUM"),
 * 											IssueCount: pulumi.String("1"),
 * 											Action:     pulumi.String("BLOCK_DELETE_TAG"),
 * 											Logic:      pulumi.String("AND"),
 * 										},
 * 									},
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(true),
 * 							NodeName: pulumi.String("ACTIVATE_REPLICATION"),
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(true),
 * 							NodeName: pulumi.String("TRIGGER"),
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(false),
 * 							NodeName: pulumi.String("SNAPSHOT"),
 * 						},
 * 						&cr.ChainChainConfigNodeArgs{
 * 							NodeConfigs: cr.ChainChainConfigNodeNodeConfigArray{
 * 								&cr.ChainChainConfigNodeNodeConfigArgs{
 * 									DenyPolicies: cr.ChainChainConfigNodeNodeConfigDenyPolicyArray{
 * 										nil,
 * 									},
 * 								},
 * 							},
 * 							Enable:   pulumi.Bool(false),
 * 							NodeName: pulumi.String("TRIGGER_SNAPSHOT"),
 * 						},
 * 					},
 * 					Routers: cr.ChainChainConfigRouterArray{
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("DOCKER_IMAGE_BUILD"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("DOCKER_IMAGE_PUSH"),
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("DOCKER_IMAGE_PUSH"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("VULNERABILITY_SCANNING"),
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("VULNERABILITY_SCANNING"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("ACTIVATE_REPLICATION"),
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("ACTIVATE_REPLICATION"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("TRIGGER"),
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("VULNERABILITY_SCANNING"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("SNAPSHOT"),
 * 								},
 * 							},
 * 						},
 * 						&cr.ChainChainConfigRouterArgs{
 * 							Froms: cr.ChainChainConfigRouterFromArray{
 * 								&cr.ChainChainConfigRouterFromArgs{
 * 									NodeName: pulumi.String("SNAPSHOT"),
 * 								},
 * 							},
 * 							Tos: cr.ChainChainConfigRouterToArray{
 * 								&cr.ChainChainConfigRouterToArgs{
 * 									NodeName: pulumi.String("TRIGGER_SNAPSHOT"),
 * 								},
 * 							},
 * 						},
 * 					},
 * 				},
 * 			},
 * 			ChainName:         pulumi.String(name),
 * 			Description:       pulumi.String(name),
 * 			InstanceId:        defaultRegistryEnterpriseNamespace.InstanceId,
 * 			RepoName:          defaultRegistryEnterpriseRepo.Name,
 * 			RepoNamespaceName: defaultRegistryEnterpriseNamespace.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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 default_ = new RegistryEnterpriseInstance("default", RegistryEnterpriseInstanceArgs.builder()
 *             .paymentType("Subscription")
 *             .period(1)
 *             .renewPeriod(0)
 *             .renewalStatus("ManualRenewal")
 *             .instanceType("Advanced")
 *             .instanceName(name)
 *             .build());
 *         var defaultRegistryEnterpriseNamespace = new RegistryEnterpriseNamespace("defaultRegistryEnterpriseNamespace", RegistryEnterpriseNamespaceArgs.builder()
 *             .instanceId(default_.id())
 *             .name(name)
 *             .autoCreate(false)
 *             .defaultVisibility("PUBLIC")
 *             .build());
 *         var defaultRegistryEnterpriseRepo = new RegistryEnterpriseRepo("defaultRegistryEnterpriseRepo", RegistryEnterpriseRepoArgs.builder()
 *             .instanceId(default_.id())
 *             .namespace(defaultRegistryEnterpriseNamespace.name())
 *             .name(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()
 *             .chainConfigs(ChainChainConfigArgs.builder()
 *                 .nodes(
 *                     ChainChainConfigNodeArgs.builder()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(true)
 *                         .nodeName("DOCKER_IMAGE_BUILD")
 *                         .build(),
 *                     ChainChainConfigNodeArgs.builder()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(true)
 *                         .nodeName("DOCKER_IMAGE_PUSH")
 *                         .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()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(true)
 *                         .nodeName("ACTIVATE_REPLICATION")
 *                         .build(),
 *                     ChainChainConfigNodeArgs.builder()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(true)
 *                         .nodeName("TRIGGER")
 *                         .build(),
 *                     ChainChainConfigNodeArgs.builder()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(false)
 *                         .nodeName("SNAPSHOT")
 *                         .build(),
 *                     ChainChainConfigNodeArgs.builder()
 *                         .nodeConfigs(ChainChainConfigNodeNodeConfigArgs.builder()
 *                             .denyPolicies()
 *                             .build())
 *                         .enable(false)
 *                         .nodeName("TRIGGER_SNAPSHOT")
 *                         .build())
 *                 .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())
 *                 .build())
 *             .chainName(name)
 *             .description(name)
 *             .instanceId(defaultRegistryEnterpriseNamespace.instanceId())
 *             .repoName(defaultRegistryEnterpriseRepo.name())
 *             .repoNamespaceName(defaultRegistryEnterpriseNamespace.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * configuration:
 *   name:
 *     type: string
 *     default: tf-example
 * resources:
 *   default:
 *     type: alicloud:cr:RegistryEnterpriseInstance
 *     properties:
 *       paymentType: Subscription
 *       period: 1
 *       renewPeriod: 0
 *       renewalStatus: ManualRenewal
 *       instanceType: Advanced
 *       instanceName: ${name}
 *   defaultRegistryEnterpriseNamespace:
 *     type: alicloud:cs:RegistryEnterpriseNamespace
 *     name: default
 *     properties:
 *       instanceId: ${default.id}
 *       name: ${name}
 *       autoCreate: false
 *       defaultVisibility: PUBLIC
 *   defaultRegistryEnterpriseRepo:
 *     type: alicloud:cs:RegistryEnterpriseRepo
 *     name: default
 *     properties:
 *       instanceId: ${default.id}
 *       namespace: ${defaultRegistryEnterpriseNamespace.name}
 *       name: ${name}
 *       summary: this is summary of my new repo
 *       repoType: PUBLIC
 *       detail: this is a public repo
 *   defaultChain:
 *     type: alicloud:cr:Chain
 *     name: default
 *     properties:
 *       chainConfigs:
 *         - nodes:
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: true
 *               nodeName: DOCKER_IMAGE_BUILD
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: true
 *               nodeName: DOCKER_IMAGE_PUSH
 *             - enable: true
 *               nodeName: VULNERABILITY_SCANNING
 *               nodeConfigs:
 *                 - denyPolicies:
 *                     - issueLevel: MEDIUM
 *                       issueCount: 1
 *                       action: BLOCK_DELETE_TAG
 *                       logic: AND
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: true
 *               nodeName: ACTIVATE_REPLICATION
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: true
 *               nodeName: TRIGGER
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: false
 *               nodeName: SNAPSHOT
 *             - nodeConfigs:
 *                 - denyPolicies:
 *                     - {}
 *               enable: false
 *               nodeName: TRIGGER_SNAPSHOT
 *           routers:
 *             - froms:
 *                 - nodeName: DOCKER_IMAGE_BUILD
 *               tos:
 *                 - nodeName: DOCKER_IMAGE_PUSH
 *             - froms:
 *                 - nodeName: DOCKER_IMAGE_PUSH
 *               tos:
 *                 - nodeName: VULNERABILITY_SCANNING
 *             - froms:
 *                 - nodeName: VULNERABILITY_SCANNING
 *               tos:
 *                 - nodeName: ACTIVATE_REPLICATION
 *             - froms:
 *                 - nodeName: ACTIVATE_REPLICATION
 *               tos:
 *                 - nodeName: TRIGGER
 *             - froms:
 *                 - nodeName: VULNERABILITY_SCANNING
 *               tos:
 *                 - nodeName: SNAPSHOT
 *             - froms:
 *                 - nodeName: SNAPSHOT
 *               tos:
 *                 - nodeName: TRIGGER_SNAPSHOT
 *       chainName: ${name}
 *       description: ${name}
 *       instanceId: ${defaultRegistryEnterpriseNamespace.instanceId}
 *       repoName: ${defaultRegistryEnterpriseRepo.name}
 *       repoNamespaceName: ${defaultRegistryEnterpriseNamespace.name}
 * ```
 * 
 * ## Import
 * CR Chain can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:cr/chain:Chain example :
 * ```
 */
public class Chain internal constructor(
    override val javaResource: com.pulumi.alicloud.cr.Chain,
) : KotlinCustomResource(javaResource, ChainMapper) {
    /**
     * The configuration of delivery chain. See `chain_config` below. **NOTE:** This parameter must specify the correct value, otherwise the created resource will be incorrect.
     */
    public val chainConfigs: Output>?
        get() = javaResource.chainConfigs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> toKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Delivery chain ID.
     */
    public val chainId: Output
        get() = javaResource.chainId().applyValue({ args0 -> args0 })

    /**
     * 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.
     */
    public val chainName: Output
        get() = javaResource.chainName().applyValue({ args0 -> args0 })

    /**
     * The description delivery chain.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of CR Enterprise Edition instance.
     */
    public val instanceId: Output
        get() = javaResource.instanceId().applyValue({ args0 -> args0 })

    /**
     * The name of CR Enterprise Edition repository. **NOTE:** This parameter must specify a correct value, otherwise the created resource will be incorrect.
     */
    public val repoName: Output?
        get() = javaResource.repoName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of CR Enterprise Edition namespace. **NOTE:** This parameter must specify the correct value, otherwise the created resource will be incorrect.
     */
    public val repoNamespaceName: Output?
        get() = javaResource.repoNamespaceName().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object ChainMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.alicloud.cr.Chain::class == javaResource::class

    override fun map(javaResource: Resource): Chain = Chain(
        javaResource as
            com.pulumi.alicloud.cr.Chain,
    )
}

/**
 * @see [Chain].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Chain].
 */
public suspend fun chain(name: String, block: suspend ChainResourceBuilder.() -> Unit): Chain {
    val builder = ChainResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Chain].
 * @param name The _unique_ name of the resulting resource.
 */
public fun chain(name: String): Chain {
    val builder = ChainResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy