Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.cfg.getCompliancePacks
Explore with Pulumi AI
This data source provides the Config Compliance Packs of the current Alibaba Cloud user.
NOTE: Available in v1.124.0+.
Example Usage
Basic Usage
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);
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)
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
})
}
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 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()));
}
}
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:
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of Compliance Pack IDs.
- Name
Regex string - A regex string to filter results by Compliance Pack name.
- Output
File 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 totrue
can output more details about resource attributes. - Ids []string
- A list of Compliance Pack IDs.
- Name
Regex string - A regex string to filter results by Compliance Pack name.
- Output
File 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 Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Compliance Pack IDs.
- name
Regex String - A regex string to filter results by Compliance Pack name.
- output
File 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 boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of Compliance Pack IDs.
- name
Regex string - A regex string to filter results by Compliance Pack name.
- output
File 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 totrue
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
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Compliance Pack IDs.
- name
Regex String - A regex string to filter results by Compliance Pack name.
- output
File 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.
Ali Cloud. Cfg. Outputs. Get Compliance Packs Pack> - A list of Config Compliance Packs. Each element contains the following attributes:
- Enable
Details bool - Name
Regex string - Output
File 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
[]Get
Compliance Packs Pack - A list of Config Compliance Packs. Each element contains the following attributes:
- Enable
Details bool - Name
Regex string - Output
File 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<Get
Compliance Packs Pack> - A list of Config Compliance Packs. Each element contains the following attributes:
- enable
Details Boolean - name
Regex String - output
File 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
Get
Compliance Packs Pack[] - A list of Config Compliance Packs. Each element contains the following attributes:
- enable
Details boolean - name
Regex string - output
File 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[Get
Compliance Packs Pack] - 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:
- enable
Details Boolean - name
Regex String - output
File String - status String
- The status of the resource.
Supporting Types
GetCompliancePacksPack
- Account
Id string - The Aliyun User Id.
- Compliance
Pack stringId - The Compliance Package ID.
- Compliance
Pack stringName - The Compliance Package Name.
- Compliance
Pack stringTemplate Id - The template ID of the Compliance Package.
- Config
Rules List<Pulumi.Ali Cloud. Cfg. Inputs. Get Compliance Packs Pack Config Rule> - A list of The Compliance Package Rules.
- Description string
- The description of compliance pack.
- Id string
- The ID of the Compliance Pack.
- Risk
Level int - The Ris Level.
- Status string
- The status of the resource. Valid values
ACTIVE
,CREATING
.
- Account
Id string - The Aliyun User Id.
- Compliance
Pack stringId - The Compliance Package ID.
- Compliance
Pack stringName - The Compliance Package Name.
- Compliance
Pack stringTemplate Id - The template ID of the Compliance Package.
- Config
Rules []GetCompliance Packs Pack Config Rule - A list of The Compliance Package Rules.
- Description string
- The description of compliance pack.
- Id string
- The ID of the Compliance Pack.
- Risk
Level int - The Ris Level.
- Status string
- The status of the resource. Valid values
ACTIVE
,CREATING
.
- account
Id String - The Aliyun User Id.
- compliance
Pack StringId - The Compliance Package ID.
- compliance
Pack StringName - The Compliance Package Name.
- compliance
Pack StringTemplate Id - The template ID of the Compliance Package.
- config
Rules List<GetCompliance Packs Pack Config Rule> - A list of The Compliance Package Rules.
- description String
- The description of compliance pack.
- id String
- The ID of the Compliance Pack.
- risk
Level Integer - The Ris Level.
- status String
- The status of the resource. Valid values
ACTIVE
,CREATING
.
- account
Id string - The Aliyun User Id.
- compliance
Pack stringId - The Compliance Package ID.
- compliance
Pack stringName - The Compliance Package Name.
- compliance
Pack stringTemplate Id - The template ID of the Compliance Package.
- config
Rules GetCompliance Packs Pack Config Rule[] - A list of The Compliance Package Rules.
- description string
- The description of compliance pack.
- id string
- The ID of the Compliance Pack.
- risk
Level number - The Ris Level.
- status string
- The status of the resource. Valid values
ACTIVE
,CREATING
.
- account_
id str - The Aliyun User Id.
- compliance_
pack_ strid - The Compliance Package ID.
- compliance_
pack_ strname - The Compliance Package Name.
- compliance_
pack_ strtemplate_ id - The template ID of the Compliance Package.
- config_
rules Sequence[GetCompliance Packs Pack Config Rule] - 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
.
- account
Id String - The Aliyun User Id.
- compliance
Pack StringId - The Compliance Package ID.
- compliance
Pack StringName - The Compliance Package Name.
- compliance
Pack StringTemplate Id - The template ID of the Compliance Package.
- config
Rules 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.
- risk
Level Number - The Ris Level.
- status String
- The status of the resource. Valid values
ACTIVE
,CREATING
.
GetCompliancePacksPackConfigRule
- Config
Rule stringId - The ID of the rule.
- Config
Rule List<Pulumi.Parameters Ali Cloud. Cfg. Inputs. Get Compliance Packs Pack Config Rule Config Rule Parameter> - A list of parameter rules.
- Managed
Rule stringIdentifier - Managed Rule Identifier.
- Config
Rule stringId - The ID of the rule.
- Config
Rule []GetParameters Compliance Packs Pack Config Rule Config Rule Parameter - A list of parameter rules.
- Managed
Rule stringIdentifier - Managed Rule Identifier.
- config
Rule StringId - The ID of the rule.
- config
Rule List<GetParameters Compliance Packs Pack Config Rule Config Rule Parameter> - A list of parameter rules.
- managed
Rule StringIdentifier - Managed Rule Identifier.
- config
Rule stringId - The ID of the rule.
- config
Rule GetParameters Compliance Packs Pack Config Rule Config Rule Parameter[] - A list of parameter rules.
- managed
Rule stringIdentifier - Managed Rule Identifier.
- config_
rule_ strid - The ID of the rule.
- config_
rule_ Sequence[Getparameters Compliance Packs Pack Config Rule Config Rule Parameter] - A list of parameter rules.
- managed_
rule_ stridentifier - Managed Rule Identifier.
- config
Rule StringId - The ID of the rule.
- config
Rule List<Property Map>Parameters - A list of parameter rules.
- managed
Rule StringIdentifier - Managed Rule Identifier.
GetCompliancePacksPackConfigRuleConfigRuleParameter
- Parameter
Name string - The Parameter Name.
- Parameter
Value string - The Parameter Value.
- Required bool
- Required.
- Parameter
Name string - The Parameter Name.
- Parameter
Value string - The Parameter Value.
- Required bool
- Required.
- parameter
Name String - The Parameter Name.
- parameter
Value String - The Parameter Value.
- required Boolean
- Required.
- parameter
Name string - The Parameter Name.
- parameter
Value string - The Parameter Value.
- required boolean
- Required.
- parameter_
name str - The Parameter Name.
- parameter_
value str - The Parameter Value.
- required bool
- Required.
- parameter
Name String - The Parameter Name.
- parameter
Value 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.