Class OrganizationCustomPolicyRule


  • public class OrganizationCustomPolicyRule
    extends com.pulumi.resources.CustomResource
    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.cfg.OrganizationManagedRule` 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
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cfg.OrganizationCustomPolicyRule;
     import com.pulumi.aws.cfg.OrganizationCustomPolicyRuleArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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) {
             var example = new OrganizationCustomPolicyRule("example", OrganizationCustomPolicyRuleArgs.builder()
                 .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")
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `name` (String) Name of the rule. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Config Organization Custom Policy Rules using the `name`. For example: ```sh $ pulumi import aws:cfg/organizationCustomPolicyRule:OrganizationCustomPolicyRule example example ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> debugLogDeliveryAccounts()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> excludedAccounts()  
      static OrganizationCustomPolicyRule get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OrganizationCustomPolicyRuleState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> inputParameters()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> maximumExecutionFrequency()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> policyRuntime()  
      com.pulumi.core.Output<java.lang.String> policyText()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> resourceIdScope()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> resourceTypesScopes()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> tagKeyScope()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> tagValueScope()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> triggerTypes()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OrganizationCustomPolicyRule

        public OrganizationCustomPolicyRule​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • OrganizationCustomPolicyRule

        public OrganizationCustomPolicyRule​(java.lang.String name,
                                            OrganizationCustomPolicyRuleArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • OrganizationCustomPolicyRule

        public OrganizationCustomPolicyRule​(java.lang.String name,
                                            OrganizationCustomPolicyRuleArgs args,
                                            @Nullable
                                            com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the rule.
      • debugLogDeliveryAccounts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> debugLogDeliveryAccounts()
        Returns:
        List of accounts that you can enable debug logging for. The list is null when debug logging is enabled for all accounts.
      • description

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
        Returns:
        Description of the rule.
      • excludedAccounts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> excludedAccounts()
        Returns:
        List of AWS account identifiers to exclude from the rule.
      • inputParameters

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> inputParameters()
        Returns:
        A string in JSON format that is passed to the AWS Config Rule Lambda Function.
      • maximumExecutionFrequency

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> maximumExecutionFrequency()
        Returns:
        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`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the rule.
      • policyRuntime

        public com.pulumi.core.Output<java.lang.String> policyRuntime()
        Returns:
        Runtime system for policy rules.
      • policyText

        public com.pulumi.core.Output<java.lang.String> policyText()
        Returns:
        Policy definition containing the rule logic.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        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.
      • resourceIdScope

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> resourceIdScope()
        Returns:
        Identifier of the AWS resource to evaluate.
      • resourceTypesScopes

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> resourceTypesScopes()
        Returns:
        List of types of AWS resources to evaluate.
      • tagKeyScope

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> tagKeyScope()
        Returns:
        Tag key of AWS resources to evaluate.
      • tagValueScope

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> tagValueScope()
        Returns:
        Tag value of AWS resources to evaluate.
      • triggerTypes

        public com.pulumi.core.Output<java.util.List<java.lang.String>> triggerTypes()
        Returns:
        List of notification types that trigger AWS Config to run an evaluation for the rule. Valid values: `ConfigurationItemChangeNotification`, `OversizedConfigurationItemChangeNotification`. The following arguments are optional:
      • get

        public static OrganizationCustomPolicyRule get​(java.lang.String name,
                                                       com.pulumi.core.Output<java.lang.String> id,
                                                       @Nullable
                                                       OrganizationCustomPolicyRuleState state,
                                                       @Nullable
                                                       com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.