Class OrganizationConformancePack


  • public class OrganizationConformancePack
    extends com.pulumi.resources.CustomResource
    Manages a Config Organization Conformance Pack. More information can be found in the [Managing Conformance Packs Across all Accounts in Your Organization](https://docs.aws.amazon.com/config/latest/developerguide/conformance-pack-organization-apis.html) and [AWS Config Managed Rules](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html) documentation. Example 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:** This resource must be created in the Organization master account or a delegated administrator account, and the Organization must have all features enabled. Every Organization account except those configured in the `excluded_accounts` argument must have a Configuration Recorder with proper IAM permissions before the Organization Conformance Pack will successfully create or update. See also the `aws.cfg.Recorder` resource. ## Example Usage ### Using Template Body <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.organizations.Organization;
     import com.pulumi.aws.organizations.OrganizationArgs;
     import com.pulumi.aws.cfg.OrganizationConformancePack;
     import com.pulumi.aws.cfg.OrganizationConformancePackArgs;
     import com.pulumi.aws.cfg.inputs.OrganizationConformancePackInputParameterArgs;
     import com.pulumi.resources.CustomResourceOptions;
     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) {
             var exampleOrganization = new Organization("exampleOrganization", OrganizationArgs.builder()
                 .awsServiceAccessPrincipals("config-multiaccountsetup.amazonaws.com")
                 .featureSet("ALL")
                 .build());
     
             var example = new OrganizationConformancePack("example", OrganizationConformancePackArgs.builder()
                 .name("example")
                 .inputParameters(OrganizationConformancePackInputParameterArgs.builder()
                     .parameterName("AccessKeysRotatedParameterMaxAccessKeyAge")
                     .parameterValue("90")
                     .build())
                 .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,
                         exampleOrganization)
                     .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Using Template S3 URI <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.organizations.Organization;
     import com.pulumi.aws.organizations.OrganizationArgs;
     import com.pulumi.aws.s3.BucketV2;
     import com.pulumi.aws.s3.BucketV2Args;
     import com.pulumi.aws.s3.BucketObjectv2;
     import com.pulumi.aws.s3.BucketObjectv2Args;
     import com.pulumi.aws.cfg.OrganizationConformancePack;
     import com.pulumi.aws.cfg.OrganizationConformancePackArgs;
     import com.pulumi.resources.CustomResourceOptions;
     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) {
             var exampleOrganization = new Organization("exampleOrganization", OrganizationArgs.builder()
                 .awsServiceAccessPrincipals("config-multiaccountsetup.amazonaws.com")
                 .featureSet("ALL")
                 .build());
     
             var exampleBucketV2 = new BucketV2("exampleBucketV2", BucketV2Args.builder()
                 .bucket("example")
                 .build());
     
             var exampleBucketObjectv2 = new BucketObjectv2("exampleBucketObjectv2", BucketObjectv2Args.builder()
                 .bucket(exampleBucketV2.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 OrganizationConformancePack("example", OrganizationConformancePackArgs.builder()
                 .name("example")
                 .templateS3Uri(Output.tuple(exampleBucketV2.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,
                         exampleOrganization)
                     .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import Config Organization Conformance Packs using the `name`. For example: ```sh $ pulumi import aws:cfg/organizationConformancePack:OrganizationConformancePack 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()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> excludedAccounts()  
      static OrganizationConformancePack get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, OrganizationConformancePackState 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<OrganizationConformancePackInputParameter>>> inputParameters()  
      com.pulumi.core.Output<java.lang.String> name()  
      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

      • OrganizationConformancePack

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

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

        public OrganizationConformancePack​(java.lang.String name,
                                           @Nullable
                                           OrganizationConformancePackArgs 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:
        Amazon Resource Name (ARN) of the organization 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. Delivery bucket must begin with `awsconfigconforms` prefix. 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.
      • excludedAccounts

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> excludedAccounts()
        Returns:
        Set of AWS accounts to be excluded from an organization conformance pack while deploying a conformance pack. Maximum of 1000 accounts.
      • inputParameters

        public com.pulumi.core.Output<java.util.Optional<java.util.List<OrganizationConformancePackInputParameter>>> 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 `template_body` or in the template stored in Amazon S3 if using `template_s3_uri`.
      • name

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

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