1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cfg
  5. getCompliancePacks
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

alicloud.cfg.getCompliancePacks

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.38.0 published on Friday, Jun 2, 2023 by Pulumi

    This data source provides the Config Compliance Packs of the current Alibaba Cloud user.

    NOTE: Available in v1.124.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.Cfg.GetCompliancePacks.Invoke(new()
        {
            Ids = new[]
            {
                "cp-152a626622af00bc****",
            },
            NameRegex = "the_resource_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstConfigCompliancePackId"] = example.Apply(getCompliancePacksResult => getCompliancePacksResult.Packs[0]?.Id),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cfg"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := cfg.GetCompliancePacks(ctx, &cfg.GetCompliancePacksArgs{
    			Ids: []string{
    				"cp-152a626622af00bc****",
    			},
    			NameRegex: pulumi.StringRef("the_resource_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstConfigCompliancePackId", example.Packs[0].Id)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cfg.CfgFunctions;
    import com.pulumi.alicloud.cfg.inputs.GetCompliancePacksArgs;
    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 example = CfgFunctions.getCompliancePacks(GetCompliancePacksArgs.builder()
                .ids("cp-152a626622af00bc****")
                .nameRegex("the_resource_name")
                .build());
    
            ctx.export("firstConfigCompliancePackId", example.applyValue(getCompliancePacksResult -> getCompliancePacksResult.packs()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.cfg.get_compliance_packs(ids=["cp-152a626622af00bc****"],
        name_regex="the_resource_name")
    pulumi.export("firstConfigCompliancePackId", example.packs[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.cfg.getCompliancePacks({
        ids: ["cp-152a626622af00bc****"],
        nameRegex: "the_resource_name",
    });
    export const firstConfigCompliancePackId = example.then(example => example.packs?.[0]?.id);
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:cfg:getCompliancePacks
          Arguments:
            ids:
              - cp-152a626622af00bc****
            nameRegex: the_resource_name
    outputs:
      firstConfigCompliancePackId: ${example.packs[0].id}
    

    Using getCompliancePacks

    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 getCompliancePacks(args: GetCompliancePacksArgs, opts?: InvokeOptions): Promise<GetCompliancePacksResult>
    function getCompliancePacksOutput(args: GetCompliancePacksOutputArgs, opts?: InvokeOptions): Output<GetCompliancePacksResult>
    def get_compliance_packs(enable_details: Optional[bool] = None,
                             ids: Optional[Sequence[str]] = None,
                             name_regex: Optional[str] = None,
                             output_file: Optional[str] = None,
                             status: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetCompliancePacksResult
    def get_compliance_packs_output(enable_details: Optional[pulumi.Input[bool]] = None,
                             ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                             name_regex: Optional[pulumi.Input[str]] = None,
                             output_file: Optional[pulumi.Input[str]] = None,
                             status: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetCompliancePacksResult]
    func GetCompliancePacks(ctx *Context, args *GetCompliancePacksArgs, opts ...InvokeOption) (*GetCompliancePacksResult, error)
    func GetCompliancePacksOutput(ctx *Context, args *GetCompliancePacksOutputArgs, opts ...InvokeOption) GetCompliancePacksResultOutput

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

    public static class GetCompliancePacks 
    {
        public static Task<GetCompliancePacksResult> InvokeAsync(GetCompliancePacksArgs args, InvokeOptions? opts = null)
        public static Output<GetCompliancePacksResult> Invoke(GetCompliancePacksInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCompliancePacksResult> getCompliancePacks(GetCompliancePacksArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cfg/getCompliancePacks:getCompliancePacks
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool

    Default to false. Set it to true can output more details about resource attributes.

    Ids List<string>

    A list of Compliance Pack IDs.

    NameRegex string

    A regex string to filter results by Compliance Pack name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    Status string

    The status of the resource. Valid values ACTIVE, CREATING.

    EnableDetails bool

    Default to false. Set it to true can output more details about resource attributes.

    Ids []string

    A list of Compliance Pack IDs.

    NameRegex string

    A regex string to filter results by Compliance Pack name.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    Status string

    The status of the resource. Valid values ACTIVE, CREATING.

    enableDetails Boolean

    Default to false. Set it to true can output more details about resource attributes.

    ids List<String>

    A list of Compliance Pack IDs.

    nameRegex String

    A regex string to filter results by Compliance Pack name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    status String

    The status of the resource. Valid values ACTIVE, CREATING.

    enableDetails boolean

    Default to false. Set it to true can output more details about resource attributes.

    ids string[]

    A list of Compliance Pack IDs.

    nameRegex string

    A regex string to filter results by Compliance Pack name.

    outputFile string

    File name where to save data source results (after running pulumi preview).

    status string

    The status of the resource. Valid values ACTIVE, CREATING.

    enable_details bool

    Default to false. Set it to true can output more details about resource attributes.

    ids Sequence[str]

    A list of Compliance Pack IDs.

    name_regex str

    A regex string to filter results by Compliance Pack name.

    output_file str

    File name where to save data source results (after running pulumi preview).

    status str

    The status of the resource. Valid values ACTIVE, CREATING.

    enableDetails Boolean

    Default to false. Set it to true can output more details about resource attributes.

    ids List<String>

    A list of Compliance Pack IDs.

    nameRegex String

    A regex string to filter results by Compliance Pack name.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    status String

    The status of the resource. Valid values ACTIVE, CREATING.

    getCompliancePacks Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>
    Names List<string>

    A list of Compliance Pack names.

    Packs List<Pulumi.AliCloud.Cfg.Outputs.GetCompliancePacksPack>

    A list of Config Compliance Packs. Each element contains the following attributes:

    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string

    The status of the resource.

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string
    Names []string

    A list of Compliance Pack names.

    Packs []GetCompliancePacksPack

    A list of Config Compliance Packs. Each element contains the following attributes:

    EnableDetails bool
    NameRegex string
    OutputFile string
    Status string

    The status of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>

    A list of Compliance Pack names.

    packs List<GetCompliancePacksPack>

    A list of Config Compliance Packs. Each element contains the following attributes:

    enableDetails Boolean
    nameRegex String
    outputFile String
    status String

    The status of the resource.

    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]
    names string[]

    A list of Compliance Pack names.

    packs GetCompliancePacksPack[]

    A list of Config Compliance Packs. Each element contains the following attributes:

    enableDetails boolean
    nameRegex string
    outputFile string
    status string

    The status of the resource.

    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]
    names Sequence[str]

    A list of Compliance Pack names.

    packs Sequence[GetCompliancePacksPack]

    A list of Config Compliance Packs. Each element contains the following attributes:

    enable_details bool
    name_regex str
    output_file str
    status str

    The status of the resource.

    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    names List<String>

    A list of Compliance Pack names.

    packs List<Property Map>

    A list of Config Compliance Packs. Each element contains the following attributes:

    enableDetails Boolean
    nameRegex String
    outputFile String
    status String

    The status of the resource.

    Supporting Types

    GetCompliancePacksPack

    AccountId string

    The Aliyun User Id.

    CompliancePackId string

    The Compliance Package ID.

    CompliancePackName string

    The Compliance Package Name.

    CompliancePackTemplateId string

    The template ID of the Compliance Package.

    ConfigRules List<Pulumi.AliCloud.Cfg.Inputs.GetCompliancePacksPackConfigRule>

    A list of The Compliance Package Rules.

    Description string

    The description of compliance pack.

    Id string

    The ID of the Compliance Pack.

    RiskLevel int

    The Ris Level.

    Status string

    The status of the resource. Valid values ACTIVE, CREATING.

    AccountId string

    The Aliyun User Id.

    CompliancePackId string

    The Compliance Package ID.

    CompliancePackName string

    The Compliance Package Name.

    CompliancePackTemplateId string

    The template ID of the Compliance Package.

    ConfigRules []GetCompliancePacksPackConfigRule

    A list of The Compliance Package Rules.

    Description string

    The description of compliance pack.

    Id string

    The ID of the Compliance Pack.

    RiskLevel int

    The Ris Level.

    Status string

    The status of the resource. Valid values ACTIVE, CREATING.

    accountId String

    The Aliyun User Id.

    compliancePackId String

    The Compliance Package ID.

    compliancePackName String

    The Compliance Package Name.

    compliancePackTemplateId String

    The template ID of the Compliance Package.

    configRules List<GetCompliancePacksPackConfigRule>

    A list of The Compliance Package Rules.

    description String

    The description of compliance pack.

    id String

    The ID of the Compliance Pack.

    riskLevel Integer

    The Ris Level.

    status String

    The status of the resource. Valid values ACTIVE, CREATING.

    accountId string

    The Aliyun User Id.

    compliancePackId string

    The Compliance Package ID.

    compliancePackName string

    The Compliance Package Name.

    compliancePackTemplateId string

    The template ID of the Compliance Package.

    configRules GetCompliancePacksPackConfigRule[]

    A list of The Compliance Package Rules.

    description string

    The description of compliance pack.

    id string

    The ID of the Compliance Pack.

    riskLevel number

    The Ris Level.

    status string

    The status of the resource. Valid values ACTIVE, CREATING.

    account_id str

    The Aliyun User Id.

    compliance_pack_id str

    The Compliance Package ID.

    compliance_pack_name str

    The Compliance Package Name.

    compliance_pack_template_id str

    The template ID of the Compliance Package.

    config_rules Sequence[GetCompliancePacksPackConfigRule]

    A list of The Compliance Package Rules.

    description str

    The description of compliance pack.

    id str

    The ID of the Compliance Pack.

    risk_level int

    The Ris Level.

    status str

    The status of the resource. Valid values ACTIVE, CREATING.

    accountId String

    The Aliyun User Id.

    compliancePackId String

    The Compliance Package ID.

    compliancePackName String

    The Compliance Package Name.

    compliancePackTemplateId String

    The template ID of the Compliance Package.

    configRules List<Property Map>

    A list of The Compliance Package Rules.

    description String

    The description of compliance pack.

    id String

    The ID of the Compliance Pack.

    riskLevel Number

    The Ris Level.

    status String

    The status of the resource. Valid values ACTIVE, CREATING.

    GetCompliancePacksPackConfigRule

    ConfigRuleId string

    The ID of the rule.

    ConfigRuleParameters []GetCompliancePacksPackConfigRuleConfigRuleParameter

    A list of parameter rules.

    ManagedRuleIdentifier string

    Managed Rule Identifier.

    configRuleId String

    The ID of the rule.

    configRuleParameters List<GetCompliancePacksPackConfigRuleConfigRuleParameter>

    A list of parameter rules.

    managedRuleIdentifier String

    Managed Rule Identifier.

    configRuleId string

    The ID of the rule.

    configRuleParameters GetCompliancePacksPackConfigRuleConfigRuleParameter[]

    A list of parameter rules.

    managedRuleIdentifier string

    Managed Rule Identifier.

    configRuleId String

    The ID of the rule.

    configRuleParameters List<Property Map>

    A list of parameter rules.

    managedRuleIdentifier String

    Managed Rule Identifier.

    GetCompliancePacksPackConfigRuleConfigRuleParameter

    ParameterName string

    The Parameter Name.

    ParameterValue string

    The Parameter Value.

    Required bool

    Required.

    ParameterName string

    The Parameter Name.

    ParameterValue string

    The Parameter Value.

    Required bool

    Required.

    parameterName String

    The Parameter Name.

    parameterValue String

    The Parameter Value.

    required Boolean

    Required.

    parameterName string

    The Parameter Name.

    parameterValue string

    The Parameter Value.

    required boolean

    Required.

    parameter_name str

    The Parameter Name.

    parameter_value str

    The Parameter Value.

    required bool

    Required.

    parameterName String

    The Parameter Name.

    parameterValue String

    The Parameter Value.

    required Boolean

    Required.

    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.38.0 published on Friday, Jun 2, 2023 by Pulumi