1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cr
  5. getChains
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.cr.getChains

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Cr Chains of the current Alibaba Cloud user.

    For information about CR Chains and how to use it, see What is Chain.

    NOTE: Available in v1.161.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.cr.getChains({
        instanceId: "example_value",
        ids: [
            "example_value-1",
            "example_value-2",
        ],
    });
    export const crChainId1 = ids.then(ids => ids.chains?.[0]?.id);
    const nameRegex = alicloud.cr.getChains({
        instanceId: "example_value",
        nameRegex: "^my-Chain",
    });
    export const crChainId2 = nameRegex.then(nameRegex => nameRegex.chains?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.cr.get_chains(instance_id="example_value",
        ids=[
            "example_value-1",
            "example_value-2",
        ])
    pulumi.export("crChainId1", ids.chains[0].id)
    name_regex = alicloud.cr.get_chains(instance_id="example_value",
        name_regex="^my-Chain")
    pulumi.export("crChainId2", name_regex.chains[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := cr.GetChains(ctx, &cr.GetChainsArgs{
    			InstanceId: "example_value",
    			Ids: []string{
    				"example_value-1",
    				"example_value-2",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("crChainId1", ids.Chains[0].Id)
    		nameRegex, err := cr.GetChains(ctx, &cr.GetChainsArgs{
    			InstanceId: "example_value",
    			NameRegex:  pulumi.StringRef("^my-Chain"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("crChainId2", nameRegex.Chains[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.CR.GetChains.Invoke(new()
        {
            InstanceId = "example_value",
            Ids = new[]
            {
                "example_value-1",
                "example_value-2",
            },
        });
    
        var nameRegex = AliCloud.CR.GetChains.Invoke(new()
        {
            InstanceId = "example_value",
            NameRegex = "^my-Chain",
        });
    
        return new Dictionary<string, object?>
        {
            ["crChainId1"] = ids.Apply(getChainsResult => getChainsResult.Chains[0]?.Id),
            ["crChainId2"] = nameRegex.Apply(getChainsResult => getChainsResult.Chains[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cr.CrFunctions;
    import com.pulumi.alicloud.cr.inputs.GetChainsArgs;
    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 ids = CrFunctions.getChains(GetChainsArgs.builder()
                .instanceId("example_value")
                .ids(            
                    "example_value-1",
                    "example_value-2")
                .build());
    
            ctx.export("crChainId1", ids.applyValue(getChainsResult -> getChainsResult.chains()[0].id()));
            final var nameRegex = CrFunctions.getChains(GetChainsArgs.builder()
                .instanceId("example_value")
                .nameRegex("^my-Chain")
                .build());
    
            ctx.export("crChainId2", nameRegex.applyValue(getChainsResult -> getChainsResult.chains()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:cr:getChains
          Arguments:
            instanceId: example_value
            ids:
              - example_value-1
              - example_value-2
      nameRegex:
        fn::invoke:
          Function: alicloud:cr:getChains
          Arguments:
            instanceId: example_value
            nameRegex: ^my-Chain
    outputs:
      crChainId1: ${ids.chains[0].id}
      crChainId2: ${nameRegex.chains[0].id}
    

    Using getChains

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getChains(args: GetChainsArgs, opts?: InvokeOptions): Promise<GetChainsResult>
    function getChainsOutput(args: GetChainsOutputArgs, opts?: InvokeOptions): Output<GetChainsResult>
    def get_chains(enable_details: Optional[bool] = None,
                   ids: Optional[Sequence[str]] = None,
                   instance_id: Optional[str] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   repo_name: Optional[str] = None,
                   repo_namespace_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetChainsResult
    def get_chains_output(enable_details: Optional[pulumi.Input[bool]] = None,
                   ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   instance_id: Optional[pulumi.Input[str]] = None,
                   name_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   repo_name: Optional[pulumi.Input[str]] = None,
                   repo_namespace_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetChainsResult]
    func GetChains(ctx *Context, args *GetChainsArgs, opts ...InvokeOption) (*GetChainsResult, error)
    func GetChainsOutput(ctx *Context, args *GetChainsOutputArgs, opts ...InvokeOption) GetChainsResultOutput

    > Note: This function is named GetChains in the Go SDK.

    public static class GetChains 
    {
        public static Task<GetChainsResult> InvokeAsync(GetChainsArgs args, InvokeOptions? opts = null)
        public static Output<GetChainsResult> Invoke(GetChainsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetChainsResult> getChains(GetChainsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cr/getChains:getChains
      arguments:
        # arguments dictionary

    The following arguments are supported:

    InstanceId string
    The ID of CR Enterprise Edition instance.
    EnableDetails bool
    Ids List<string>
    A list of Chain IDs.
    NameRegex string
    A regex string to filter results by Chain name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RepoName string
    The name of CR Enterprise Edition repository.
    RepoNamespaceName string
    The name of CR Enterprise Edition namespace.
    InstanceId string
    The ID of CR Enterprise Edition instance.
    EnableDetails bool
    Ids []string
    A list of Chain IDs.
    NameRegex string
    A regex string to filter results by Chain name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RepoName string
    The name of CR Enterprise Edition repository.
    RepoNamespaceName string
    The name of CR Enterprise Edition namespace.
    instanceId String
    The ID of CR Enterprise Edition instance.
    enableDetails Boolean
    ids List<String>
    A list of Chain IDs.
    nameRegex String
    A regex string to filter results by Chain name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    repoName String
    The name of CR Enterprise Edition repository.
    repoNamespaceName String
    The name of CR Enterprise Edition namespace.
    instanceId string
    The ID of CR Enterprise Edition instance.
    enableDetails boolean
    ids string[]
    A list of Chain IDs.
    nameRegex string
    A regex string to filter results by Chain name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    repoName string
    The name of CR Enterprise Edition repository.
    repoNamespaceName string
    The name of CR Enterprise Edition namespace.
    instance_id str
    The ID of CR Enterprise Edition instance.
    enable_details bool
    ids Sequence[str]
    A list of Chain IDs.
    name_regex str
    A regex string to filter results by Chain name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    repo_name str
    The name of CR Enterprise Edition repository.
    repo_namespace_name str
    The name of CR Enterprise Edition namespace.
    instanceId String
    The ID of CR Enterprise Edition instance.
    enableDetails Boolean
    ids List<String>
    A list of Chain IDs.
    nameRegex String
    A regex string to filter results by Chain name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    repoName String
    The name of CR Enterprise Edition repository.
    repoNamespaceName String
    The name of CR Enterprise Edition namespace.

    getChains Result

    The following output properties are available:

    Chains List<Pulumi.AliCloud.CR.Outputs.GetChainsChain>
    A list of Cr Chains. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Chain IDs.
    InstanceId string
    The ID of CR Enterprise Edition instance.
    Names List<string>
    A list of Chain names.
    EnableDetails bool
    NameRegex string
    OutputFile string
    RepoName string
    RepoNamespaceName string
    Chains []GetChainsChain
    A list of Cr Chains. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Chain IDs.
    InstanceId string
    The ID of CR Enterprise Edition instance.
    Names []string
    A list of Chain names.
    EnableDetails bool
    NameRegex string
    OutputFile string
    RepoName string
    RepoNamespaceName string
    chains List<GetChainsChain>
    A list of Cr Chains. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Chain IDs.
    instanceId String
    The ID of CR Enterprise Edition instance.
    names List<String>
    A list of Chain names.
    enableDetails Boolean
    nameRegex String
    outputFile String
    repoName String
    repoNamespaceName String
    chains GetChainsChain[]
    A list of Cr Chains. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Chain IDs.
    instanceId string
    The ID of CR Enterprise Edition instance.
    names string[]
    A list of Chain names.
    enableDetails boolean
    nameRegex string
    outputFile string
    repoName string
    repoNamespaceName string
    chains Sequence[GetChainsChain]
    A list of Cr Chains. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Chain IDs.
    instance_id str
    The ID of CR Enterprise Edition instance.
    names Sequence[str]
    A list of Chain names.
    enable_details bool
    name_regex str
    output_file str
    repo_name str
    repo_namespace_name str
    chains List<Property Map>
    A list of Cr Chains. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Chain IDs.
    instanceId String
    The ID of CR Enterprise Edition instance.
    names List<String>
    A list of Chain names.
    enableDetails Boolean
    nameRegex String
    outputFile String
    repoName String
    repoNamespaceName String

    Supporting Types

    GetChainsChain

    ChainConfigs List<Pulumi.AliCloud.CR.Inputs.GetChainsChainChainConfig>
    The configuration of delivery chain.
    ChainId string
    The ID of delivery chain.
    ChainName string
    The name of delivery chain.
    CreateTime string
    The creation time of delivery chain.
    Description string
    The description of delivery chain.
    Id string
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    InstanceId string
    The ID of CR Enterprise Edition instance.
    ModifiedTime string
    The modification time of delivery chain description.
    ScopeId string
    Delivery chain scope ID.
    ScopeType string
    Delivery chain scope type.
    ChainConfigs []GetChainsChainChainConfig
    The configuration of delivery chain.
    ChainId string
    The ID of delivery chain.
    ChainName string
    The name of delivery chain.
    CreateTime string
    The creation time of delivery chain.
    Description string
    The description of delivery chain.
    Id string
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    InstanceId string
    The ID of CR Enterprise Edition instance.
    ModifiedTime string
    The modification time of delivery chain description.
    ScopeId string
    Delivery chain scope ID.
    ScopeType string
    Delivery chain scope type.
    chainConfigs List<GetChainsChainChainConfig>
    The configuration of delivery chain.
    chainId String
    The ID of delivery chain.
    chainName String
    The name of delivery chain.
    createTime String
    The creation time of delivery chain.
    description String
    The description of delivery chain.
    id String
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    instanceId String
    The ID of CR Enterprise Edition instance.
    modifiedTime String
    The modification time of delivery chain description.
    scopeId String
    Delivery chain scope ID.
    scopeType String
    Delivery chain scope type.
    chainConfigs GetChainsChainChainConfig[]
    The configuration of delivery chain.
    chainId string
    The ID of delivery chain.
    chainName string
    The name of delivery chain.
    createTime string
    The creation time of delivery chain.
    description string
    The description of delivery chain.
    id string
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    instanceId string
    The ID of CR Enterprise Edition instance.
    modifiedTime string
    The modification time of delivery chain description.
    scopeId string
    Delivery chain scope ID.
    scopeType string
    Delivery chain scope type.
    chain_configs Sequence[GetChainsChainChainConfig]
    The configuration of delivery chain.
    chain_id str
    The ID of delivery chain.
    chain_name str
    The name of delivery chain.
    create_time str
    The creation time of delivery chain.
    description str
    The description of delivery chain.
    id str
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    instance_id str
    The ID of CR Enterprise Edition instance.
    modified_time str
    The modification time of delivery chain description.
    scope_id str
    Delivery chain scope ID.
    scope_type str
    Delivery chain scope type.
    chainConfigs List<Property Map>
    The configuration of delivery chain.
    chainId String
    The ID of delivery chain.
    chainName String
    The name of delivery chain.
    createTime String
    The creation time of delivery chain.
    description String
    The description of delivery chain.
    id String
    The resource ID of the delivery chain. The value formats as <instance_id>:<chain_id>.
    instanceId String
    The ID of CR Enterprise Edition instance.
    modifiedTime String
    The modification time of delivery chain description.
    scopeId String
    Delivery chain scope ID.
    scopeType String
    Delivery chain scope type.

    GetChainsChainChainConfig

    Nodes List<Pulumi.AliCloud.CR.Inputs.GetChainsChainChainConfigNode>
    Each node in the delivery chain.
    Routers List<Pulumi.AliCloud.CR.Inputs.GetChainsChainChainConfigRouter>
    Execution sequence relationship between delivery chain nodes.
    Nodes []GetChainsChainChainConfigNode
    Each node in the delivery chain.
    Routers []GetChainsChainChainConfigRouter
    Execution sequence relationship between delivery chain nodes.
    nodes List<GetChainsChainChainConfigNode>
    Each node in the delivery chain.
    routers List<GetChainsChainChainConfigRouter>
    Execution sequence relationship between delivery chain nodes.
    nodes GetChainsChainChainConfigNode[]
    Each node in the delivery chain.
    routers GetChainsChainChainConfigRouter[]
    Execution sequence relationship between delivery chain nodes.
    nodes Sequence[GetChainsChainChainConfigNode]
    Each node in the delivery chain.
    routers Sequence[GetChainsChainChainConfigRouter]
    Execution sequence relationship between delivery chain nodes.
    nodes List<Property Map>
    Each node in the delivery chain.
    routers List<Property Map>
    Execution sequence relationship between delivery chain nodes.

    GetChainsChainChainConfigNode

    Enable bool
    Whether to enable the delivery chain node. Valid values: true, false.
    NodeConfigs List<Pulumi.AliCloud.CR.Inputs.GetChainsChainChainConfigNodeNodeConfig>
    The configuration of delivery chain node.
    NodeName string
    The name of delivery chain node.
    Enable bool
    Whether to enable the delivery chain node. Valid values: true, false.
    NodeConfigs []GetChainsChainChainConfigNodeNodeConfig
    The configuration of delivery chain node.
    NodeName string
    The name of delivery chain node.
    enable Boolean
    Whether to enable the delivery chain node. Valid values: true, false.
    nodeConfigs List<GetChainsChainChainConfigNodeNodeConfig>
    The configuration of delivery chain node.
    nodeName String
    The name of delivery chain node.
    enable boolean
    Whether to enable the delivery chain node. Valid values: true, false.
    nodeConfigs GetChainsChainChainConfigNodeNodeConfig[]
    The configuration of delivery chain node.
    nodeName string
    The name of delivery chain node.
    enable bool
    Whether to enable the delivery chain node. Valid values: true, false.
    node_configs Sequence[GetChainsChainChainConfigNodeNodeConfig]
    The configuration of delivery chain node.
    node_name str
    The name of delivery chain node.
    enable Boolean
    Whether to enable the delivery chain node. Valid values: true, false.
    nodeConfigs List<Property Map>
    The configuration of delivery chain node.
    nodeName String
    The name of delivery chain node.

    GetChainsChainChainConfigNodeNodeConfig

    DenyPolicies List<Pulumi.AliCloud.CR.Inputs.GetChainsChainChainConfigNodeNodeConfigDenyPolicy>
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.
    DenyPolicies []GetChainsChainChainConfigNodeNodeConfigDenyPolicy
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.
    denyPolicies List<GetChainsChainChainConfigNodeNodeConfigDenyPolicy>
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.
    denyPolicies GetChainsChainChainConfigNodeNodeConfigDenyPolicy[]
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.
    deny_policies Sequence[GetChainsChainChainConfigNodeNodeConfigDenyPolicy]
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.
    denyPolicies List<Property Map>
    Blocking rules for scanning nodes in delivery chain nodes. Note: When node_name is VULNERABILITY_SCANNING, the parameters in deny_policy need to be filled in.

    GetChainsChainChainConfigNodeNodeConfigDenyPolicy

    IssueCount string
    The count of scanning vulnerabilities that triggers blocking.
    IssueLevel string
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    Logic string
    The logic of trigger blocking. Valid values: AND, OR.
    Action string
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.
    IssueCount string
    The count of scanning vulnerabilities that triggers blocking.
    IssueLevel string
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    Logic string
    The logic of trigger blocking. Valid values: AND, OR.
    Action string
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.
    issueCount String
    The count of scanning vulnerabilities that triggers blocking.
    issueLevel String
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    logic String
    The logic of trigger blocking. Valid values: AND, OR.
    action String
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.
    issueCount string
    The count of scanning vulnerabilities that triggers blocking.
    issueLevel string
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    logic string
    The logic of trigger blocking. Valid values: AND, OR.
    action string
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.
    issue_count str
    The count of scanning vulnerabilities that triggers blocking.
    issue_level str
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    logic str
    The logic of trigger blocking. Valid values: AND, OR.
    action str
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.
    issueCount String
    The count of scanning vulnerabilities that triggers blocking.
    issueLevel String
    The level of scanning vulnerability that triggers blocking. Valid values: LOW, MEDIUM, HIGH, UNKNOWN.
    logic String
    The logic of trigger blocking. Valid values: AND, OR.
    action String
    The action of trigger blocking. Valid values: BLOCK, BLOCK_RETAG, BLOCK_DELETE_TAG. While Block means block the delivery chain from continuing to execute, BLOCK_RETAG means block overwriting push image tag, BLOCK_DELETE_TAG means block deletion of mirror tags.

    GetChainsChainChainConfigRouter

    froms List<Property Map>
    Source node.
    tos List<Property Map>
    Destination node.

    GetChainsChainChainConfigRouterFrom

    NodeName string
    The name of delivery chain node.
    NodeName string
    The name of delivery chain node.
    nodeName String
    The name of delivery chain node.
    nodeName string
    The name of delivery chain node.
    node_name str
    The name of delivery chain node.
    nodeName String
    The name of delivery chain node.

    GetChainsChainChainConfigRouterTo

    NodeName string
    The name of delivery chain node.
    NodeName string
    The name of delivery chain node.
    nodeName String
    The name of delivery chain node.
    nodeName string
    The name of delivery chain node.
    node_name str
    The name of delivery chain node.
    nodeName String
    The name of delivery chain node.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi