Class ConformancePack


  • public class ConformancePack
    extends com.pulumi.resources.CustomResource
    Manages a Config Conformance Pack. More information about this collection of Config rules and remediation actions can be found in the [Conformance Packs](https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html) documentation. Sample Conformance Pack templates may be found in the [AWS Config Rules Repository](https://github.com/awslabs/aws-config-rules/tree/master/aws-config-conformance-packs). > **NOTE:** The account must have a Configuration Recorder with proper IAM permissions before the Conformance Pack will successfully create or update. See also the `aws.cfg.Recorder` resource. ## Example Usage ### Template Body
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.cfg.ConformancePack;
     import com.pulumi.aws.cfg.ConformancePackArgs;
     import com.pulumi.aws.cfg.inputs.ConformancePackInputParameterArgs;
     import com.pulumi.resources.CustomResourceOptions;
     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 ConformancePack("example", ConformancePackArgs.builder()
                 .inputParameters(ConformancePackInputParameterArgs.builder()
                     .parameterName("AccessKeysRotatedParameterMaxAccessKeyAge")
                     .parameterValue("90")
                     .build())
                 .name("example")
                 .templateBody("""
     Parameters:
       AccessKeysRotatedParameterMaxAccessKeyAge:
         Type: String
     Resources:
       IAMPasswordPolicy:
         Properties:
           ConfigRuleName: IAMPasswordPolicy
           Source:
             Owner: AWS
             SourceIdentifier: IAM_PASSWORD_POLICY
         Type: AWS::Config::ConfigRule
                 """)
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(exampleAwsConfigConfigurationRecorder)
                     .build());
     
         }
     }
     
     
    ### Template S3 URI
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.s3.BucketObjectv2;
     import com.pulumi.aws.s3.BucketObjectv2Args;
     import com.pulumi.aws.cfg.ConformancePack;
     import com.pulumi.aws.cfg.ConformancePackArgs;
     import com.pulumi.resources.CustomResourceOptions;
     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 exampleBucket = new Bucket("exampleBucket", BucketArgs.builder()
                 .bucket("example")
                 .build());
     
             var exampleBucketObjectv2 = new BucketObjectv2("exampleBucketObjectv2", BucketObjectv2Args.builder()
                 .bucket(exampleBucket.id())
                 .key("example-key")
                 .content("""
     Resources:
       IAMPasswordPolicy:
         Properties:
           ConfigRuleName: IAMPasswordPolicy
           Source:
             Owner: AWS
             SourceIdentifier: IAM_PASSWORD_POLICY
         Type: AWS::Config::ConfigRule
                 """)
                 .build());
     
             var example = new ConformancePack("example", ConformancePackArgs.builder()
                 .name("example")
                 .templateS3Uri(Output.tuple(exampleBucket.bucket(), exampleBucketObjectv2.key()).applyValue(values -> {
                     var bucket = values.t1;
                     var key = values.t2;
                     return String.format("s3://%s/%s", bucket,key);
                 }))
                 .build(), CustomResourceOptions.builder()
                     .dependsOn(exampleAwsConfigConfigurationRecorder)
                     .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `name` (String) Name of the conformance pack. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import Config Conformance Packs using the `name`. For example: ```sh $ pulumi import aws:cfg/conformancePack:ConformancePack 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.lang.String>> deliveryS3Bucket()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> deliveryS3KeyPrefix()  
      static ConformancePack get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ConformancePackState 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.util.List<ConformancePackInputParameter>>> inputParameters()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateBody()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateS3Uri()  
      • 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

      • ConformancePack

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

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

        public ConformancePack​(java.lang.String name,
                               @Nullable
                               ConformancePackArgs 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 conformance pack.
      • deliveryS3Bucket

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> deliveryS3Bucket()
        Returns:
        Amazon S3 bucket where AWS Config stores conformance pack templates. Maximum length of 63.
      • deliveryS3KeyPrefix

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> deliveryS3KeyPrefix()
        Returns:
        The prefix for the Amazon S3 bucket. Maximum length of 1024.
      • inputParameters

        public com.pulumi.core.Output<java.util.Optional<java.util.List<ConformancePackInputParameter>>> inputParameters()
        Returns:
        Set of configuration blocks describing input parameters passed to the conformance pack template. Documented below. When configured, the parameters must also be included in the `templateBody` or in the template stored in Amazon S3 if using `templateS3Uri`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the conformance pack. Must begin with a letter and contain from 1 to 256 alphanumeric characters and hyphens.
      • 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.
      • templateBody

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateBody()
        Returns:
        A string containing full conformance pack template body. Maximum length of 51200. Drift detection is not possible with this argument.
      • templateS3Uri

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> templateS3Uri()
        Returns:
        Location of file, e.g., `s3://bucketname/prefix`, containing the template body. The URI must point to the conformance pack template that is located in an Amazon S3 bucket in the same region as the conformance pack. Maximum length of 1024. Drift detection is not possible with this argument. > **Note:** If both `templateBody` and `templateS3Uri` are specified, AWS Config uses the `templateS3Uri` and ignores the `templateBody`.
      • get

        public static ConformancePack get​(java.lang.String name,
                                          com.pulumi.core.Output<java.lang.String> id,
                                          @Nullable
                                          ConformancePackState 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.