UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

261 lines (260 loc) • 10.7 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a Config Organization Custom Policy Rule. More information about these rules can be found in the [Enabling AWS Config Rules Across all Accounts in Your Organization](https://docs.aws.amazon.com/config/latest/developerguide/config-rule-multi-account-deployment.html) and [AWS Config Managed Rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html) documentation. For working with Organization Managed Rules (those invoking an AWS managed rule), see the `aws_config_organization_managed__rule` resource. * * > **NOTE:** This resource must be created in the Organization master account and rules will include the master account unless its ID is added to the `excludedAccounts` argument. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cfg.OrganizationCustomPolicyRule("example", { * name: "example_rule_name", * policyRuntime: "guard-2.x.x", * policyText: `let status = ['ACTIVE'] * * rule tableisactive when * resourceType == "AWS::DynamoDB::Table" { * configuration.tableStatus == %status * } * * rule checkcompliance when * resourceType == "AWS::DynamoDB::Table" * tableisactive { * let pitr = supplementaryConfiguration.ContinuousBackupsDescription.pointInTimeRecoveryDescription.pointInTimeRecoveryStatus * %pitr == "ENABLED" * } * `, * resourceTypesScopes: ["AWS::DynamoDB::Table"], * }); * ``` * * ## Import * * Using `pulumi import`, import a Config Organization Custom Policy Rule using the `name` argument. For example: * * ```sh * $ pulumi import aws:cfg/organizationCustomPolicyRule:OrganizationCustomPolicyRule example example_rule_name * ``` */ export declare class OrganizationCustomPolicyRule extends pulumi.CustomResource { /** * Get an existing OrganizationCustomPolicyRule resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: OrganizationCustomPolicyRuleState, opts?: pulumi.CustomResourceOptions): OrganizationCustomPolicyRule; /** * Returns true if the given object is an instance of OrganizationCustomPolicyRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is OrganizationCustomPolicyRule; /** * Amazon Resource Name (ARN) of the rule. */ readonly arn: pulumi.Output<string>; /** * List of accounts that you can enable debug logging for. The list is null when debug logging is enabled for all accounts. */ readonly debugLogDeliveryAccounts: pulumi.Output<string[] | undefined>; /** * Description of the rule. */ readonly description: pulumi.Output<string | undefined>; /** * List of AWS account identifiers to exclude from the rule. */ readonly excludedAccounts: pulumi.Output<string[] | undefined>; /** * A string in JSON format that is passed to the AWS Config Rule Lambda Function. */ readonly inputParameters: pulumi.Output<string | undefined>; /** * Maximum frequency with which AWS Config runs evaluations for a rule, if the rule is triggered at a periodic frequency. Defaults to `TwentyFour_Hours` for periodic frequency triggered rules. Valid values: `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, or `TwentyFour_Hours`. */ readonly maximumExecutionFrequency: pulumi.Output<string | undefined>; /** * Name of the rule. */ readonly name: pulumi.Output<string>; /** * Runtime system for policy rules. */ readonly policyRuntime: pulumi.Output<string>; /** * Policy definition containing the rule logic. */ readonly policyText: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Identifier of the AWS resource to evaluate. */ readonly resourceIdScope: pulumi.Output<string | undefined>; /** * List of types of AWS resources to evaluate. */ readonly resourceTypesScopes: pulumi.Output<string[] | undefined>; /** * Tag key of AWS resources to evaluate. */ readonly tagKeyScope: pulumi.Output<string | undefined>; /** * Tag value of AWS resources to evaluate. */ readonly tagValueScope: pulumi.Output<string | undefined>; /** * List of notification types that trigger AWS Config to run an evaluation for the rule. Valid values: `ConfigurationItemChangeNotification`, `OversizedConfigurationItemChangeNotification`. * * The following arguments are optional: */ readonly triggerTypes: pulumi.Output<string[]>; /** * Create a OrganizationCustomPolicyRule resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: OrganizationCustomPolicyRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering OrganizationCustomPolicyRule resources. */ export interface OrganizationCustomPolicyRuleState { /** * Amazon Resource Name (ARN) of the rule. */ arn?: pulumi.Input<string>; /** * List of accounts that you can enable debug logging for. The list is null when debug logging is enabled for all accounts. */ debugLogDeliveryAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * Description of the rule. */ description?: pulumi.Input<string>; /** * List of AWS account identifiers to exclude from the rule. */ excludedAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * A string in JSON format that is passed to the AWS Config Rule Lambda Function. */ inputParameters?: pulumi.Input<string>; /** * Maximum frequency with which AWS Config runs evaluations for a rule, if the rule is triggered at a periodic frequency. Defaults to `TwentyFour_Hours` for periodic frequency triggered rules. Valid values: `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, or `TwentyFour_Hours`. */ maximumExecutionFrequency?: pulumi.Input<string>; /** * Name of the rule. */ name?: pulumi.Input<string>; /** * Runtime system for policy rules. */ policyRuntime?: pulumi.Input<string>; /** * Policy definition containing the rule logic. */ policyText?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * Identifier of the AWS resource to evaluate. */ resourceIdScope?: pulumi.Input<string>; /** * List of types of AWS resources to evaluate. */ resourceTypesScopes?: pulumi.Input<pulumi.Input<string>[]>; /** * Tag key of AWS resources to evaluate. */ tagKeyScope?: pulumi.Input<string>; /** * Tag value of AWS resources to evaluate. */ tagValueScope?: pulumi.Input<string>; /** * List of notification types that trigger AWS Config to run an evaluation for the rule. Valid values: `ConfigurationItemChangeNotification`, `OversizedConfigurationItemChangeNotification`. * * The following arguments are optional: */ triggerTypes?: pulumi.Input<pulumi.Input<string>[]>; } /** * The set of arguments for constructing a OrganizationCustomPolicyRule resource. */ export interface OrganizationCustomPolicyRuleArgs { /** * List of accounts that you can enable debug logging for. The list is null when debug logging is enabled for all accounts. */ debugLogDeliveryAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * Description of the rule. */ description?: pulumi.Input<string>; /** * List of AWS account identifiers to exclude from the rule. */ excludedAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * A string in JSON format that is passed to the AWS Config Rule Lambda Function. */ inputParameters?: pulumi.Input<string>; /** * Maximum frequency with which AWS Config runs evaluations for a rule, if the rule is triggered at a periodic frequency. Defaults to `TwentyFour_Hours` for periodic frequency triggered rules. Valid values: `One_Hour`, `Three_Hours`, `Six_Hours`, `Twelve_Hours`, or `TwentyFour_Hours`. */ maximumExecutionFrequency?: pulumi.Input<string>; /** * Name of the rule. */ name?: pulumi.Input<string>; /** * Runtime system for policy rules. */ policyRuntime: pulumi.Input<string>; /** * Policy definition containing the rule logic. */ policyText: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * Identifier of the AWS resource to evaluate. */ resourceIdScope?: pulumi.Input<string>; /** * List of types of AWS resources to evaluate. */ resourceTypesScopes?: pulumi.Input<pulumi.Input<string>[]>; /** * Tag key of AWS resources to evaluate. */ tagKeyScope?: pulumi.Input<string>; /** * Tag value of AWS resources to evaluate. */ tagValueScope?: pulumi.Input<string>; /** * List of notification types that trigger AWS Config to run an evaluation for the rule. Valid values: `ConfigurationItemChangeNotification`, `OversizedConfigurationItemChangeNotification`. * * The following arguments are optional: */ triggerTypes: pulumi.Input<pulumi.Input<string>[]>; }