diff --git a/Makefile b/Makefile index 90ef94af38..4ae1838760 100644 --- a/Makefile +++ b/Makefile @@ -302,6 +302,7 @@ aws-data-sync-botocore: ## Regenerate only the AWS data derived from botocore, s $(PYTHON) tools/aws/regen_securityhub_shapes.py $(PYTHON) tools/aws/regen_rekognition_shapes.py $(PYTHON) tools/aws/regen_kinesis_shapes.py + $(PYTHON) tools/aws/regen_config_shapes.py $(PYTHON) tools/aws/regen_iam_shapes.py $(PYTHON) tools/aws/regen_sts_shapes.py $(PYTHON) tools/aws/regen_apigateway_types.py @@ -439,6 +440,10 @@ aws-data-check-botocore: ## The AWS data derived from botocore must match a fres echo "error: Kinesis request shapes are out of date; run 'make aws-data-sync'."; \ exit 1; \ } + @$(PYTHON) tools/aws/regen_config_shapes.py --check || { \ + echo "error: AWS Config request shapes are out of date; run 'make aws-data-sync'."; \ + exit 1; \ + } @$(PYTHON) tools/aws/regen_apigateway_types.py --check || { \ echo "error: API Gateway integration types are out of date; run 'make aws-data-sync'."; \ exit 1; \ diff --git a/docs/services/config.md b/docs/services/config.md index 3740d9419d..0e038662f7 100644 --- a/docs/services/config.md +++ b/docs/services/config.md @@ -204,12 +204,21 @@ aws configservice delete-config-rule --config-rule-name s3-bucket-versioning `ResourceNotFoundException` for a config rule, conformance pack, aggregation authorization or configuration recorder ARN that does not name an existing resource in the caller's account and region. ARNs of resource kinds Floci does not model (configuration - aggregators, stored queries, organization rules and packs) are accepted without a check. + aggregators, stored queries, organization rules and packs) are accepted without an existence check. - `PutConfigRule` applies its `Tags` only when it creates the rule; a later `PutConfigRule` for the same rule leaves its tags unchanged, as AWS documents. Use `TagResource` and `UntagResource` to change them. `DeleteConfigRule` drops the rule's tags. `PutConfigurationRecorder` and `DeleteConfigurationRecorder` do the same for the recorder. - - `PutConfigRule` and `PutAggregationAuthorization` reject more than 50 `Tags`, a tag - without a 1-128 character `Key`, or a `Value` over 256 characters with - `InvalidParameterValueException`, and store nothing. `PutConfigurationRecorder` rejects - the same with `ValidationException`. A tag with no `Value` is stored with an empty value. + - Every request is checked by `RequestConstraintCheck` against the types, required + members, bounds, patterns and enums generated from botocore's AWS Config service model. + `tools/aws/regen_config_shapes.py` vendors every operation's input constraints; + `make aws-data-sync` regenerates them and `make aws-data-check` checks for drift. A + violation answers `ValidationException`, or `InvalidLimitException` for a `Limit` out of + range where the operation models that error, in Floci's own wording. CloudFormation + checks an `AWS::Config::ConfigRule` against `PutConfigRule`'s constraints the same way, + so a property outside them fails the resource with that message. + - `PutConfigRule`, `PutAggregationAuthorization` and `PutConfigurationRecorder` reject more + than 50 `Tags`, a `Key` outside 1-128 characters or a `Value` over 256 characters with + `ValidationException`, and a tag without a `Key` with the operation's modelled error + (`InvalidParameterValueException` for the first two). They store nothing. A tag with no + `Value` is stored with an empty value. diff --git a/src/main/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisioner.java b/src/main/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisioner.java index c53d464c82..beff392a3e 100644 --- a/src/main/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisioner.java +++ b/src/main/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisioner.java @@ -1,9 +1,11 @@ package io.floci.aws.services.cloudformation.provisioners; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import io.floci.aws.core.common.AwsException; import io.floci.aws.services.cloudformation.model.StackResource; import io.floci.aws.services.configservice.AwsConfigService; +import io.floci.aws.services.configservice.ConfigRequestShapes; import io.floci.aws.services.configservice.model.ConfigRule; import io.floci.aws.services.configservice.model.ConfigRuleSource; import io.floci.aws.services.configservice.model.CustomPolicyDetails; @@ -22,6 +24,7 @@ import java.util.Set; public class ConfigCfnProvisioner implements CfnResourceProvisioner { private static final Logger LOG = Logger.getLogger(ConfigCfnProvisioner.class); + private static final ObjectMapper MAPPER = new ObjectMapper(); private static final String CONFIG_RULE = "AWS::Config::ConfigRule"; private final AwsConfigService configService; @@ -49,11 +52,14 @@ public class ConfigCfnProvisioner implements CfnResourceProvisioner { ? ctx.generatePhysicalName(resource.getLogicalId(), 128, false) : previousName; } - ConfigRule rule = configService.putConfigRule(ctx.region(), new ConfigRule( + ConfigRule desired = new ConfigRule( name, null, null, text(resolved, "Description"), scope(resolved.path("Scope")), source(resolved.path("Source")), inputParameters(resolved.path("InputParameters")), text(resolved, "MaximumExecutionFrequency"), null, null, - evaluationModes(resolved.path("EvaluationModes")))); + evaluationModes(resolved.path("EvaluationModes"))); + ConfigRequestShapes.check("PutConfigRule", + MAPPER.createObjectNode().set("ConfigRule", MAPPER.valueToTree(desired))); + ConfigRule rule = configService.putConfigRule(ctx.region(), desired); resource.setPhysicalId(rule.configRuleName()); resource.getAttributes().put("Arn", rule.configRuleArn()); resource.getAttributes().put("ConfigRuleId", rule.configRuleId()); diff --git a/src/main/java/io/floci/aws/services/configservice/AwsConfigService.java b/src/main/java/io/floci/aws/services/configservice/AwsConfigService.java index 1189cc4443..8f682e0477 100644 --- a/src/main/java/io/floci/aws/services/configservice/AwsConfigService.java +++ b/src/main/java/io/floci/aws/services/configservice/AwsConfigService.java @@ -26,7 +26,6 @@ import io.floci.aws.services.configservice.model.EvaluationResult; import io.floci.aws.services.configservice.model.EvaluationResultIdentifier; import io.floci.aws.services.configservice.model.EvaluationResultQualifier; import io.floci.aws.services.configservice.model.RetentionConfiguration; -import io.floci.aws.services.configservice.model.SourceDetail; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -38,46 +37,20 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.BooleanSupplier; import java.util.function.Supplier; -import java.util.regex.Pattern; import java.util.stream.Collectors; @ApplicationScoped public class AwsConfigService { - private static final Set VALID_COMPLIANCE_TYPES = - Set.of("COMPLIANT", "NON_COMPLIANT", "NOT_APPLICABLE", "INSUFFICIENT_DATA"); private static final String NO_SUCH_CONFIG_RULE_MESSAGE = "The ConfigRule provided in the request is invalid. Please check the configRule name."; private static final String INVALID_NEXT_TOKEN_MESSAGE = "The specified next token is not valid. Specify the nextToken string that was returned " + "in the previous response to get the next page of results."; - /** Enum shapes from the Config model (config/2014-11-12/service-2.json). */ - private static final Set VALID_RULE_OWNERS = - Set.of("CUSTOM_LAMBDA", "AWS", "CUSTOM_POLICY"); - private static final Set VALID_EXECUTION_FREQUENCIES = - Set.of("One_Hour", "Three_Hours", "Six_Hours", "Twelve_Hours", "TwentyFour_Hours"); - private static final Set VALID_RULE_STATES = - Set.of("ACTIVE", "DELETING", "DELETING_RESULTS", "EVALUATING"); - private static final Set VALID_EVALUATION_MODES = Set.of("DETECTIVE", "PROACTIVE"); - private static final Set VALID_EVENT_SOURCES = Set.of("aws.config"); - private static final Set VALID_MESSAGE_TYPES = Set.of( - "ConfigurationItemChangeNotification", "ConfigurationSnapshotDeliveryCompleted", - "ScheduledNotification", "OversizedConfigurationItemChangeNotification"); - /** {@code ComplianceTypes} is a list of ComplianceType with {@code max: 3}. */ - private static final int MAX_COMPLIANCE_TYPE_FILTERS = 3; - /** {@code Scope.ComplianceResourceTypes} is {@code max: 100}. */ - private static final int MAX_COMPLIANCE_RESOURCE_TYPES = 100; - /** {@code DescribeConfigRulesRequest.ConfigRuleNames} is {@code max: 25}. */ - private static final int MAX_DESCRIBE_CONFIG_RULE_NAMES = 25; - /** {@code DescribeAggregationAuthorizationsRequest.Limit} is {@code max: 100}. */ - private static final int MAX_AGGREGATION_AUTHORIZATIONS_LIMIT = 100; - /** {@code AuthorizedAccountId} is modeled with {@code pattern: \d{12}}. */ - private static final Pattern AUTHORIZED_ACCOUNT_ID_PATTERN = Pattern.compile("\\d{12}"); private static final int RULE_CONTRIBUTOR_CAP = 25; private static final int RESOURCE_CONTRIBUTOR_CAP = 100; @@ -204,44 +177,11 @@ public class AwsConfigService { * the tags alone, which TagResource/UntagResource change instead. The get-then-put runs under * the lock delete takes, so a delete cannot land between them and orphan the creation tags. */ public ConfigRule putConfigRule(String region, ConfigRule requested, List> tagList) { - if (requested == null || isBlank(requested.configRuleName())) { + String ruleName = requested.configRuleName(); + if (ruleName == null) { throw new AwsException("InvalidParameterValueException", "ConfigRuleName must be specified.", 400); } - if (requested.source() == null || isBlank(requested.source().owner())) { - throw new AwsException("InvalidParameterValueException", - "Source with Owner must be specified.", 400); - } - // The whole modeled ConfigRule is stored and echoed back, so every enum-typed member - // it keeps is checked here rather than accepted verbatim. - requireEnum(requested.source().owner(), VALID_RULE_OWNERS, "Source.Owner"); - requireEnum(requested.maximumExecutionFrequency(), VALID_EXECUTION_FREQUENCIES, - "MaximumExecutionFrequency"); - requireEnum(requested.configRuleState(), VALID_RULE_STATES, "ConfigRuleState"); - if (requested.source().sourceDetails() != null) { - for (SourceDetail detail : requested.source().sourceDetails()) { - if (detail == null) { - continue; - } - requireEnum(detail.eventSource(), VALID_EVENT_SOURCES, "SourceDetails.EventSource"); - requireEnum(detail.messageType(), VALID_MESSAGE_TYPES, "SourceDetails.MessageType"); - requireEnum(detail.maximumExecutionFrequency(), VALID_EXECUTION_FREQUENCIES, - "SourceDetails.MaximumExecutionFrequency"); - } - } - if (requested.scope() != null && requested.scope().complianceResourceTypes() != null - && requested.scope().complianceResourceTypes().size() > MAX_COMPLIANCE_RESOURCE_TYPES) { - throw new AwsException("InvalidParameterValueException", - "Scope.ComplianceResourceTypes accepts at most " - + MAX_COMPLIANCE_RESOURCE_TYPES + " values.", 400); - } - if (requested.evaluationModes() != null) { - for (EvaluationModeConfiguration mode : requested.evaluationModes()) { - requireEnum(mode == null ? null : mode.mode(), VALID_EVALUATION_MODES, - "EvaluationModes.Mode"); - } - } - String ruleName = requested.configRuleName(); synchronized (lockFor(ruleKey(region, ruleName))) { return storeConfigRule(region, requested, ruleName, tagList); } @@ -305,10 +245,6 @@ public class AwsConfigService { } public List describeConfigRules(String region, List ruleNames) { - if (ruleNames != null && ruleNames.size() > MAX_DESCRIBE_CONFIG_RULE_NAMES) { - throw new AwsException("InvalidParameterValueException", - "ConfigRuleNames accepts at most " + MAX_DESCRIBE_CONFIG_RULE_NAMES + " values.", 400); - } Map store = rulesFor(region); List result = new ArrayList<>(); if (ruleNames == null || ruleNames.isEmpty()) { @@ -327,8 +263,7 @@ public class AwsConfigService { } public Paged describeConfigRulesPaged(String region, List ruleNames, String nextToken) { - return paginate(describeConfigRules(region, ruleNames), null, nextToken, - 25, 25, "InvalidParameterValueException"); + return paginate(describeConfigRules(region, ruleNames), null, nextToken, 25); } public Paged describeConfigRuleEvaluationStatus(String region, @@ -349,7 +284,7 @@ public class AwsConfigService { evaluationStarted, ruleFirstActivatedTime.get(key), lastEvaluationTime, lastEvaluationTime)); } - return paginate(statuses, limit, nextToken, 150, 150, "InvalidParameterValueException"); + return paginate(statuses, limit, nextToken, 150); } public void startConfigRulesEvaluation(String region, List ruleNames) { @@ -372,10 +307,6 @@ public class AwsConfigService { throw new AwsException("InvalidResultTokenException", "The specified ResultToken is not valid.", 400); } - if (newEvaluations.size() > 100) { - throw new AwsException("InvalidParameterValueException", - "The Evaluations list cannot contain more than 100 items.", 400); - } newEvaluations.forEach(this::validateEvaluation); if (testMode) { return; @@ -414,11 +345,6 @@ public class AwsConfigService { "Each evaluation must specify ComplianceResourceType, ComplianceResourceId, " + "ComplianceType and OrderingTimestamp.", 400); } - if (!VALID_COMPLIANCE_TYPES.contains(evaluation.complianceType())) { - throw new AwsException("InvalidParameterValueException", - "ComplianceType must be one of COMPLIANT, NON_COMPLIANT, NOT_APPLICABLE, " - + "INSUFFICIENT_DATA.", 400); - } } private void storeEvaluations(String region, String ruleName, List newEvaluations) { @@ -470,7 +396,6 @@ public class AwsConfigService { public Paged describeComplianceByConfigRule(String region, List ruleNames, List complianceTypes, String nextToken) { - validateComplianceTypeFilter(complianceTypes); List entries = new ArrayList<>(); for (ConfigRule rule : describeConfigRules(region, ruleNames)) { Compliance compliance = complianceForRule(region, rule.configRuleName()); @@ -478,12 +403,11 @@ public class AwsConfigService { entries.add(new ComplianceByConfigRule(rule.configRuleName(), compliance)); } } - return paginate(entries, null, nextToken, 25, 25, "InvalidParameterValueException"); + return paginate(entries, null, nextToken, 25); } public Paged describeComplianceByResource(String region, String resourceType, String resourceId, List complianceTypes, Integer limit, String nextToken) { - validateComplianceTypeFilter(complianceTypes); if (!isBlank(resourceId) && isBlank(resourceType)) { throw new AwsException("InvalidParameterValueException", "ResourceType must be specified when ResourceId is provided.", 400); @@ -500,12 +424,11 @@ public class AwsConfigService { } entries.sort(Comparator.comparing(ComplianceByResource::resourceType) .thenComparing(ComplianceByResource::resourceId)); - return paginate(entries, limit, nextToken, 10, 100, "InvalidParameterValueException"); + return paginate(entries, limit, nextToken, 10); } public Paged getComplianceDetailsByConfigRule(String region, String ruleName, List complianceTypes, Integer limit, String nextToken) { - validateComplianceTypeFilter(complianceTypes); requireRule(region, ruleName); List results = evaluationsFor(region) .getOrDefault(ruleName, Map.of()).values().stream() @@ -514,12 +437,11 @@ public class AwsConfigService { .thenComparing(ConfigEvaluation::complianceResourceId)) .map(e -> toEvaluationResult(ruleName, e)) .collect(Collectors.toList()); - return paginate(results, limit, nextToken, 10, 100, "InvalidParameterValueException"); + return paginate(results, limit, nextToken, 10); } public Paged getComplianceDetailsByResource(String region, String resourceType, String resourceId, List complianceTypes, String nextToken) { - validateComplianceTypeFilter(complianceTypes); if (isBlank(resourceType) || isBlank(resourceId)) { throw new AwsException("InvalidParameterValueException", "ResourceType and ResourceId must be specified.", 400); @@ -534,7 +456,7 @@ public class AwsConfigService { }); results.sort(Comparator.comparing(r -> r.evaluationResultIdentifier().evaluationResultQualifier().configRuleName())); - return paginate(results, null, nextToken, 10, 10, "InvalidParameterValueException"); + return paginate(results, null, nextToken, 10); } public ComplianceSummary getComplianceSummaryByConfigRule(String region) { @@ -554,10 +476,6 @@ public class AwsConfigService { public List getComplianceSummaryByResourceType(String region, List resourceTypes) { - if (resourceTypes != null && resourceTypes.size() > 20) { - throw new AwsException("InvalidParameterValueException", - "ResourceTypes cannot contain more than 20 items.", 400); - } Map countsByType = new HashMap<>(); for (List resourceEvaluations : groupEvaluationsByResource(region, null, null).values()) { @@ -640,36 +558,6 @@ public class AwsConfigService { return complianceTypes == null || complianceTypes.isEmpty() || complianceTypes.contains(complianceType); } - /** - * A {@code ComplianceTypes} filter outside the modeled enum (or longer than the list's - * {@code max: 3}) would otherwise match nothing and read to the caller as "no results" - * instead of the rejection AWS answers. - */ - private static void validateComplianceTypeFilter(List complianceTypes) { - if (complianceTypes == null || complianceTypes.isEmpty()) { - return; - } - if (complianceTypes.size() > MAX_COMPLIANCE_TYPE_FILTERS) { - throw new AwsException("InvalidParameterValueException", - "ComplianceTypes accepts at most " + MAX_COMPLIANCE_TYPE_FILTERS + " values.", 400); - } - for (String complianceType : complianceTypes) { - requireEnum(complianceType, VALID_COMPLIANCE_TYPES, "ComplianceTypes"); - } - } - - /** Rejects a non-blank value that is not a member of the shape's enum; a null/blank value is left alone. */ - private static void requireEnum(String value, Set allowed, String memberName) { - if (isBlank(value) || allowed.contains(value)) { - return; - } - throw new AwsException("InvalidParameterValueException", - "Value '" + value + "' at '" + memberName + "' failed to satisfy constraint: " - + "Member must satisfy enum value set: [" - + allowed.stream().sorted().collect(Collectors.joining(", ")) + "]", - 400); - } - private ComplianceContributorCount contributorCount(long count, int cap) { return new ComplianceContributorCount((int) Math.min(count, cap), count > cap); } @@ -866,10 +754,6 @@ public class AwsConfigService { // --- Retention Configuration --- public RetentionConfiguration putRetentionConfiguration(String region, Integer retentionPeriodInDays) { - if (retentionPeriodInDays == null || retentionPeriodInDays < 30 || retentionPeriodInDays > 2557) { - throw new AwsException("InvalidParameterValueException", - "RetentionPeriodInDays must be between 30 and 2557.", 400); - } RetentionConfiguration configuration = new RetentionConfiguration("default", retentionPeriodInDays); retentionConfigurations.put(region, configuration); return configuration; @@ -889,10 +773,6 @@ public class AwsConfigService { } public void deleteRetentionConfiguration(String region, String name) { - if (isBlank(name)) { - throw new AwsException("InvalidParameterValueException", - "RetentionConfigurationName must be specified.", 400); - } RetentionConfiguration configuration = retentionConfigurations.get(region); if (configuration == null || !configuration.name().equals(name)) { throw new AwsException("NoSuchRetentionConfigurationException", @@ -967,8 +847,7 @@ public class AwsConfigService { public Paged describeConformancePacksPaged(String region, List names, Integer limit, String nextToken) { - return paginate(describeConformancePacks(region, names), limit, nextToken, - 20, 20, "InvalidLimitException"); + return paginate(describeConformancePacks(region, names), limit, nextToken, 20); } public Paged describeConformancePackStatus(String region, List names, @@ -982,7 +861,7 @@ public class AwsConfigService { "CREATE_SUCCESSFUL", now())); } - return paginate(result, limit, nextToken, 20, 20, "InvalidLimitException"); + return paginate(result, limit, nextToken, 20); } // --- Aggregation Authorizations --- @@ -997,7 +876,7 @@ public class AwsConfigService { * CreationTime and re-apply creation tags over a set TagResource may already have changed. */ public AggregationAuthorization putAggregationAuthorization(String region, String authorizedAccountId, String authorizedAwsRegion, List> tagList) { - requireAuthorizationKey(authorizedAccountId, authorizedAwsRegion); + requireAuthorizedAwsRegion(authorizedAwsRegion); synchronized (lockFor(authorizationLockKey(region, authorizedAccountId, authorizedAwsRegion))) { Map store = authorizationsFor(region); String key = authorizationKey(authorizedAccountId, authorizedAwsRegion); @@ -1024,8 +903,7 @@ public class AwsConfigService { .thenComparing(AggregationAuthorization::authorizedAwsRegion); List result = new ArrayList<>(authorizationsFor(region).values()); result.sort(byAuthorizedTarget); - return paginate(result, limit, nextToken, MAX_AGGREGATION_AUTHORIZATIONS_LIMIT, - MAX_AGGREGATION_AUTHORIZATIONS_LIMIT, "InvalidLimitException"); + return paginate(result, limit, nextToken, 100); } /** The Config model declares no "not found" error for this operation, so deleting an @@ -1038,7 +916,7 @@ public class AwsConfigService { * authorization already gone. */ public void deleteAggregationAuthorization(String region, String authorizedAccountId, String authorizedAwsRegion) { - requireAuthorizationKey(authorizedAccountId, authorizedAwsRegion); + requireAuthorizedAwsRegion(authorizedAwsRegion); synchronized (lockFor(authorizationLockKey(region, authorizedAccountId, authorizedAwsRegion))) { Map store = authorizationsFor(region); AggregationAuthorization removed = @@ -1056,11 +934,7 @@ public class AwsConfigService { "aggregation-authorization/" + authorizedAccountId + "/" + authorizedAwsRegion).toString(); } - private void requireAuthorizationKey(String authorizedAccountId, String authorizedAwsRegion) { - if (isBlank(authorizedAccountId) || !AUTHORIZED_ACCOUNT_ID_PATTERN.matcher(authorizedAccountId).matches()) { - throw new AwsException("InvalidParameterValueException", - "AuthorizedAccountId must be a 12 digit AWS account ID.", 400); - } + private static void requireAuthorizedAwsRegion(String authorizedAwsRegion) { if (isBlank(authorizedAwsRegion)) { throw new AwsException("InvalidParameterValueException", "AuthorizedAwsRegion must be specified.", 400); @@ -1177,17 +1051,9 @@ public class AwsConfigService { public record Paged(List items, String nextToken) {} /** Offset-as-NextToken pagination over a pre-sorted list. A null or zero limit falls back to - * the default page size; limits outside [1, maxLimit] fail with the op-specific error code. */ - private Paged paginate(List items, Integer limit, String nextToken, - int defaultPageSize, int maxLimit, String limitErrorCode) { - int pageSize = defaultPageSize; - if (limit != null && limit != 0) { - if (limit < 0 || limit > maxLimit) { - throw new AwsException(limitErrorCode, - "Limit must be between 0 and " + maxLimit + ".", 400); - } - pageSize = limit; - } + * the default page size; ConfigRequestShapes has already checked the limit's modeled range. */ + private Paged paginate(List items, Integer limit, String nextToken, int defaultPageSize) { + int pageSize = limit == null || limit == 0 ? defaultPageSize : limit; int offset = 0; if (nextToken != null && !nextToken.isEmpty()) { try { diff --git a/src/main/java/io/floci/aws/services/configservice/ConfigRequestShapes.java b/src/main/java/io/floci/aws/services/configservice/ConfigRequestShapes.java new file mode 100644 index 0000000000..8de96b520e --- /dev/null +++ b/src/main/java/io/floci/aws/services/configservice/ConfigRequestShapes.java @@ -0,0 +1,63 @@ +package io.floci.aws.services.configservice; + +import com.fasterxml.jackson.databind.JsonNode; +import io.floci.aws.core.common.AwsException; +import io.floci.aws.core.common.RequestConstraintCheck; + +import java.util.List; +import java.util.Set; + +/** + * Checks AWS Config requests against the constraints generated by {@code tools/aws/regen_config_shapes.py}. + * A violation is a {@code ValidationException}, which the model documents for missing required fields and + * input that fails validation. A {@code Limit} out of range answers {@code InvalidLimitException} instead + * where the operation models it. + */ +public final class ConfigRequestShapes { + + private static final Set MODELED_LIMITS = Set.of( + "DescribeAggregationAuthorizations.Limit", "DescribeConformancePacks.Limit", + "DescribeConformancePackStatus.Limit", "ListTagsForResource.Limit"); + private static final RequestConstraintCheck.Messages VALIDATION = + RequestConstraintCheck.standardMessages("ValidationException"); + private static final RequestConstraintCheck.Messages INVALID_LIMIT = + RequestConstraintCheck.standardMessages("InvalidLimitException"); + + private static final RequestConstraintCheck CHECK = RequestConstraintCheck.load( + "aws/config-request-shapes.json", "AWS Config request shapes", + new RequestConstraintCheck.Messages() { + @Override + public AwsException type(String path, String type) { + return VALIDATION.type(path, type); + } + + @Override + public AwsException bounds(String path, String type, Long min, Long max, Number size) { + return (MODELED_LIMITS.contains(path) ? INVALID_LIMIT : VALIDATION).bounds(path, type, min, max, size); + } + + @Override + public AwsException pattern(String path, String pattern) { + return VALIDATION.pattern(path, pattern); + } + + @Override + public AwsException enumValue(String path, List values) { + return VALIDATION.enumValue(path, values); + } + + @Override + public AwsException required(String path) { + return VALIDATION.required(path); + } + }); + + private ConfigRequestShapes() { + } + + public static void check(String operation, JsonNode request) { + if (CHECK.hasOperation(operation)) { + CHECK.check(operation, request); + } + } +} diff --git a/src/main/java/io/floci/aws/services/configservice/ConfigServiceJsonHandler.java b/src/main/java/io/floci/aws/services/configservice/ConfigServiceJsonHandler.java index 0f41b922dc..1038853406 100644 --- a/src/main/java/io/floci/aws/services/configservice/ConfigServiceJsonHandler.java +++ b/src/main/java/io/floci/aws/services/configservice/ConfigServiceJsonHandler.java @@ -25,6 +25,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.concurrent.Callable; @ApplicationScoped public class ConfigServiceJsonHandler { @@ -39,46 +40,48 @@ public class ConfigServiceJsonHandler { } public Response handle(String action, JsonNode request, String region) throws Exception { - return switch (action) { - case "PutConfigRule" -> putConfigRule(request, region); - case "DeleteConfigRule" -> deleteConfigRule(request, region); - case "DescribeConfigRules" -> describeConfigRules(request, region); - case "DescribeComplianceByConfigRule" -> describeComplianceByConfigRule(request, region); - case "DescribeComplianceByResource" -> describeComplianceByResource(request, region); - case "DescribeConfigRuleEvaluationStatus" -> describeConfigRuleEvaluationStatus(request, region); - case "StartConfigRulesEvaluation" -> startConfigRulesEvaluation(request, region); - case "PutEvaluations" -> putEvaluations(request, region); - case "PutExternalEvaluation" -> putExternalEvaluation(request, region); - case "DeleteEvaluationResults" -> deleteEvaluationResults(request, region); - case "GetComplianceDetailsByConfigRule" -> getComplianceDetailsByConfigRule(request, region); - case "GetComplianceDetailsByResource" -> getComplianceDetailsByResource(request, region); - case "GetComplianceSummaryByConfigRule" -> getComplianceSummaryByConfigRule(region); - case "GetComplianceSummaryByResourceType" -> getComplianceSummaryByResourceType(request, region); - case "PutConformancePack" -> putConformancePack(request, region); - case "DeleteConformancePack" -> deleteConformancePack(request, region); - case "DescribeConformancePacks" -> describeConformancePacks(request, region); - case "DescribeConformancePackStatus" -> describeConformancePackStatus(request, region); - case "PutConfigurationRecorder" -> putConfigurationRecorder(request, region); - case "DescribeConfigurationRecorders" -> describeConfigurationRecorders(request, region); - case "DeleteConfigurationRecorder" -> deleteConfigurationRecorder(request, region); - case "StartConfigurationRecorder" -> startConfigurationRecorder(request, region); - case "StopConfigurationRecorder" -> stopConfigurationRecorder(request, region); - case "DescribeConfigurationRecorderStatus" -> describeConfigurationRecorderStatus(request, region); - case "PutDeliveryChannel" -> putDeliveryChannel(request, region); - case "DescribeDeliveryChannels" -> describeDeliveryChannels(request, region); - case "DeleteDeliveryChannel" -> deleteDeliveryChannel(request, region); - case "PutRetentionConfiguration" -> putRetentionConfiguration(request, region); - case "DescribeRetentionConfigurations" -> describeRetentionConfigurations(request, region); - case "DeleteRetentionConfiguration" -> deleteRetentionConfiguration(request, region); - case "PutAggregationAuthorization" -> putAggregationAuthorization(request, region); - case "DescribeAggregationAuthorizations" -> describeAggregationAuthorizations(request, region); - case "DeleteAggregationAuthorization" -> deleteAggregationAuthorization(request, region); - case "TagResource" -> tagResource(request, region); - case "UntagResource" -> untagResource(request, region); - case "ListTagsForResource" -> listTagsForResource(request, region); + Callable operation = switch (action) { + case "PutConfigRule" -> () -> putConfigRule(request, region); + case "DeleteConfigRule" -> () -> deleteConfigRule(request, region); + case "DescribeConfigRules" -> () -> describeConfigRules(request, region); + case "DescribeComplianceByConfigRule" -> () -> describeComplianceByConfigRule(request, region); + case "DescribeComplianceByResource" -> () -> describeComplianceByResource(request, region); + case "DescribeConfigRuleEvaluationStatus" -> () -> describeConfigRuleEvaluationStatus(request, region); + case "StartConfigRulesEvaluation" -> () -> startConfigRulesEvaluation(request, region); + case "PutEvaluations" -> () -> putEvaluations(request, region); + case "PutExternalEvaluation" -> () -> putExternalEvaluation(request, region); + case "DeleteEvaluationResults" -> () -> deleteEvaluationResults(request, region); + case "GetComplianceDetailsByConfigRule" -> () -> getComplianceDetailsByConfigRule(request, region); + case "GetComplianceDetailsByResource" -> () -> getComplianceDetailsByResource(request, region); + case "GetComplianceSummaryByConfigRule" -> () -> getComplianceSummaryByConfigRule(region); + case "GetComplianceSummaryByResourceType" -> () -> getComplianceSummaryByResourceType(request, region); + case "PutConformancePack" -> () -> putConformancePack(request, region); + case "DeleteConformancePack" -> () -> deleteConformancePack(request, region); + case "DescribeConformancePacks" -> () -> describeConformancePacks(request, region); + case "DescribeConformancePackStatus" -> () -> describeConformancePackStatus(request, region); + case "PutConfigurationRecorder" -> () -> putConfigurationRecorder(request, region); + case "DescribeConfigurationRecorders" -> () -> describeConfigurationRecorders(request, region); + case "DeleteConfigurationRecorder" -> () -> deleteConfigurationRecorder(request, region); + case "StartConfigurationRecorder" -> () -> startConfigurationRecorder(request, region); + case "StopConfigurationRecorder" -> () -> stopConfigurationRecorder(request, region); + case "DescribeConfigurationRecorderStatus" -> () -> describeConfigurationRecorderStatus(request, region); + case "PutDeliveryChannel" -> () -> putDeliveryChannel(request, region); + case "DescribeDeliveryChannels" -> () -> describeDeliveryChannels(request, region); + case "DeleteDeliveryChannel" -> () -> deleteDeliveryChannel(request, region); + case "PutRetentionConfiguration" -> () -> putRetentionConfiguration(request, region); + case "DescribeRetentionConfigurations" -> () -> describeRetentionConfigurations(request, region); + case "DeleteRetentionConfiguration" -> () -> deleteRetentionConfiguration(request, region); + case "PutAggregationAuthorization" -> () -> putAggregationAuthorization(request, region); + case "DescribeAggregationAuthorizations" -> () -> describeAggregationAuthorizations(request, region); + case "DeleteAggregationAuthorization" -> () -> deleteAggregationAuthorization(request, region); + case "TagResource" -> () -> tagResource(request, region); + case "UntagResource" -> () -> untagResource(request, region); + case "ListTagsForResource" -> () -> listTagsForResource(request, region); default -> throw new AwsException( "InvalidAction", "Could not find operation " + action, 400); }; + ConfigRequestShapes.check(action, request); + return operation.call(); } // --- Config Rules --- @@ -371,28 +374,13 @@ public class ConfigServiceJsonHandler { } /** PutConfigRule, PutAggregationAuthorization and PutConfigurationRecorder take a - * {@code TagsList} (config/2014-11-12: at most 50 {@code Tag}s, Key 1-128 characters, - * optional Value of at most 256). The first two model {@code InvalidParameterValueException} - * as their only parameter error; PutConfigurationRecorder models {@code ValidationException}. - * Checked before the service stores anything, so a rejected request leaves no resource - * behind. An absent Value is optional in the model and is stored as the empty string. */ + * {@code TagsList}, whose count and Key and Value lengths ConfigRequestShapes has checked. + * The model leaves a tag's Key optional, so a tag without one is refused here, with the + * operation's modelled parameter error, before the service stores anything. An absent Value + * is optional in the model and is stored as the empty string. */ private List> extractCreationTags(JsonNode req, String errorCode) { - JsonNode tags = req.path("Tags"); - if (tags.isMissingNode() || tags.isNull()) { - return List.of(); - } - if (!tags.isArray()) { - throw new AwsException(errorCode, "Tags must be a list.", 400); - } - if (tags.size() > 50) { - throw new AwsException(errorCode, "Tags must contain at most 50 tags.", 400); - } - for (JsonNode tag : tags) { - JsonNode key = tag.path("Key"); - JsonNode value = tag.path("Value"); - boolean valueOk = value.isMissingNode() || value.isNull() - || (value.isTextual() && value.asText().length() <= 256); - if (!key.isTextual() || key.asText().isEmpty() || key.asText().length() > 128 || !valueOk) { + for (JsonNode tag : req.path("Tags")) { + if (!tag.path("Key").isTextual()) { throw new AwsException(errorCode, "Each tag needs a Key of 1-128 characters and a Value of at most 256 characters.", 400); } diff --git a/src/main/resources/aws/config-request-shapes.json b/src/main/resources/aws/config-request-shapes.json new file mode 100644 index 0000000000..81513dcd24 --- /dev/null +++ b/src/main/resources/aws/config-request-shapes.json @@ -0,0 +1,3149 @@ +{ + "_source": { + "generator": "tools/aws/regen_config_shapes.py", + "botocore": "botocore 1.43.118 (installed package)" + }, + "operations": { + "AssociateResourceTypes": "AssociateResourceTypesRequest", + "BatchGetAggregateResourceConfig": "BatchGetAggregateResourceConfigRequest", + "BatchGetResourceConfig": "BatchGetResourceConfigRequest", + "DeleteAggregationAuthorization": "DeleteAggregationAuthorizationRequest", + "DeleteConfigRule": "DeleteConfigRuleRequest", + "DeleteConfigurationAggregator": "DeleteConfigurationAggregatorRequest", + "DeleteConfigurationRecorder": "DeleteConfigurationRecorderRequest", + "DeleteConformancePack": "DeleteConformancePackRequest", + "DeleteConnector": "DeleteConnectorRequest", + "DeleteDeliveryChannel": "DeleteDeliveryChannelRequest", + "DeleteEvaluationResults": "DeleteEvaluationResultsRequest", + "DeleteOrganizationConfigRule": "DeleteOrganizationConfigRuleRequest", + "DeleteOrganizationConformancePack": "DeleteOrganizationConformancePackRequest", + "DeletePendingAggregationRequest": "DeletePendingAggregationRequestRequest", + "DeleteRemediationConfiguration": "DeleteRemediationConfigurationRequest", + "DeleteRemediationExceptions": "DeleteRemediationExceptionsRequest", + "DeleteResourceConfig": "DeleteResourceConfigRequest", + "DeleteRetentionConfiguration": "DeleteRetentionConfigurationRequest", + "DeleteServiceLinkedConfigurationRecorder": "DeleteServiceLinkedConfigurationRecorderRequest", + "DeleteStoredQuery": "DeleteStoredQueryRequest", + "DeliverConfigSnapshot": "DeliverConfigSnapshotRequest", + "DescribeAggregateComplianceByConfigRules": "DescribeAggregateComplianceByConfigRulesRequest", + "DescribeAggregateComplianceByConformancePacks": "DescribeAggregateComplianceByConformancePacksRequest", + "DescribeAggregationAuthorizations": "DescribeAggregationAuthorizationsRequest", + "DescribeComplianceByConfigRule": "DescribeComplianceByConfigRuleRequest", + "DescribeComplianceByResource": "DescribeComplianceByResourceRequest", + "DescribeConfigRuleEvaluationStatus": "DescribeConfigRuleEvaluationStatusRequest", + "DescribeConfigRules": "DescribeConfigRulesRequest", + "DescribeConfigurationAggregatorSourcesStatus": "DescribeConfigurationAggregatorSourcesStatusRequest", + "DescribeConfigurationAggregators": "DescribeConfigurationAggregatorsRequest", + "DescribeConfigurationRecorderStatus": "DescribeConfigurationRecorderStatusRequest", + "DescribeConfigurationRecorders": "DescribeConfigurationRecordersRequest", + "DescribeConformancePackCompliance": "DescribeConformancePackComplianceRequest", + "DescribeConformancePackStatus": "DescribeConformancePackStatusRequest", + "DescribeConformancePacks": "DescribeConformancePacksRequest", + "DescribeDeliveryChannelStatus": "DescribeDeliveryChannelStatusRequest", + "DescribeDeliveryChannels": "DescribeDeliveryChannelsRequest", + "DescribeOrganizationConfigRuleStatuses": "DescribeOrganizationConfigRuleStatusesRequest", + "DescribeOrganizationConfigRules": "DescribeOrganizationConfigRulesRequest", + "DescribeOrganizationConformancePackStatuses": "DescribeOrganizationConformancePackStatusesRequest", + "DescribeOrganizationConformancePacks": "DescribeOrganizationConformancePacksRequest", + "DescribePendingAggregationRequests": "DescribePendingAggregationRequestsRequest", + "DescribeRemediationConfigurations": "DescribeRemediationConfigurationsRequest", + "DescribeRemediationExceptions": "DescribeRemediationExceptionsRequest", + "DescribeRemediationExecutionStatus": "DescribeRemediationExecutionStatusRequest", + "DescribeRetentionConfigurations": "DescribeRetentionConfigurationsRequest", + "DisassociateResourceTypes": "DisassociateResourceTypesRequest", + "GetAggregateComplianceDetailsByConfigRule": "GetAggregateComplianceDetailsByConfigRuleRequest", + "GetAggregateConfigRuleComplianceSummary": "GetAggregateConfigRuleComplianceSummaryRequest", + "GetAggregateConformancePackComplianceSummary": "GetAggregateConformancePackComplianceSummaryRequest", + "GetAggregateDiscoveredResourceCounts": "GetAggregateDiscoveredResourceCountsRequest", + "GetAggregateResourceConfig": "GetAggregateResourceConfigRequest", + "GetComplianceDetailsByConfigRule": "GetComplianceDetailsByConfigRuleRequest", + "GetComplianceDetailsByResource": "GetComplianceDetailsByResourceRequest", + "GetComplianceSummaryByResourceType": "GetComplianceSummaryByResourceTypeRequest", + "GetConformancePackComplianceDetails": "GetConformancePackComplianceDetailsRequest", + "GetConformancePackComplianceSummary": "GetConformancePackComplianceSummaryRequest", + "GetConnector": "GetConnectorRequest", + "GetCustomRulePolicy": "GetCustomRulePolicyRequest", + "GetDiscoveredResourceCounts": "GetDiscoveredResourceCountsRequest", + "GetOrganizationConfigRuleDetailedStatus": "GetOrganizationConfigRuleDetailedStatusRequest", + "GetOrganizationConformancePackDetailedStatus": "GetOrganizationConformancePackDetailedStatusRequest", + "GetOrganizationCustomRulePolicy": "GetOrganizationCustomRulePolicyRequest", + "GetResourceConfigHistory": "GetResourceConfigHistoryRequest", + "GetResourceEvaluationSummary": "GetResourceEvaluationSummaryRequest", + "GetStoredQuery": "GetStoredQueryRequest", + "ListAggregateDiscoveredResources": "ListAggregateDiscoveredResourcesRequest", + "ListConfigurationRecorders": "ListConfigurationRecordersRequest", + "ListConformancePackComplianceScores": "ListConformancePackComplianceScoresRequest", + "ListConnectors": "ListConnectorsRequest", + "ListDiscoveredResources": "ListDiscoveredResourcesRequest", + "ListResourceEvaluations": "ListResourceEvaluationsRequest", + "ListStoredQueries": "ListStoredQueriesRequest", + "ListTagsForResource": "ListTagsForResourceRequest", + "PutAggregationAuthorization": "PutAggregationAuthorizationRequest", + "PutConfigRule": "PutConfigRuleRequest", + "PutConfigurationAggregator": "PutConfigurationAggregatorRequest", + "PutConfigurationRecorder": "PutConfigurationRecorderRequest", + "PutConformancePack": "PutConformancePackRequest", + "PutConnector": "PutConnectorRequest", + "PutDeliveryChannel": "PutDeliveryChannelRequest", + "PutEvaluations": "PutEvaluationsRequest", + "PutExternalEvaluation": "PutExternalEvaluationRequest", + "PutOrganizationConfigRule": "PutOrganizationConfigRuleRequest", + "PutOrganizationConformancePack": "PutOrganizationConformancePackRequest", + "PutRemediationConfigurations": "PutRemediationConfigurationsRequest", + "PutRemediationExceptions": "PutRemediationExceptionsRequest", + "PutResourceConfig": "PutResourceConfigRequest", + "PutRetentionConfiguration": "PutRetentionConfigurationRequest", + "PutServiceLinkedConfigurationRecorder": "PutServiceLinkedConfigurationRecorderRequest", + "PutStoredQuery": "PutStoredQueryRequest", + "PutThirdPartyServiceLinkedConfigurationRecorder": "PutThirdPartyServiceLinkedConfigurationRecorderRequest", + "SelectAggregateResourceConfig": "SelectAggregateResourceConfigRequest", + "SelectResourceConfig": "SelectResourceConfigRequest", + "StartConfigRulesEvaluation": "StartConfigRulesEvaluationRequest", + "StartConfigurationRecorder": "StartConfigurationRecorderRequest", + "StartRemediationExecution": "StartRemediationExecutionRequest", + "StartResourceEvaluation": "StartResourceEvaluationRequest", + "StopConfigurationRecorder": "StopConfigurationRecorderRequest", + "TagResource": "TagResourceRequest", + "UntagResource": "UntagResourceRequest" + }, + "shapes": { + "AccountAggregationSource": { + "type": "structure", + "required": [ + "AccountIds" + ], + "members": { + "AccountIds": "AccountAggregationSourceAccountList", + "AllAwsRegions": "Boolean", + "AwsRegions": "AggregatorRegionList" + } + }, + "AccountAggregationSourceAccountList": { + "type": "list", + "min": 1, + "member": "AccountId" + }, + "AccountAggregationSourceList": { + "type": "list", + "min": 0, + "max": 1, + "member": "AccountAggregationSource" + }, + "AccountId": { + "type": "string", + "pattern": "\\d{12}" + }, + "AggregateConformancePackComplianceFilters": { + "type": "structure", + "members": { + "ConformancePackName": "ConformancePackName", + "ComplianceType": "ConformancePackComplianceType", + "AccountId": "AccountId", + "AwsRegion": "AwsRegion" + } + }, + "AggregateConformancePackComplianceSummaryFilters": { + "type": "structure", + "members": { + "AccountId": "AccountId", + "AwsRegion": "AwsRegion" + } + }, + "AggregateConformancePackComplianceSummaryGroupKey": { + "type": "string", + "enum": [ + "ACCOUNT_ID", + "AWS_REGION" + ] + }, + "AggregateResourceIdentifier": { + "type": "structure", + "required": [ + "SourceAccountId", + "SourceRegion", + "ResourceId", + "ResourceType" + ], + "members": { + "SourceAccountId": "AccountId", + "SourceRegion": "AwsRegion", + "ResourceId": "ResourceId", + "ResourceType": "ResourceType", + "ResourceName": "ResourceName" + } + }, + "AggregatedSourceStatusType": { + "type": "string", + "enum": [ + "FAILED", + "SUCCEEDED", + "OUTDATED" + ] + }, + "AggregatedSourceStatusTypeList": { + "type": "list", + "min": 1, + "member": "AggregatedSourceStatusType" + }, + "AggregatorFilterResourceType": { + "type": "structure", + "members": { + "Type": "AggregatorFilterType", + "Value": "ResourceTypeValueList" + } + }, + "AggregatorFilterServicePrincipal": { + "type": "structure", + "members": { + "Type": "AggregatorFilterType", + "Value": "ServicePrincipalValueList" + } + }, + "AggregatorFilterType": { + "type": "string", + "enum": [ + "INCLUDE" + ] + }, + "AggregatorFilters": { + "type": "structure", + "members": { + "ResourceType": "AggregatorFilterResourceType", + "ServicePrincipal": "AggregatorFilterServicePrincipal" + } + }, + "AggregatorRegionList": { + "type": "list", + "min": 1, + "member": "String" + }, + "AllSupported": { + "type": "boolean" + }, + "AmazonResourceName": { + "type": "string", + "min": 1, + "max": 1000 + }, + "AssociateResourceTypesRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorderArn", + "ResourceTypes" + ], + "members": { + "ConfigurationRecorderArn": "AmazonResourceName", + "ResourceTypes": "ResourceTypeList" + } + }, + "AutoRemediationAttemptSeconds": { + "type": "long", + "min": 1, + "max": 2678000 + }, + "AutoRemediationAttempts": { + "type": "integer", + "min": 1, + "max": 25 + }, + "AwsRegion": { + "type": "string", + "min": 1, + "max": 64 + }, + "AzureClientIdentifier": { + "type": "string", + "min": 1, + "max": 128 + }, + "AzureConnectorConfiguration": { + "type": "structure", + "required": [ + "tenantIdentifier", + "clientIdentifier" + ], + "members": { + "tenantIdentifier": "AzureTenantIdentifier", + "clientIdentifier": "AzureClientIdentifier" + } + }, + "AzureTenantIdentifier": { + "type": "string", + "min": 1, + "max": 128 + }, + "BaseResourceId": { + "type": "string", + "min": 1, + "max": 768 + }, + "BatchGetAggregateResourceConfigRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName", + "ResourceIdentifiers" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "ResourceIdentifiers": "ResourceIdentifiersList" + } + }, + "BatchGetResourceConfigRequest": { + "type": "structure", + "required": [ + "resourceKeys" + ], + "members": { + "resourceKeys": "ResourceKeys" + } + }, + "Boolean": { + "type": "boolean" + }, + "ChannelName": { + "type": "string", + "min": 1, + "max": 256 + }, + "ChronologicalOrder": { + "type": "string", + "enum": [ + "Reverse", + "Forward" + ] + }, + "ClientToken": { + "type": "string", + "min": 64, + "max": 256 + }, + "ComplianceResourceTypes": { + "type": "list", + "min": 0, + "max": 100, + "member": "StringWithCharLimit256" + }, + "ComplianceType": { + "type": "string", + "enum": [ + "COMPLIANT", + "NON_COMPLIANT", + "NOT_APPLICABLE", + "INSUFFICIENT_DATA" + ] + }, + "ComplianceTypes": { + "type": "list", + "min": 0, + "max": 3, + "member": "ComplianceType" + }, + "ConfigRule": { + "type": "structure", + "required": [ + "Source" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ConfigRuleArn": "StringWithCharLimit256", + "ConfigRuleId": "StringWithCharLimit64", + "Description": "EmptiableStringWithCharLimit256", + "Scope": "Scope", + "Source": "Source", + "InputParameters": "StringWithCharLimit1024", + "MaximumExecutionFrequency": "MaximumExecutionFrequency", + "ConfigRuleState": "ConfigRuleState", + "CreatedBy": "StringWithCharLimit256", + "EvaluationModes": "EvaluationModes", + "RuleEvaluationVisibility": "RuleEvaluationVisibility" + } + }, + "ConfigRuleComplianceFilters": { + "type": "structure", + "members": { + "ConfigRuleName": "ConfigRuleName", + "ComplianceType": "ComplianceType", + "AccountId": "AccountId", + "AwsRegion": "AwsRegion" + } + }, + "ConfigRuleComplianceSummaryFilters": { + "type": "structure", + "members": { + "AccountId": "AccountId", + "AwsRegion": "AwsRegion" + } + }, + "ConfigRuleComplianceSummaryGroupKey": { + "type": "string", + "enum": [ + "ACCOUNT_ID", + "AWS_REGION" + ] + }, + "ConfigRuleName": { + "type": "string", + "min": 1, + "max": 128, + "pattern": ".*\\S.*" + }, + "ConfigRuleNames": { + "type": "list", + "min": 0, + "max": 25, + "member": "ConfigRuleName" + }, + "ConfigRuleState": { + "type": "string", + "enum": [ + "ACTIVE", + "DELETING", + "DELETING_RESULTS", + "EVALUATING" + ] + }, + "ConfigSnapshotDeliveryProperties": { + "type": "structure", + "members": { + "deliveryFrequency": "MaximumExecutionFrequency" + } + }, + "Configuration": { + "type": "string" + }, + "ConfigurationAggregatorName": { + "type": "string", + "min": 1, + "max": 256, + "pattern": "[\\w\\-]+" + }, + "ConfigurationAggregatorNameList": { + "type": "list", + "min": 0, + "max": 10, + "member": "ConfigurationAggregatorName" + }, + "ConfigurationRecorder": { + "type": "structure", + "members": { + "arn": "AmazonResourceName", + "name": "RecorderName", + "roleARN": "String", + "recordingGroup": "RecordingGroup", + "recordingMode": "RecordingMode", + "recordingScope": "RecordingScope", + "servicePrincipal": "ServicePrincipal", + "connectorArn": "AmazonResourceName", + "scopeConfiguration": "ScopeConfiguration" + } + }, + "ConfigurationRecorderFilter": { + "type": "structure", + "members": { + "filterName": "ConfigurationRecorderFilterName", + "filterValue": "ConfigurationRecorderFilterValues" + } + }, + "ConfigurationRecorderFilterList": { + "type": "list", + "member": "ConfigurationRecorderFilter" + }, + "ConfigurationRecorderFilterName": { + "type": "string", + "enum": [ + "recordingScope" + ] + }, + "ConfigurationRecorderFilterValue": { + "type": "string", + "pattern": "^[0-9a-zA-Z\\\\*\\\\.\\\\\\/\\\\?-]*$" + }, + "ConfigurationRecorderFilterValues": { + "type": "list", + "member": "ConfigurationRecorderFilterValue" + }, + "ConfigurationRecorderNameList": { + "type": "list", + "member": "RecorderName" + }, + "ConformancePackComplianceFilters": { + "type": "structure", + "members": { + "ConfigRuleNames": "ConformancePackConfigRuleNames", + "ComplianceType": "ConformancePackComplianceType" + } + }, + "ConformancePackComplianceResourceIds": { + "type": "list", + "min": 0, + "max": 5, + "member": "StringWithCharLimit256" + }, + "ConformancePackComplianceScoresFilters": { + "type": "structure", + "required": [ + "ConformancePackNames" + ], + "members": { + "ConformancePackNames": "ConformancePackNameFilter" + } + }, + "ConformancePackComplianceType": { + "type": "string", + "enum": [ + "COMPLIANT", + "NON_COMPLIANT", + "INSUFFICIENT_DATA" + ] + }, + "ConformancePackConfigRuleNames": { + "type": "list", + "min": 0, + "max": 10, + "member": "StringWithCharLimit64" + }, + "ConformancePackEvaluationFilters": { + "type": "structure", + "members": { + "ConfigRuleNames": "ConformancePackConfigRuleNames", + "ComplianceType": "ConformancePackComplianceType", + "ResourceType": "StringWithCharLimit256", + "ResourceIds": "ConformancePackComplianceResourceIds" + } + }, + "ConformancePackInputParameter": { + "type": "structure", + "required": [ + "ParameterName", + "ParameterValue" + ], + "members": { + "ParameterName": "ParameterName", + "ParameterValue": "ParameterValue" + } + }, + "ConformancePackInputParameters": { + "type": "list", + "min": 0, + "max": 60, + "member": "ConformancePackInputParameter" + }, + "ConformancePackName": { + "type": "string", + "min": 1, + "max": 256, + "pattern": "[a-zA-Z][-a-zA-Z0-9]*" + }, + "ConformancePackNameFilter": { + "type": "list", + "min": 1, + "max": 25, + "member": "ConformancePackName" + }, + "ConformancePackNamesList": { + "type": "list", + "min": 0, + "max": 25, + "member": "ConformancePackName" + }, + "ConformancePackNamesToSummarizeList": { + "type": "list", + "min": 1, + "max": 5, + "member": "ConformancePackName" + }, + "ConnectorConfiguration": { + "type": "structure", + "members": { + "azure": "AzureConnectorConfiguration" + } + }, + "ConnectorFilter": { + "type": "structure", + "members": { + "filterName": "ConnectorFilterName", + "filterValues": "FilterValueList" + } + }, + "ConnectorFilterList": { + "type": "list", + "min": 0, + "max": 5, + "member": "ConnectorFilter" + }, + "ConnectorFilterName": { + "type": "string", + "enum": [ + "provider" + ] + }, + "CosmosPageLimit": { + "type": "integer", + "min": 0, + "max": 100 + }, + "CustomPolicyDetails": { + "type": "structure", + "required": [ + "PolicyRuntime", + "PolicyText" + ], + "members": { + "PolicyRuntime": "PolicyRuntime", + "PolicyText": "PolicyText", + "EnableDebugLogDelivery": "Boolean" + } + }, + "DebugLogDeliveryAccounts": { + "type": "list", + "min": 0, + "max": 1000, + "member": "AccountId" + }, + "DeleteAggregationAuthorizationRequest": { + "type": "structure", + "required": [ + "AuthorizedAccountId", + "AuthorizedAwsRegion" + ], + "members": { + "AuthorizedAccountId": "AccountId", + "AuthorizedAwsRegion": "AwsRegion" + } + }, + "DeleteConfigRuleRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "ConfigRuleName" + } + }, + "DeleteConfigurationAggregatorRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName" + } + }, + "DeleteConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorderName" + ], + "members": { + "ConfigurationRecorderName": "RecorderName" + } + }, + "DeleteConformancePackRequest": { + "type": "structure", + "required": [ + "ConformancePackName" + ], + "members": { + "ConformancePackName": "ConformancePackName" + } + }, + "DeleteConnectorRequest": { + "type": "structure", + "required": [ + "Arn" + ], + "members": { + "Arn": "AmazonResourceName" + } + }, + "DeleteDeliveryChannelRequest": { + "type": "structure", + "required": [ + "DeliveryChannelName" + ], + "members": { + "DeliveryChannelName": "ChannelName" + } + }, + "DeleteEvaluationResultsRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "StringWithCharLimit64" + } + }, + "DeleteOrganizationConfigRuleRequest": { + "type": "structure", + "required": [ + "OrganizationConfigRuleName" + ], + "members": { + "OrganizationConfigRuleName": "OrganizationConfigRuleName" + } + }, + "DeleteOrganizationConformancePackRequest": { + "type": "structure", + "required": [ + "OrganizationConformancePackName" + ], + "members": { + "OrganizationConformancePackName": "OrganizationConformancePackName" + } + }, + "DeletePendingAggregationRequestRequest": { + "type": "structure", + "required": [ + "RequesterAccountId", + "RequesterAwsRegion" + ], + "members": { + "RequesterAccountId": "AccountId", + "RequesterAwsRegion": "AwsRegion" + } + }, + "DeleteRemediationConfigurationRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceType": "String" + } + }, + "DeleteRemediationExceptionsRequest": { + "type": "structure", + "required": [ + "ConfigRuleName", + "ResourceKeys" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceKeys": "RemediationExceptionResourceKeys" + } + }, + "DeleteResourceConfigRequest": { + "type": "structure", + "required": [ + "ResourceType", + "ResourceId" + ], + "members": { + "ResourceType": "ResourceTypeString", + "ResourceId": "ResourceId" + } + }, + "DeleteRetentionConfigurationRequest": { + "type": "structure", + "required": [ + "RetentionConfigurationName" + ], + "members": { + "RetentionConfigurationName": "RetentionConfigurationName" + } + }, + "DeleteServiceLinkedConfigurationRecorderRequest": { + "type": "structure", + "members": { + "ServicePrincipal": "ServicePrincipal", + "Arn": "AmazonResourceName" + } + }, + "DeleteStoredQueryRequest": { + "type": "structure", + "required": [ + "QueryName" + ], + "members": { + "QueryName": "QueryName" + } + }, + "DeliverConfigSnapshotRequest": { + "type": "structure", + "required": [ + "deliveryChannelName" + ], + "members": { + "deliveryChannelName": "ChannelName" + } + }, + "DeliveryChannel": { + "type": "structure", + "members": { + "name": "ChannelName", + "s3BucketName": "String", + "s3KeyPrefix": "String", + "s3KmsKeyArn": "String", + "snsTopicARN": "String", + "configSnapshotDeliveryProperties": "ConfigSnapshotDeliveryProperties" + } + }, + "DeliveryChannelNameList": { + "type": "list", + "member": "ChannelName" + }, + "DeliveryS3Bucket": { + "type": "string", + "min": 0, + "max": 63 + }, + "DeliveryS3KeyPrefix": { + "type": "string", + "min": 0, + "max": 1024 + }, + "DescribeAggregateComplianceByConfigRulesRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Filters": "ConfigRuleComplianceFilters", + "Limit": "GroupByAPILimit", + "NextToken": "NextToken" + } + }, + "DescribeAggregateComplianceByConformancePacksRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Filters": "AggregateConformancePackComplianceFilters", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "DescribeAggregationAuthorizationsRequest": { + "type": "structure", + "members": { + "Limit": "Limit", + "NextToken": "String" + } + }, + "DescribeComplianceByConfigRuleRequest": { + "type": "structure", + "members": { + "ConfigRuleNames": "ConfigRuleNames", + "ComplianceTypes": "ComplianceTypes", + "NextToken": "String" + } + }, + "DescribeComplianceByResourceRequest": { + "type": "structure", + "members": { + "ResourceType": "StringWithCharLimit256", + "ResourceId": "BaseResourceId", + "ComplianceTypes": "ComplianceTypes", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "DescribeConfigRuleEvaluationStatusRequest": { + "type": "structure", + "members": { + "ConfigRuleNames": "ConfigRuleNames", + "NextToken": "String", + "Limit": "RuleLimit" + } + }, + "DescribeConfigRulesFilters": { + "type": "structure", + "members": { + "EvaluationMode": "EvaluationMode", + "RuleEvaluationVisibility": "RuleEvaluationVisibility" + } + }, + "DescribeConfigRulesRequest": { + "type": "structure", + "members": { + "ConfigRuleNames": "ConfigRuleNames", + "Filters": "DescribeConfigRulesFilters", + "NextToken": "String" + } + }, + "DescribeConfigurationAggregatorSourcesStatusRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "UpdateStatus": "AggregatedSourceStatusTypeList", + "NextToken": "String", + "Limit": "Limit" + } + }, + "DescribeConfigurationAggregatorsRequest": { + "type": "structure", + "members": { + "ConfigurationAggregatorNames": "ConfigurationAggregatorNameList", + "NextToken": "String", + "Limit": "Limit" + } + }, + "DescribeConfigurationRecorderStatusRequest": { + "type": "structure", + "members": { + "ConfigurationRecorderNames": "ConfigurationRecorderNameList", + "ServicePrincipal": "ServicePrincipal", + "Arn": "AmazonResourceName" + } + }, + "DescribeConfigurationRecordersRequest": { + "type": "structure", + "members": { + "ConfigurationRecorderNames": "ConfigurationRecorderNameList", + "ServicePrincipal": "ServicePrincipal", + "Arn": "AmazonResourceName" + } + }, + "DescribeConformancePackComplianceLimit": { + "type": "integer", + "min": 0, + "max": 1000 + }, + "DescribeConformancePackComplianceRequest": { + "type": "structure", + "required": [ + "ConformancePackName" + ], + "members": { + "ConformancePackName": "ConformancePackName", + "Filters": "ConformancePackComplianceFilters", + "Limit": "DescribeConformancePackComplianceLimit", + "NextToken": "NextToken" + } + }, + "DescribeConformancePackStatusRequest": { + "type": "structure", + "members": { + "ConformancePackNames": "ConformancePackNamesList", + "Limit": "PageSizeLimit", + "NextToken": "NextToken" + } + }, + "DescribeConformancePacksRequest": { + "type": "structure", + "members": { + "ConformancePackNames": "ConformancePackNamesList", + "Limit": "PageSizeLimit", + "NextToken": "NextToken" + } + }, + "DescribeDeliveryChannelStatusRequest": { + "type": "structure", + "members": { + "DeliveryChannelNames": "DeliveryChannelNameList" + } + }, + "DescribeDeliveryChannelsRequest": { + "type": "structure", + "members": { + "DeliveryChannelNames": "DeliveryChannelNameList" + } + }, + "DescribeOrganizationConfigRuleStatusesRequest": { + "type": "structure", + "members": { + "OrganizationConfigRuleNames": "OrganizationConfigRuleNames", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "DescribeOrganizationConfigRulesRequest": { + "type": "structure", + "members": { + "OrganizationConfigRuleNames": "OrganizationConfigRuleNames", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "DescribeOrganizationConformancePackStatusesRequest": { + "type": "structure", + "members": { + "OrganizationConformancePackNames": "OrganizationConformancePackNames", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "DescribeOrganizationConformancePacksRequest": { + "type": "structure", + "members": { + "OrganizationConformancePackNames": "OrganizationConformancePackNames", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "DescribePendingAggregationRequestsLimit": { + "type": "integer", + "min": 0, + "max": 20 + }, + "DescribePendingAggregationRequestsRequest": { + "type": "structure", + "members": { + "Limit": "DescribePendingAggregationRequestsLimit", + "NextToken": "String" + } + }, + "DescribeRemediationConfigurationsRequest": { + "type": "structure", + "required": [ + "ConfigRuleNames" + ], + "members": { + "ConfigRuleNames": "ConfigRuleNames" + } + }, + "DescribeRemediationExceptionsRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceKeys": "RemediationExceptionResourceKeys", + "Limit": "Limit", + "NextToken": "String" + } + }, + "DescribeRemediationExecutionStatusRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceKeys": "ResourceKeys", + "Limit": "Limit", + "NextToken": "String" + } + }, + "DescribeRetentionConfigurationsRequest": { + "type": "structure", + "members": { + "RetentionConfigurationNames": "RetentionConfigurationNameList", + "NextToken": "NextToken" + } + }, + "Description": { + "type": "string", + "min": 1, + "max": 256 + }, + "DisassociateResourceTypesRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorderArn", + "ResourceTypes" + ], + "members": { + "ConfigurationRecorderArn": "AmazonResourceName", + "ResourceTypes": "ResourceTypeList" + } + }, + "EmptiableStringWithCharLimit256": { + "type": "string", + "min": 0, + "max": 256 + }, + "Evaluation": { + "type": "structure", + "required": [ + "ComplianceResourceType", + "ComplianceResourceId", + "ComplianceType", + "OrderingTimestamp" + ], + "members": { + "ComplianceResourceType": "StringWithCharLimit256", + "ComplianceResourceId": "BaseResourceId", + "ComplianceType": "ComplianceType", + "Annotation": "StringWithCharLimit256" + } + }, + "EvaluationContext": { + "type": "structure", + "members": { + "EvaluationContextIdentifier": "EvaluationContextIdentifier" + } + }, + "EvaluationContextIdentifier": { + "type": "string", + "min": 1, + "max": 128 + }, + "EvaluationMode": { + "type": "string", + "enum": [ + "DETECTIVE", + "PROACTIVE" + ] + }, + "EvaluationModeConfiguration": { + "type": "structure", + "members": { + "Mode": "EvaluationMode" + } + }, + "EvaluationModes": { + "type": "list", + "member": "EvaluationModeConfiguration" + }, + "EvaluationTimeout": { + "type": "integer", + "min": 0, + "max": 3600 + }, + "Evaluations": { + "type": "list", + "min": 0, + "max": 100, + "member": "Evaluation" + }, + "EventSource": { + "type": "string", + "enum": [ + "aws.config" + ] + }, + "ExcludedAccounts": { + "type": "list", + "min": 0, + "max": 1000, + "member": "AccountId" + }, + "ExclusionByResourceTypes": { + "type": "structure", + "members": { + "resourceTypes": "ResourceTypeList" + } + }, + "ExecutionControls": { + "type": "structure", + "members": { + "SsmControls": "SsmControls" + } + }, + "Expression": { + "type": "string", + "min": 1, + "max": 4096 + }, + "ExternalEvaluation": { + "type": "structure", + "required": [ + "ComplianceResourceType", + "ComplianceResourceId", + "ComplianceType", + "OrderingTimestamp" + ], + "members": { + "ComplianceResourceType": "StringWithCharLimit256", + "ComplianceResourceId": "BaseResourceId", + "ComplianceType": "ComplianceType", + "Annotation": "StringWithCharLimit256" + } + }, + "FilterValueList": { + "type": "list", + "min": 0, + "max": 10, + "member": "String" + }, + "GetAggregateComplianceDetailsByConfigRuleRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName", + "ConfigRuleName", + "AccountId", + "AwsRegion" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "ConfigRuleName": "ConfigRuleName", + "AccountId": "AccountId", + "AwsRegion": "AwsRegion", + "ComplianceType": "ComplianceType", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "GetAggregateConfigRuleComplianceSummaryRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Filters": "ConfigRuleComplianceSummaryFilters", + "GroupByKey": "ConfigRuleComplianceSummaryGroupKey", + "Limit": "GroupByAPILimit", + "NextToken": "NextToken" + } + }, + "GetAggregateConformancePackComplianceSummaryRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Filters": "AggregateConformancePackComplianceSummaryFilters", + "GroupByKey": "AggregateConformancePackComplianceSummaryGroupKey", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "GetAggregateDiscoveredResourceCountsRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Filters": "ResourceCountFilters", + "GroupByKey": "ResourceCountGroupKey", + "Limit": "GroupByAPILimit", + "NextToken": "NextToken" + } + }, + "GetAggregateResourceConfigRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName", + "ResourceIdentifier" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "ResourceIdentifier": "AggregateResourceIdentifier" + } + }, + "GetComplianceDetailsByConfigRuleRequest": { + "type": "structure", + "required": [ + "ConfigRuleName" + ], + "members": { + "ConfigRuleName": "StringWithCharLimit64", + "ComplianceTypes": "ComplianceTypes", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "GetComplianceDetailsByResourceRequest": { + "type": "structure", + "members": { + "ResourceType": "StringWithCharLimit256", + "ResourceId": "BaseResourceId", + "ComplianceTypes": "ComplianceTypes", + "NextToken": "String", + "ResourceEvaluationId": "ResourceEvaluationId" + } + }, + "GetComplianceSummaryByResourceTypeRequest": { + "type": "structure", + "members": { + "ResourceTypes": "ResourceTypes" + } + }, + "GetConformancePackComplianceDetailsLimit": { + "type": "integer", + "min": 0, + "max": 100 + }, + "GetConformancePackComplianceDetailsRequest": { + "type": "structure", + "required": [ + "ConformancePackName" + ], + "members": { + "ConformancePackName": "ConformancePackName", + "Filters": "ConformancePackEvaluationFilters", + "Limit": "GetConformancePackComplianceDetailsLimit", + "NextToken": "NextToken" + } + }, + "GetConformancePackComplianceSummaryRequest": { + "type": "structure", + "required": [ + "ConformancePackNames" + ], + "members": { + "ConformancePackNames": "ConformancePackNamesToSummarizeList", + "Limit": "PageSizeLimit", + "NextToken": "NextToken" + } + }, + "GetConnectorRequest": { + "type": "structure", + "required": [ + "Arn" + ], + "members": { + "Arn": "AmazonResourceName" + } + }, + "GetCustomRulePolicyRequest": { + "type": "structure", + "members": { + "ConfigRuleName": "ConfigRuleName" + } + }, + "GetDiscoveredResourceCountsRequest": { + "type": "structure", + "members": { + "resourceTypes": "ResourceTypes", + "limit": "Limit", + "nextToken": "NextToken" + } + }, + "GetOrganizationConfigRuleDetailedStatusRequest": { + "type": "structure", + "required": [ + "OrganizationConfigRuleName" + ], + "members": { + "OrganizationConfigRuleName": "OrganizationConfigRuleName", + "Filters": "StatusDetailFilters", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "GetOrganizationConformancePackDetailedStatusRequest": { + "type": "structure", + "required": [ + "OrganizationConformancePackName" + ], + "members": { + "OrganizationConformancePackName": "OrganizationConformancePackName", + "Filters": "OrganizationResourceDetailedStatusFilters", + "Limit": "CosmosPageLimit", + "NextToken": "String" + } + }, + "GetOrganizationCustomRulePolicyRequest": { + "type": "structure", + "required": [ + "OrganizationConfigRuleName" + ], + "members": { + "OrganizationConfigRuleName": "OrganizationConfigRuleName" + } + }, + "GetResourceConfigHistoryRequest": { + "type": "structure", + "required": [ + "resourceType", + "resourceId" + ], + "members": { + "resourceType": "ResourceType", + "resourceId": "ResourceId", + "chronologicalOrder": "ChronologicalOrder", + "limit": "Limit", + "nextToken": "NextToken" + } + }, + "GetResourceEvaluationSummaryRequest": { + "type": "structure", + "required": [ + "ResourceEvaluationId" + ], + "members": { + "ResourceEvaluationId": "ResourceEvaluationId" + } + }, + "GetStoredQueryRequest": { + "type": "structure", + "required": [ + "QueryName" + ], + "members": { + "QueryName": "QueryName" + } + }, + "GroupByAPILimit": { + "type": "integer", + "min": 0, + "max": 1000 + }, + "IncludeGlobalResourceTypes": { + "type": "boolean" + }, + "IncludedRegions": { + "type": "list", + "min": 0, + "max": 200, + "member": "ThirdPartyCloudRegion" + }, + "Limit": { + "type": "integer", + "min": 0, + "max": 100 + }, + "ListAggregateDiscoveredResourcesRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName", + "ResourceType" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "ResourceType": "ResourceType", + "Filters": "ResourceFilters", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "ListConfigurationRecordersRequest": { + "type": "structure", + "members": { + "Filters": "ConfigurationRecorderFilterList", + "MaxResults": "MaxResults", + "NextToken": "NextToken" + } + }, + "ListConformancePackComplianceScoresRequest": { + "type": "structure", + "members": { + "Filters": "ConformancePackComplianceScoresFilters", + "SortOrder": "SortOrder", + "SortBy": "SortBy", + "Limit": "PageSizeLimit", + "NextToken": "NextToken" + } + }, + "ListConnectorsMaxResults": { + "type": "integer", + "min": 0, + "max": 100 + }, + "ListConnectorsRequest": { + "type": "structure", + "members": { + "MaxResults": "ListConnectorsMaxResults", + "NextToken": "String", + "Filters": "ConnectorFilterList" + } + }, + "ListDiscoveredResourcesRequest": { + "type": "structure", + "required": [ + "resourceType" + ], + "members": { + "resourceType": "ResourceType", + "resourceIds": "ResourceIdList", + "resourceName": "ResourceName", + "limit": "Limit", + "includeDeletedResources": "Boolean", + "nextToken": "NextToken" + } + }, + "ListResourceEvaluationsPageItemLimit": { + "type": "integer", + "min": 0, + "max": 100 + }, + "ListResourceEvaluationsRequest": { + "type": "structure", + "members": { + "Filters": "ResourceEvaluationFilters", + "Limit": "ListResourceEvaluationsPageItemLimit", + "NextToken": "String" + } + }, + "ListStoredQueriesRequest": { + "type": "structure", + "members": { + "NextToken": "String", + "MaxResults": "Limit" + } + }, + "ListTagsForResourceRequest": { + "type": "structure", + "required": [ + "ResourceArn" + ], + "members": { + "ResourceArn": "AmazonResourceName", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "MaxResults": { + "type": "integer", + "min": 0, + "max": 20 + }, + "MaximumExecutionFrequency": { + "type": "string", + "enum": [ + "One_Hour", + "Three_Hours", + "Six_Hours", + "Twelve_Hours", + "TwentyFour_Hours" + ] + }, + "MemberAccountRuleStatus": { + "type": "string", + "enum": [ + "CREATE_SUCCESSFUL", + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_SUCCESSFUL", + "DELETE_FAILED", + "DELETE_IN_PROGRESS", + "UPDATE_SUCCESSFUL", + "UPDATE_IN_PROGRESS", + "UPDATE_FAILED" + ] + }, + "MessageType": { + "type": "string", + "enum": [ + "ConfigurationItemChangeNotification", + "ConfigurationSnapshotDeliveryCompleted", + "ScheduledNotification", + "OversizedConfigurationItemChangeNotification" + ] + }, + "Name": { + "type": "string" + }, + "NextToken": { + "type": "string" + }, + "OrganizationAggregationSource": { + "type": "structure", + "required": [ + "RoleArn" + ], + "members": { + "RoleArn": "String", + "AwsRegions": "AggregatorRegionList", + "AllAwsRegions": "Boolean" + } + }, + "OrganizationConfigRuleName": { + "type": "string", + "min": 1, + "max": 64, + "pattern": "[A-Za-z0-9-_]+" + }, + "OrganizationConfigRuleNames": { + "type": "list", + "min": 0, + "max": 25, + "member": "StringWithCharLimit64" + }, + "OrganizationConfigRuleTriggerType": { + "type": "string", + "enum": [ + "ConfigurationItemChangeNotification", + "OversizedConfigurationItemChangeNotification", + "ScheduledNotification" + ] + }, + "OrganizationConfigRuleTriggerTypeNoSN": { + "type": "string", + "enum": [ + "ConfigurationItemChangeNotification", + "OversizedConfigurationItemChangeNotification" + ] + }, + "OrganizationConfigRuleTriggerTypeNoSNs": { + "type": "list", + "member": "OrganizationConfigRuleTriggerTypeNoSN" + }, + "OrganizationConfigRuleTriggerTypes": { + "type": "list", + "member": "OrganizationConfigRuleTriggerType" + }, + "OrganizationConformancePackName": { + "type": "string", + "min": 1, + "max": 128, + "pattern": "[a-zA-Z][-a-zA-Z0-9]*" + }, + "OrganizationConformancePackNames": { + "type": "list", + "min": 0, + "max": 25, + "member": "OrganizationConformancePackName" + }, + "OrganizationCustomPolicyRuleMetadata": { + "type": "structure", + "required": [ + "PolicyRuntime", + "PolicyText" + ], + "members": { + "Description": "StringWithCharLimit256Min0", + "OrganizationConfigRuleTriggerTypes": "OrganizationConfigRuleTriggerTypeNoSNs", + "InputParameters": "StringWithCharLimit1024", + "MaximumExecutionFrequency": "MaximumExecutionFrequency", + "ResourceTypesScope": "ResourceTypesScope", + "ResourceIdScope": "StringWithCharLimit768", + "TagKeyScope": "StringWithCharLimit128", + "TagValueScope": "StringWithCharLimit256", + "PolicyRuntime": "PolicyRuntime", + "PolicyText": "PolicyText", + "DebugLogDeliveryAccounts": "DebugLogDeliveryAccounts" + } + }, + "OrganizationCustomRuleMetadata": { + "type": "structure", + "required": [ + "LambdaFunctionArn", + "OrganizationConfigRuleTriggerTypes" + ], + "members": { + "Description": "StringWithCharLimit256Min0", + "LambdaFunctionArn": "StringWithCharLimit256", + "OrganizationConfigRuleTriggerTypes": "OrganizationConfigRuleTriggerTypes", + "InputParameters": "StringWithCharLimit1024", + "MaximumExecutionFrequency": "MaximumExecutionFrequency", + "ResourceTypesScope": "ResourceTypesScope", + "ResourceIdScope": "StringWithCharLimit768", + "TagKeyScope": "StringWithCharLimit128", + "TagValueScope": "StringWithCharLimit256" + } + }, + "OrganizationManagedRuleMetadata": { + "type": "structure", + "required": [ + "RuleIdentifier" + ], + "members": { + "Description": "StringWithCharLimit256Min0", + "RuleIdentifier": "StringWithCharLimit256", + "InputParameters": "StringWithCharLimit1024", + "MaximumExecutionFrequency": "MaximumExecutionFrequency", + "ResourceTypesScope": "ResourceTypesScope", + "ResourceIdScope": "StringWithCharLimit768", + "TagKeyScope": "StringWithCharLimit128", + "TagValueScope": "StringWithCharLimit256" + } + }, + "OrganizationResourceDetailedStatus": { + "type": "string", + "enum": [ + "CREATE_SUCCESSFUL", + "CREATE_IN_PROGRESS", + "CREATE_FAILED", + "DELETE_SUCCESSFUL", + "DELETE_FAILED", + "DELETE_IN_PROGRESS", + "UPDATE_SUCCESSFUL", + "UPDATE_IN_PROGRESS", + "UPDATE_FAILED" + ] + }, + "OrganizationResourceDetailedStatusFilters": { + "type": "structure", + "members": { + "AccountId": "AccountId", + "Status": "OrganizationResourceDetailedStatus" + } + }, + "Owner": { + "type": "string", + "enum": [ + "CUSTOM_LAMBDA", + "AWS", + "CUSTOM_POLICY" + ] + }, + "PageSizeLimit": { + "type": "integer", + "min": 0, + "max": 20 + }, + "ParameterName": { + "type": "string", + "min": 0, + "max": 255 + }, + "ParameterValue": { + "type": "string", + "min": 0, + "max": 4096 + }, + "Percentage": { + "type": "integer", + "min": 1, + "max": 100 + }, + "PolicyRuntime": { + "type": "string", + "min": 1, + "max": 64, + "pattern": "guard\\-2\\.x\\.x" + }, + "PolicyText": { + "type": "string", + "min": 0, + "max": 10000 + }, + "PutAggregationAuthorizationRequest": { + "type": "structure", + "required": [ + "AuthorizedAccountId", + "AuthorizedAwsRegion" + ], + "members": { + "AuthorizedAccountId": "AccountId", + "AuthorizedAwsRegion": "AwsRegion", + "Tags": "TagsList" + } + }, + "PutConfigRuleRequest": { + "type": "structure", + "required": [ + "ConfigRule" + ], + "members": { + "ConfigRule": "ConfigRule", + "Tags": "TagsList" + } + }, + "PutConfigurationAggregatorRequest": { + "type": "structure", + "required": [ + "ConfigurationAggregatorName" + ], + "members": { + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "AccountAggregationSources": "AccountAggregationSourceList", + "OrganizationAggregationSource": "OrganizationAggregationSource", + "Tags": "TagsList", + "AggregatorFilters": "AggregatorFilters" + } + }, + "PutConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorder" + ], + "members": { + "ConfigurationRecorder": "ConfigurationRecorder", + "Tags": "TagsList" + } + }, + "PutConformancePackRequest": { + "type": "structure", + "required": [ + "ConformancePackName" + ], + "members": { + "ConformancePackName": "ConformancePackName", + "TemplateS3Uri": "TemplateS3Uri", + "TemplateBody": "TemplateBody", + "DeliveryS3Bucket": "DeliveryS3Bucket", + "DeliveryS3KeyPrefix": "DeliveryS3KeyPrefix", + "ConformancePackInputParameters": "ConformancePackInputParameters", + "TemplateSSMDocumentDetails": "TemplateSSMDocumentDetails", + "Tags": "TagsList" + } + }, + "PutConnectorRequest": { + "type": "structure", + "required": [ + "ConnectorConfiguration" + ], + "members": { + "ConnectorConfiguration": "ConnectorConfiguration", + "Tags": "TagsList" + } + }, + "PutDeliveryChannelRequest": { + "type": "structure", + "required": [ + "DeliveryChannel" + ], + "members": { + "DeliveryChannel": "DeliveryChannel" + } + }, + "PutEvaluationsRequest": { + "type": "structure", + "required": [ + "ResultToken" + ], + "members": { + "Evaluations": "Evaluations", + "ResultToken": "String", + "TestMode": "Boolean" + } + }, + "PutExternalEvaluationRequest": { + "type": "structure", + "required": [ + "ConfigRuleName", + "ExternalEvaluation" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ExternalEvaluation": "ExternalEvaluation" + } + }, + "PutOrganizationConfigRuleRequest": { + "type": "structure", + "required": [ + "OrganizationConfigRuleName" + ], + "members": { + "OrganizationConfigRuleName": "OrganizationConfigRuleName", + "OrganizationManagedRuleMetadata": "OrganizationManagedRuleMetadata", + "OrganizationCustomRuleMetadata": "OrganizationCustomRuleMetadata", + "ExcludedAccounts": "ExcludedAccounts", + "OrganizationCustomPolicyRuleMetadata": "OrganizationCustomPolicyRuleMetadata", + "Tags": "TagsList" + } + }, + "PutOrganizationConformancePackRequest": { + "type": "structure", + "required": [ + "OrganizationConformancePackName" + ], + "members": { + "OrganizationConformancePackName": "OrganizationConformancePackName", + "TemplateS3Uri": "TemplateS3Uri", + "TemplateBody": "TemplateBody", + "DeliveryS3Bucket": "DeliveryS3Bucket", + "DeliveryS3KeyPrefix": "DeliveryS3KeyPrefix", + "ConformancePackInputParameters": "ConformancePackInputParameters", + "ExcludedAccounts": "ExcludedAccounts", + "Tags": "TagsList" + } + }, + "PutRemediationConfigurationsRequest": { + "type": "structure", + "required": [ + "RemediationConfigurations" + ], + "members": { + "RemediationConfigurations": "RemediationConfigurations" + } + }, + "PutRemediationExceptionsRequest": { + "type": "structure", + "required": [ + "ConfigRuleName", + "ResourceKeys" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceKeys": "RemediationExceptionResourceKeys", + "Message": "StringWithCharLimit1024" + } + }, + "PutResourceConfigRequest": { + "type": "structure", + "required": [ + "ResourceType", + "SchemaVersionId", + "ResourceId", + "Configuration" + ], + "members": { + "ResourceType": "ResourceTypeString", + "SchemaVersionId": "SchemaVersionId", + "ResourceId": "ResourceId", + "ResourceName": "ResourceName", + "Configuration": "Configuration", + "Tags": "Tags" + } + }, + "PutRetentionConfigurationRequest": { + "type": "structure", + "required": [ + "RetentionPeriodInDays" + ], + "members": { + "RetentionPeriodInDays": "RetentionPeriodInDays" + } + }, + "PutServiceLinkedConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ServicePrincipal" + ], + "members": { + "ServicePrincipal": "ServicePrincipal", + "Tags": "TagsList" + } + }, + "PutStoredQueryRequest": { + "type": "structure", + "required": [ + "StoredQuery" + ], + "members": { + "StoredQuery": "StoredQuery", + "Tags": "TagsList" + } + }, + "PutThirdPartyServiceLinkedConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ServicePrincipal", + "ConnectorArn", + "ScopeConfiguration" + ], + "members": { + "ServicePrincipal": "ServicePrincipal", + "ConnectorArn": "AmazonResourceName", + "ScopeConfiguration": "ScopeConfiguration", + "Tags": "TagsList" + } + }, + "QueryArn": { + "type": "string", + "min": 1, + "max": 500, + "pattern": "^arn:aws[a-z\\-]*:config:[a-z\\-\\d]+:\\d+:stored-query/[a-zA-Z0-9-_]+/query-[a-zA-Z\\d-_/]+$" + }, + "QueryDescription": { + "type": "string", + "min": 0, + "max": 256, + "pattern": "[\\s\\S]*" + }, + "QueryExpression": { + "type": "string", + "min": 1, + "max": 4096, + "pattern": "[\\s\\S]*" + }, + "QueryId": { + "type": "string", + "min": 1, + "max": 36, + "pattern": "^\\S+$" + }, + "QueryName": { + "type": "string", + "min": 1, + "max": 64, + "pattern": "^[a-zA-Z0-9-_]+$" + }, + "RecorderName": { + "type": "string", + "min": 1, + "max": 256 + }, + "RecordingFrequency": { + "type": "string", + "enum": [ + "CONTINUOUS", + "DAILY" + ] + }, + "RecordingGroup": { + "type": "structure", + "members": { + "allSupported": "AllSupported", + "includeGlobalResourceTypes": "IncludeGlobalResourceTypes", + "resourceTypes": "ResourceTypeList", + "exclusionByResourceTypes": "ExclusionByResourceTypes", + "recordingStrategy": "RecordingStrategy" + } + }, + "RecordingMode": { + "type": "structure", + "required": [ + "recordingFrequency" + ], + "members": { + "recordingFrequency": "RecordingFrequency", + "recordingModeOverrides": "RecordingModeOverrides" + } + }, + "RecordingModeOverride": { + "type": "structure", + "required": [ + "resourceTypes", + "recordingFrequency" + ], + "members": { + "description": "Description", + "resourceTypes": "RecordingModeResourceTypesList", + "recordingFrequency": "RecordingFrequency" + } + }, + "RecordingModeOverrides": { + "type": "list", + "min": 0, + "max": 1, + "member": "RecordingModeOverride" + }, + "RecordingModeResourceTypesList": { + "type": "list", + "member": "ResourceType" + }, + "RecordingScope": { + "type": "string", + "enum": [ + "INTERNAL", + "PAID" + ] + }, + "RecordingStrategy": { + "type": "structure", + "members": { + "useOnly": "RecordingStrategyType" + } + }, + "RecordingStrategyType": { + "type": "string", + "enum": [ + "ALL_SUPPORTED_RESOURCE_TYPES", + "INCLUSION_BY_RESOURCE_TYPES", + "EXCLUSION_BY_RESOURCE_TYPES" + ] + }, + "ReevaluateConfigRuleNames": { + "type": "list", + "min": 1, + "max": 25, + "member": "ConfigRuleName" + }, + "RemediationConfiguration": { + "type": "structure", + "required": [ + "ConfigRuleName", + "TargetType", + "TargetId" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "TargetType": "RemediationTargetType", + "TargetId": "StringWithCharLimit256", + "TargetVersion": "String", + "Parameters": "RemediationParameters", + "ResourceType": "String", + "Automatic": "Boolean", + "ExecutionControls": "ExecutionControls", + "MaximumAutomaticAttempts": "AutoRemediationAttempts", + "RetryAttemptSeconds": "AutoRemediationAttemptSeconds", + "Arn": "StringWithCharLimit1024", + "CreatedByService": "StringWithCharLimit1024" + } + }, + "RemediationConfigurations": { + "type": "list", + "min": 0, + "max": 25, + "member": "RemediationConfiguration" + }, + "RemediationExceptionResourceKey": { + "type": "structure", + "members": { + "ResourceType": "StringWithCharLimit256", + "ResourceId": "StringWithCharLimit1024" + } + }, + "RemediationExceptionResourceKeys": { + "type": "list", + "min": 1, + "max": 100, + "member": "RemediationExceptionResourceKey" + }, + "RemediationParameterValue": { + "type": "structure", + "members": { + "ResourceValue": "ResourceValue", + "StaticValue": "StaticValue" + } + }, + "RemediationParameters": { + "type": "map", + "min": 0, + "max": 25, + "key": "StringWithCharLimit256", + "value": "RemediationParameterValue" + }, + "RemediationTargetType": { + "type": "string", + "enum": [ + "SSM_DOCUMENT" + ] + }, + "ResourceConfiguration": { + "type": "string", + "min": 1, + "max": 51200 + }, + "ResourceConfigurationSchemaType": { + "type": "string", + "enum": [ + "CFN_RESOURCE_SCHEMA" + ] + }, + "ResourceCountFilters": { + "type": "structure", + "members": { + "ResourceType": "ResourceType", + "AccountId": "AccountId", + "Region": "AwsRegion" + } + }, + "ResourceCountGroupKey": { + "type": "string", + "enum": [ + "RESOURCE_TYPE", + "ACCOUNT_ID", + "AWS_REGION" + ] + }, + "ResourceDetails": { + "type": "structure", + "required": [ + "ResourceId", + "ResourceType", + "ResourceConfiguration" + ], + "members": { + "ResourceId": "BaseResourceId", + "ResourceType": "StringWithCharLimit256", + "ResourceConfiguration": "ResourceConfiguration", + "ResourceConfigurationSchemaType": "ResourceConfigurationSchemaType" + } + }, + "ResourceEvaluationFilters": { + "type": "structure", + "members": { + "EvaluationMode": "EvaluationMode", + "TimeWindow": "TimeWindow", + "EvaluationContextIdentifier": "EvaluationContextIdentifier" + } + }, + "ResourceEvaluationId": { + "type": "string", + "min": 1, + "max": 128 + }, + "ResourceFilters": { + "type": "structure", + "members": { + "AccountId": "AccountId", + "ResourceId": "ResourceId", + "ResourceName": "ResourceName", + "Region": "AwsRegion" + } + }, + "ResourceId": { + "type": "string", + "min": 1, + "max": 768 + }, + "ResourceIdList": { + "type": "list", + "member": "ResourceId" + }, + "ResourceIdentifiersList": { + "type": "list", + "min": 1, + "max": 100, + "member": "AggregateResourceIdentifier" + }, + "ResourceKey": { + "type": "structure", + "required": [ + "resourceType", + "resourceId" + ], + "members": { + "resourceType": "ResourceType", + "resourceId": "ResourceId" + } + }, + "ResourceKeys": { + "type": "list", + "min": 1, + "max": 100, + "member": "ResourceKey" + }, + "ResourceName": { + "type": "string" + }, + "ResourceType": { + "type": "string", + "enum": [ + "AWS::EC2::CustomerGateway", + "AWS::EC2::EIP", + "AWS::EC2::Host", + "AWS::EC2::Instance", + "AWS::EC2::InternetGateway", + "AWS::EC2::NetworkAcl", + "AWS::EC2::NetworkInterface", + "AWS::EC2::RouteTable", + "AWS::EC2::SecurityGroup", + "AWS::EC2::Subnet", + "AWS::CloudTrail::Trail", + "AWS::EC2::Volume", + "AWS::EC2::VPC", + "AWS::EC2::VPNConnection", + "AWS::EC2::VPNGateway", + "AWS::EC2::RegisteredHAInstance", + "AWS::EC2::NatGateway", + "AWS::EC2::EgressOnlyInternetGateway", + "AWS::EC2::VPCEndpoint", + "AWS::EC2::VPCEndpointService", + "AWS::EC2::FlowLog", + "AWS::EC2::VPCPeeringConnection", + "AWS::Elasticsearch::Domain", + "AWS::IAM::Group", + "AWS::IAM::Policy", + "AWS::IAM::Role", + "AWS::IAM::User", + "AWS::ElasticLoadBalancingV2::LoadBalancer", + "AWS::ACM::Certificate", + "AWS::RDS::DBInstance", + "AWS::RDS::DBSubnetGroup", + "AWS::RDS::DBSecurityGroup", + "AWS::RDS::DBSnapshot", + "AWS::RDS::DBCluster", + "AWS::RDS::DBClusterSnapshot", + "AWS::RDS::EventSubscription", + "AWS::S3::Bucket", + "AWS::S3::AccountPublicAccessBlock", + "AWS::Redshift::Cluster", + "AWS::Redshift::ClusterSnapshot", + "AWS::Redshift::ClusterParameterGroup", + "AWS::Redshift::ClusterSecurityGroup", + "AWS::Redshift::ClusterSubnetGroup", + "AWS::Redshift::EventSubscription", + "AWS::SSM::ManagedInstanceInventory", + "AWS::CloudWatch::Alarm", + "AWS::CloudFormation::Stack", + "AWS::ElasticLoadBalancing::LoadBalancer", + "AWS::AutoScaling::AutoScalingGroup", + "AWS::AutoScaling::LaunchConfiguration", + "AWS::AutoScaling::ScalingPolicy", + "AWS::AutoScaling::ScheduledAction", + "AWS::DynamoDB::Table", + "AWS::CodeBuild::Project", + "AWS::WAF::RateBasedRule", + "AWS::WAF::Rule", + "AWS::WAF::RuleGroup", + "AWS::WAF::WebACL", + "AWS::WAFRegional::RateBasedRule", + "AWS::WAFRegional::Rule", + "AWS::WAFRegional::RuleGroup", + "AWS::WAFRegional::WebACL", + "AWS::CloudFront::Distribution", + "AWS::CloudFront::StreamingDistribution", + "AWS::Lambda::Function", + "AWS::NetworkFirewall::Firewall", + "AWS::NetworkFirewall::FirewallPolicy", + "AWS::NetworkFirewall::RuleGroup", + "AWS::ElasticBeanstalk::Application", + "AWS::ElasticBeanstalk::ApplicationVersion", + "AWS::ElasticBeanstalk::Environment", + "AWS::WAFv2::WebACL", + "AWS::WAFv2::RuleGroup", + "AWS::WAFv2::IPSet", + "AWS::WAFv2::RegexPatternSet", + "AWS::WAFv2::ManagedRuleSet", + "AWS::XRay::EncryptionConfig", + "AWS::SSM::AssociationCompliance", + "AWS::SSM::PatchCompliance", + "AWS::Shield::Protection", + "AWS::ShieldRegional::Protection", + "AWS::Config::ConformancePackCompliance", + "AWS::Config::ResourceCompliance", + "AWS::ApiGateway::Stage", + "AWS::ApiGateway::RestApi", + "AWS::ApiGatewayV2::Stage", + "AWS::ApiGatewayV2::Api", + "AWS::CodePipeline::Pipeline", + "AWS::ServiceCatalog::CloudFormationProvisionedProduct", + "AWS::ServiceCatalog::CloudFormationProduct", + "AWS::ServiceCatalog::Portfolio", + "AWS::SQS::Queue", + "AWS::KMS::Key", + "AWS::QLDB::Ledger", + "AWS::SecretsManager::Secret", + "AWS::SNS::Topic", + "AWS::SSM::FileData", + "AWS::Backup::BackupPlan", + "AWS::Backup::BackupSelection", + "AWS::Backup::BackupVault", + "AWS::Backup::RecoveryPoint", + "AWS::ECR::Repository", + "AWS::ECS::Cluster", + "AWS::ECS::Service", + "AWS::ECS::TaskDefinition", + "AWS::EFS::AccessPoint", + "AWS::EFS::FileSystem", + "AWS::EKS::Cluster", + "AWS::OpenSearch::Domain", + "AWS::EC2::TransitGateway", + "AWS::Kinesis::Stream", + "AWS::Kinesis::StreamConsumer", + "AWS::CodeDeploy::Application", + "AWS::CodeDeploy::DeploymentConfig", + "AWS::CodeDeploy::DeploymentGroup", + "AWS::EC2::LaunchTemplate", + "AWS::ECR::PublicRepository", + "AWS::GuardDuty::Detector", + "AWS::EMR::SecurityConfiguration", + "AWS::SageMaker::CodeRepository", + "AWS::Route53Resolver::ResolverEndpoint", + "AWS::Route53Resolver::ResolverRule", + "AWS::Route53Resolver::ResolverRuleAssociation", + "AWS::DMS::ReplicationSubnetGroup", + "AWS::DMS::EventSubscription", + "AWS::MSK::Cluster", + "AWS::StepFunctions::Activity", + "AWS::WorkSpaces::Workspace", + "AWS::WorkSpaces::ConnectionAlias", + "AWS::SageMaker::Model", + "AWS::ElasticLoadBalancingV2::Listener", + "AWS::StepFunctions::StateMachine", + "AWS::Batch::JobQueue", + "AWS::Batch::ComputeEnvironment", + "AWS::AccessAnalyzer::Analyzer", + "AWS::Athena::WorkGroup", + "AWS::Athena::DataCatalog", + "AWS::Detective::Graph", + "AWS::GlobalAccelerator::Accelerator", + "AWS::GlobalAccelerator::EndpointGroup", + "AWS::GlobalAccelerator::Listener", + "AWS::EC2::TransitGatewayAttachment", + "AWS::EC2::TransitGatewayRouteTable", + "AWS::DMS::Certificate", + "AWS::AppConfig::Application", + "AWS::AppSync::GraphQLApi", + "AWS::DataSync::LocationSMB", + "AWS::DataSync::LocationFSxLustre", + "AWS::DataSync::LocationS3", + "AWS::DataSync::LocationEFS", + "AWS::DataSync::Task", + "AWS::DataSync::LocationNFS", + "AWS::EC2::NetworkInsightsAccessScopeAnalysis", + "AWS::EKS::FargateProfile", + "AWS::Glue::Job", + "AWS::GuardDuty::ThreatIntelSet", + "AWS::GuardDuty::IPSet", + "AWS::SageMaker::Workteam", + "AWS::SageMaker::NotebookInstanceLifecycleConfig", + "AWS::ServiceDiscovery::Service", + "AWS::ServiceDiscovery::PublicDnsNamespace", + "AWS::SES::ContactList", + "AWS::SES::ConfigurationSet", + "AWS::Route53::HostedZone", + "AWS::IoTEvents::Input", + "AWS::IoTEvents::DetectorModel", + "AWS::IoTEvents::AlarmModel", + "AWS::ServiceDiscovery::HttpNamespace", + "AWS::Events::EventBus", + "AWS::ImageBuilder::ContainerRecipe", + "AWS::ImageBuilder::DistributionConfiguration", + "AWS::ImageBuilder::InfrastructureConfiguration", + "AWS::DataSync::LocationObjectStorage", + "AWS::DataSync::LocationHDFS", + "AWS::Glue::Classifier", + "AWS::Route53RecoveryReadiness::Cell", + "AWS::Route53RecoveryReadiness::ReadinessCheck", + "AWS::ECR::RegistryPolicy", + "AWS::Backup::ReportPlan", + "AWS::Lightsail::Certificate", + "AWS::RUM::AppMonitor", + "AWS::Events::Endpoint", + "AWS::SES::ReceiptRuleSet", + "AWS::Events::Archive", + "AWS::Events::ApiDestination", + "AWS::Lightsail::Disk", + "AWS::FIS::ExperimentTemplate", + "AWS::DataSync::LocationFSxWindows", + "AWS::SES::ReceiptFilter", + "AWS::GuardDuty::Filter", + "AWS::SES::Template", + "AWS::AmazonMQ::Broker", + "AWS::AppConfig::Environment", + "AWS::AppConfig::ConfigurationProfile", + "AWS::Cloud9::EnvironmentEC2", + "AWS::EventSchemas::Registry", + "AWS::EventSchemas::RegistryPolicy", + "AWS::EventSchemas::Discoverer", + "AWS::FraudDetector::Label", + "AWS::FraudDetector::EntityType", + "AWS::FraudDetector::Variable", + "AWS::FraudDetector::Outcome", + "AWS::IoT::Authorizer", + "AWS::IoT::SecurityProfile", + "AWS::IoT::RoleAlias", + "AWS::IoT::Dimension", + "AWS::IoTAnalytics::Datastore", + "AWS::Lightsail::Bucket", + "AWS::Lightsail::StaticIp", + "AWS::MediaPackage::PackagingGroup", + "AWS::Route53RecoveryReadiness::RecoveryGroup", + "AWS::ResilienceHub::ResiliencyPolicy", + "AWS::Transfer::Workflow", + "AWS::EKS::IdentityProviderConfig", + "AWS::EKS::Addon", + "AWS::Glue::MLTransform", + "AWS::IoT::Policy", + "AWS::IoT::MitigationAction", + "AWS::IoTTwinMaker::Workspace", + "AWS::IoTTwinMaker::Entity", + "AWS::IoTAnalytics::Dataset", + "AWS::IoTAnalytics::Pipeline", + "AWS::IoTAnalytics::Channel", + "AWS::IoTSiteWise::Dashboard", + "AWS::IoTSiteWise::Project", + "AWS::IoTSiteWise::Portal", + "AWS::IoTSiteWise::AssetModel", + "AWS::IVS::Channel", + "AWS::IVS::RecordingConfiguration", + "AWS::IVS::PlaybackKeyPair", + "AWS::KinesisAnalyticsV2::Application", + "AWS::RDS::GlobalCluster", + "AWS::S3::MultiRegionAccessPoint", + "AWS::DeviceFarm::TestGridProject", + "AWS::Budgets::BudgetsAction", + "AWS::Lex::Bot", + "AWS::CodeGuruReviewer::RepositoryAssociation", + "AWS::IoT::CustomMetric", + "AWS::Route53Resolver::FirewallDomainList", + "AWS::RoboMaker::RobotApplicationVersion", + "AWS::EC2::TrafficMirrorSession", + "AWS::IoTSiteWise::Gateway", + "AWS::Lex::BotAlias", + "AWS::LookoutMetrics::Alert", + "AWS::IoT::AccountAuditConfiguration", + "AWS::EC2::TrafficMirrorTarget", + "AWS::S3::StorageLens", + "AWS::IoT::ScheduledAudit", + "AWS::Events::Connection", + "AWS::EventSchemas::Schema", + "AWS::MediaPackage::PackagingConfiguration", + "AWS::KinesisVideo::SignalingChannel", + "AWS::AppStream::DirectoryConfig", + "AWS::LookoutVision::Project", + "AWS::Route53RecoveryControl::Cluster", + "AWS::Route53RecoveryControl::SafetyRule", + "AWS::Route53RecoveryControl::ControlPanel", + "AWS::Route53RecoveryControl::RoutingControl", + "AWS::Route53RecoveryReadiness::ResourceSet", + "AWS::RoboMaker::SimulationApplication", + "AWS::RoboMaker::RobotApplication", + "AWS::HealthLake::FHIRDatastore", + "AWS::Pinpoint::Segment", + "AWS::Pinpoint::ApplicationSettings", + "AWS::Events::Rule", + "AWS::EC2::DHCPOptions", + "AWS::EC2::NetworkInsightsPath", + "AWS::EC2::TrafficMirrorFilter", + "AWS::EC2::IPAM", + "AWS::IoTTwinMaker::Scene", + "AWS::NetworkManager::TransitGatewayRegistration", + "AWS::CustomerProfiles::Domain", + "AWS::AutoScaling::WarmPool", + "AWS::Connect::PhoneNumber", + "AWS::AppConfig::DeploymentStrategy", + "AWS::AppFlow::Flow", + "AWS::AuditManager::Assessment", + "AWS::CloudWatch::MetricStream", + "AWS::DeviceFarm::InstanceProfile", + "AWS::DeviceFarm::Project", + "AWS::EC2::EC2Fleet", + "AWS::EC2::SubnetRouteTableAssociation", + "AWS::ECR::PullThroughCacheRule", + "AWS::GroundStation::Config", + "AWS::ImageBuilder::ImagePipeline", + "AWS::IoT::FleetMetric", + "AWS::IoTWireless::ServiceProfile", + "AWS::NetworkManager::Device", + "AWS::NetworkManager::GlobalNetwork", + "AWS::NetworkManager::Link", + "AWS::NetworkManager::Site", + "AWS::Panorama::Package", + "AWS::Pinpoint::App", + "AWS::Redshift::ScheduledAction", + "AWS::Route53Resolver::FirewallRuleGroupAssociation", + "AWS::SageMaker::AppImageConfig", + "AWS::SageMaker::Image", + "AWS::ECS::TaskSet", + "AWS::Cassandra::Keyspace", + "AWS::Signer::SigningProfile", + "AWS::Amplify::App", + "AWS::AppMesh::VirtualNode", + "AWS::AppMesh::VirtualService", + "AWS::AppRunner::VpcConnector", + "AWS::AppStream::Application", + "AWS::CodeArtifact::Repository", + "AWS::EC2::PrefixList", + "AWS::EC2::SpotFleet", + "AWS::Evidently::Project", + "AWS::Forecast::Dataset", + "AWS::IAM::SAMLProvider", + "AWS::IAM::ServerCertificate", + "AWS::Pinpoint::Campaign", + "AWS::Pinpoint::InAppTemplate", + "AWS::SageMaker::Domain", + "AWS::Transfer::Agreement", + "AWS::Transfer::Connector", + "AWS::KinesisFirehose::DeliveryStream", + "AWS::Amplify::Branch", + "AWS::AppIntegrations::EventIntegration", + "AWS::AppMesh::Route", + "AWS::Athena::PreparedStatement", + "AWS::EC2::IPAMScope", + "AWS::Evidently::Launch", + "AWS::Forecast::DatasetGroup", + "AWS::GreengrassV2::ComponentVersion", + "AWS::GroundStation::MissionProfile", + "AWS::MediaConnect::FlowEntitlement", + "AWS::MediaConnect::FlowVpcInterface", + "AWS::MediaTailor::PlaybackConfiguration", + "AWS::MSK::Configuration", + "AWS::Personalize::Dataset", + "AWS::Personalize::Schema", + "AWS::Personalize::Solution", + "AWS::Pinpoint::EmailTemplate", + "AWS::Pinpoint::EventStream", + "AWS::ResilienceHub::App", + "AWS::ACMPCA::CertificateAuthority", + "AWS::AppConfig::HostedConfigurationVersion", + "AWS::AppMesh::VirtualGateway", + "AWS::AppMesh::VirtualRouter", + "AWS::AppRunner::Service", + "AWS::CustomerProfiles::ObjectType", + "AWS::DMS::Endpoint", + "AWS::EC2::CapacityReservation", + "AWS::EC2::ClientVpnEndpoint", + "AWS::Kendra::Index", + "AWS::KinesisVideo::Stream", + "AWS::Logs::Destination", + "AWS::Pinpoint::EmailChannel", + "AWS::S3::AccessPoint", + "AWS::NetworkManager::CustomerGatewayAssociation", + "AWS::NetworkManager::LinkAssociation", + "AWS::IoTWireless::MulticastGroup", + "AWS::Personalize::DatasetGroup", + "AWS::IoTTwinMaker::ComponentType", + "AWS::CodeBuild::ReportGroup", + "AWS::SageMaker::FeatureGroup", + "AWS::MSK::BatchScramSecret", + "AWS::AppStream::Stack", + "AWS::IoT::JobTemplate", + "AWS::IoTWireless::FuotaTask", + "AWS::IoT::ProvisioningTemplate", + "AWS::InspectorV2::Filter", + "AWS::Route53Resolver::ResolverQueryLoggingConfigAssociation", + "AWS::ServiceDiscovery::Instance", + "AWS::Transfer::Certificate", + "AWS::MediaConnect::FlowSource", + "AWS::APS::RuleGroupsNamespace", + "AWS::CodeGuruProfiler::ProfilingGroup", + "AWS::Route53Resolver::ResolverQueryLoggingConfig", + "AWS::Batch::SchedulingPolicy", + "AWS::ACMPCA::CertificateAuthorityActivation", + "AWS::AppMesh::GatewayRoute", + "AWS::AppMesh::Mesh", + "AWS::Connect::Instance", + "AWS::Connect::QuickConnect", + "AWS::EC2::CarrierGateway", + "AWS::EC2::IPAMPool", + "AWS::EC2::TransitGatewayConnect", + "AWS::EC2::TransitGatewayMulticastDomain", + "AWS::ECS::CapacityProvider", + "AWS::IAM::InstanceProfile", + "AWS::IoT::CACertificate", + "AWS::IoTTwinMaker::SyncJob", + "AWS::KafkaConnect::Connector", + "AWS::Lambda::CodeSigningConfig", + "AWS::NetworkManager::ConnectPeer", + "AWS::ResourceExplorer2::Index", + "AWS::AppStream::Fleet", + "AWS::Cognito::UserPool", + "AWS::Cognito::UserPoolClient", + "AWS::Cognito::UserPoolGroup", + "AWS::EC2::NetworkInsightsAccessScope", + "AWS::EC2::NetworkInsightsAnalysis", + "AWS::Grafana::Workspace", + "AWS::GroundStation::DataflowEndpointGroup", + "AWS::ImageBuilder::ImageRecipe", + "AWS::KMS::Alias", + "AWS::M2::Environment", + "AWS::QuickSight::DataSource", + "AWS::QuickSight::Template", + "AWS::QuickSight::Theme", + "AWS::RDS::OptionGroup", + "AWS::Redshift::EndpointAccess", + "AWS::Route53Resolver::FirewallRuleGroup", + "AWS::SSM::Document", + "AWS::AppConfig::ExtensionAssociation", + "AWS::AppIntegrations::Application", + "AWS::AppSync::ApiCache", + "AWS::Bedrock::Guardrail", + "AWS::Bedrock::KnowledgeBase", + "AWS::Cognito::IdentityPool", + "AWS::Connect::Rule", + "AWS::Connect::User", + "AWS::EC2::ClientVpnTargetNetworkAssociation", + "AWS::EC2::EIPAssociation", + "AWS::EC2::IPAMResourceDiscovery", + "AWS::EC2::IPAMResourceDiscoveryAssociation", + "AWS::EC2::InstanceConnectEndpoint", + "AWS::EC2::SnapshotBlockPublicAccess", + "AWS::EC2::VPCBlockPublicAccessExclusion", + "AWS::EC2::VPCBlockPublicAccessOptions", + "AWS::EC2::VPCEndpointConnectionNotification", + "AWS::EC2::VPNConnectionRoute", + "AWS::Evidently::Segment", + "AWS::IAM::OIDCProvider", + "AWS::InspectorV2::Activation", + "AWS::MSK::ClusterPolicy", + "AWS::MSK::VpcConnection", + "AWS::MediaConnect::Gateway", + "AWS::MemoryDB::SubnetGroup", + "AWS::OpenSearchServerless::Collection", + "AWS::OpenSearchServerless::VpcEndpoint", + "AWS::Redshift::EndpointAuthorization", + "AWS::Route53Profiles::Profile", + "AWS::S3::StorageLensGroup", + "AWS::S3Express::BucketPolicy", + "AWS::S3Express::DirectoryBucket", + "AWS::SageMaker::InferenceExperiment", + "AWS::SecurityHub::Standard", + "AWS::Transfer::Profile", + "AWS::CloudFormation::StackSet", + "AWS::MediaPackageV2::Channel", + "AWS::S3::AccessGrantsLocation", + "AWS::S3::AccessGrant", + "AWS::S3::AccessGrantsInstance", + "AWS::EMRServerless::Application", + "AWS::Config::AggregationAuthorization", + "AWS::Bedrock::ApplicationInferenceProfile", + "AWS::ApiGatewayV2::Integration", + "AWS::SageMaker::MlflowTrackingServer", + "AWS::SageMaker::ModelBiasJobDefinition", + "AWS::SecretsManager::RotationSchedule", + "AWS::Deadline::QueueFleetAssociation", + "AWS::ECR::RepositoryCreationTemplate", + "AWS::CloudFormation::LambdaHook", + "AWS::EC2::SubnetNetworkAclAssociation", + "AWS::ApiGateway::UsagePlan", + "AWS::AppConfig::Extension", + "AWS::Deadline::Fleet", + "AWS::EMR::Studio", + "AWS::S3Tables::TableBucket", + "AWS::CloudFront::RealtimeLogConfig", + "AWS::BackupGateway::Hypervisor", + "AWS::BCMDataExports::Export", + "AWS::CloudFormation::GuardHook", + "AWS::CloudFront::PublicKey", + "AWS::CloudTrail::EventDataStore", + "AWS::EntityResolution::IdMappingWorkflow", + "AWS::EntityResolution::SchemaMapping", + "AWS::IoT::DomainConfiguration", + "AWS::PCAConnectorAD::DirectoryRegistration", + "AWS::RDS::Integration", + "AWS::Config::ConformancePack", + "AWS::RolesAnywhere::Profile", + "AWS::CodeArtifact::Domain", + "AWS::Backup::RestoreTestingPlan", + "AWS::Config::StoredQuery", + "AWS::SageMaker::DataQualityJobDefinition", + "AWS::SageMaker::ModelExplainabilityJobDefinition", + "AWS::SageMaker::ModelQualityJobDefinition", + "AWS::SageMaker::StudioLifecycleConfig", + "AWS::SES::DedicatedIpPool", + "AWS::SES::MailManagerTrafficPolicy", + "AWS::SSM::ResourceDataSync", + "AWS::BedrockAgentCore::Runtime", + "AWS::BedrockAgentCore::BrowserCustom", + "AWS::ElasticLoadBalancingV2::TargetGroup", + "AWS::EMRContainers::VirtualCluster", + "AWS::EntityResolution::MatchingWorkflow", + "AWS::IoTCoreDeviceAdvisor::SuiteDefinition", + "AWS::EC2::SecurityGroupVpcAssociation", + "AWS::EC2::VerifiedAccessInstance", + "AWS::KafkaConnect::CustomPlugin", + "AWS::NetworkManager::TransitGatewayPeering", + "AWS::OpenSearchServerless::SecurityConfig", + "AWS::Redshift::Integration", + "AWS::RolesAnywhere::TrustAnchor", + "AWS::Route53Profiles::ProfileAssociation", + "AWS::SSMIncidents::ResponsePlan", + "AWS::Transfer::Server", + "AWS::Glue::Database", + "AWS::Organizations::OrganizationalUnit", + "AWS::EC2::IPAMPoolCidr", + "AWS::EC2::VPCGatewayAttachment", + "AWS::Bedrock::Prompt", + "AWS::Comprehend::Flywheel", + "AWS::DataSync::Agent", + "AWS::MediaTailor::LiveSource", + "AWS::MSK::ServerlessCluster", + "AWS::IoTSiteWise::Asset", + "AWS::B2BI::Capability", + "AWS::CloudFront::KeyValueStore", + "AWS::Deadline::Monitor", + "AWS::GuardDuty::MalwareProtectionPlan", + "AWS::Location::APIKey", + "AWS::MediaPackageV2::OriginEndpoint", + "AWS::PCAConnectorAD::Connector", + "AWS::S3Tables::TableBucketPolicy", + "AWS::SecretsManager::ResourcePolicy", + "AWS::SSMContacts::Contact", + "AWS::IoT::ThingGroup", + "AWS::ImageBuilder::LifecyclePolicy", + "AWS::GameLift::Build", + "AWS::ECR::ReplicationConfiguration", + "AWS::EC2::SubnetCidrBlock", + "AWS::Connect::SecurityProfile", + "AWS::CleanRoomsML::TrainingDataset", + "AWS::AppStream::AppBlockBuilder", + "AWS::Route53::DNSSEC", + "AWS::SageMaker::UserProfile", + "AWS::ApiGateway::Method" + ] + }, + "ResourceTypeList": { + "type": "list", + "member": "ResourceType" + }, + "ResourceTypeString": { + "type": "string", + "min": 1, + "max": 196 + }, + "ResourceTypeValue": { + "type": "string", + "min": 1, + "max": 256, + "pattern": "[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}::[a-zA-Z0-9]{2,64}" + }, + "ResourceTypeValueList": { + "type": "list", + "member": "ResourceTypeValue" + }, + "ResourceTypes": { + "type": "list", + "min": 0, + "max": 20, + "member": "StringWithCharLimit256" + }, + "ResourceTypesScope": { + "type": "list", + "min": 0, + "max": 100, + "member": "StringWithCharLimit256" + }, + "ResourceValue": { + "type": "structure", + "required": [ + "Value" + ], + "members": { + "Value": "ResourceValueType" + } + }, + "ResourceValueType": { + "type": "string", + "enum": [ + "RESOURCE_ID" + ] + }, + "RetentionConfigurationName": { + "type": "string", + "min": 1, + "max": 256, + "pattern": "[\\w\\-]+" + }, + "RetentionConfigurationNameList": { + "type": "list", + "min": 0, + "max": 1, + "member": "RetentionConfigurationName" + }, + "RetentionPeriodInDays": { + "type": "integer", + "min": 30, + "max": 2557 + }, + "RuleEvaluationVisibility": { + "type": "string", + "enum": [ + "EXTERNAL", + "INTERNAL" + ] + }, + "RuleLimit": { + "type": "integer", + "min": 0, + "max": 50 + }, + "SSMDocumentName": { + "type": "string", + "pattern": "^[a-zA-Z0-9_\\-.:/]{3,200}$" + }, + "SSMDocumentVersion": { + "type": "string", + "pattern": "([$]LATEST|[$]DEFAULT|^[1-9][0-9]*$)" + }, + "SchemaVersionId": { + "type": "string", + "min": 1, + "max": 128, + "pattern": "[A-Za-z0-9-]+" + }, + "Scope": { + "type": "structure", + "members": { + "ComplianceResourceTypes": "ComplianceResourceTypes", + "TagKey": "StringWithCharLimit128", + "TagValue": "StringWithCharLimit256", + "ComplianceResourceId": "BaseResourceId", + "ServicePrincipals": "ServicePrincipals" + } + }, + "ScopeConfiguration": { + "type": "structure", + "required": [ + "scopeType", + "allRegions" + ], + "members": { + "scopeType": "ScopeType", + "scopeValues": "ScopeValues", + "allRegions": "Boolean", + "includedRegions": "IncludedRegions" + } + }, + "ScopeType": { + "type": "string", + "min": 1, + "max": 256 + }, + "ScopeValue": { + "type": "string", + "min": 1, + "max": 256 + }, + "ScopeValues": { + "type": "list", + "member": "ScopeValue" + }, + "SelectAggregateResourceConfigRequest": { + "type": "structure", + "required": [ + "Expression", + "ConfigurationAggregatorName" + ], + "members": { + "Expression": "Expression", + "ConfigurationAggregatorName": "ConfigurationAggregatorName", + "Limit": "Limit", + "MaxResults": "Limit", + "NextToken": "NextToken" + } + }, + "SelectResourceConfigRequest": { + "type": "structure", + "required": [ + "Expression" + ], + "members": { + "Expression": "Expression", + "Limit": "Limit", + "NextToken": "NextToken" + } + }, + "ServicePrincipal": { + "type": "string", + "min": 1, + "max": 128, + "pattern": "[\\w+=,.@-]+" + }, + "ServicePrincipalValue": { + "type": "string", + "min": 1, + "max": 128, + "pattern": "[\\w+=,.@-]+" + }, + "ServicePrincipalValueList": { + "type": "list", + "member": "ServicePrincipalValue" + }, + "ServicePrincipals": { + "type": "list", + "min": 0, + "max": 100, + "member": "StringWithCharLimit128" + }, + "SortBy": { + "type": "string", + "enum": [ + "SCORE" + ] + }, + "SortOrder": { + "type": "string", + "enum": [ + "ASCENDING", + "DESCENDING" + ] + }, + "Source": { + "type": "structure", + "required": [ + "Owner" + ], + "members": { + "Owner": "Owner", + "SourceIdentifier": "StringWithCharLimit256", + "SourceDetails": "SourceDetails", + "CustomPolicyDetails": "CustomPolicyDetails" + } + }, + "SourceDetail": { + "type": "structure", + "members": { + "EventSource": "EventSource", + "MessageType": "MessageType", + "MaximumExecutionFrequency": "MaximumExecutionFrequency" + } + }, + "SourceDetails": { + "type": "list", + "min": 0, + "max": 25, + "member": "SourceDetail" + }, + "SsmControls": { + "type": "structure", + "members": { + "ConcurrentExecutionRatePercentage": "Percentage", + "ErrorPercentage": "Percentage" + } + }, + "StartConfigRulesEvaluationRequest": { + "type": "structure", + "members": { + "ConfigRuleNames": "ReevaluateConfigRuleNames" + } + }, + "StartConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorderName" + ], + "members": { + "ConfigurationRecorderName": "RecorderName" + } + }, + "StartRemediationExecutionRequest": { + "type": "structure", + "required": [ + "ConfigRuleName", + "ResourceKeys" + ], + "members": { + "ConfigRuleName": "ConfigRuleName", + "ResourceKeys": "ResourceKeys" + } + }, + "StartResourceEvaluationRequest": { + "type": "structure", + "required": [ + "ResourceDetails", + "EvaluationMode" + ], + "members": { + "ResourceDetails": "ResourceDetails", + "EvaluationContext": "EvaluationContext", + "EvaluationMode": "EvaluationMode", + "EvaluationTimeout": "EvaluationTimeout", + "ClientToken": "ClientToken" + } + }, + "StaticParameterValues": { + "type": "list", + "min": 0, + "max": 25, + "member": "StringWithCharLimit256" + }, + "StaticValue": { + "type": "structure", + "required": [ + "Values" + ], + "members": { + "Values": "StaticParameterValues" + } + }, + "StatusDetailFilters": { + "type": "structure", + "members": { + "AccountId": "AccountId", + "MemberAccountRuleStatus": "MemberAccountRuleStatus" + } + }, + "StopConfigurationRecorderRequest": { + "type": "structure", + "required": [ + "ConfigurationRecorderName" + ], + "members": { + "ConfigurationRecorderName": "RecorderName" + } + }, + "StoredQuery": { + "type": "structure", + "required": [ + "QueryName" + ], + "members": { + "QueryId": "QueryId", + "QueryArn": "QueryArn", + "QueryName": "QueryName", + "Description": "QueryDescription", + "Expression": "QueryExpression" + } + }, + "String": { + "type": "string" + }, + "StringWithCharLimit1024": { + "type": "string", + "min": 1, + "max": 1024 + }, + "StringWithCharLimit128": { + "type": "string", + "min": 1, + "max": 128 + }, + "StringWithCharLimit256": { + "type": "string", + "min": 1, + "max": 256 + }, + "StringWithCharLimit256Min0": { + "type": "string", + "min": 0, + "max": 256 + }, + "StringWithCharLimit64": { + "type": "string", + "min": 1, + "max": 64 + }, + "StringWithCharLimit768": { + "type": "string", + "min": 1, + "max": 768 + }, + "Tag": { + "type": "structure", + "members": { + "Key": "TagKey", + "Value": "TagValue" + } + }, + "TagKey": { + "type": "string", + "min": 1, + "max": 128 + }, + "TagKeyList": { + "type": "list", + "min": 1, + "max": 50, + "member": "TagKey" + }, + "TagList": { + "type": "list", + "min": 1, + "max": 50, + "member": "Tag" + }, + "TagResourceRequest": { + "type": "structure", + "required": [ + "ResourceArn", + "Tags" + ], + "members": { + "ResourceArn": "AmazonResourceName", + "Tags": "TagList" + } + }, + "TagValue": { + "type": "string", + "min": 0, + "max": 256 + }, + "Tags": { + "type": "map", + "key": "Name", + "value": "Value" + }, + "TagsList": { + "type": "list", + "min": 0, + "max": 50, + "member": "Tag" + }, + "TemplateBody": { + "type": "string", + "min": 1, + "max": 51200 + }, + "TemplateS3Uri": { + "type": "string", + "min": 1, + "max": 1024, + "pattern": "s3://.*" + }, + "TemplateSSMDocumentDetails": { + "type": "structure", + "required": [ + "DocumentName" + ], + "members": { + "DocumentName": "SSMDocumentName", + "DocumentVersion": "SSMDocumentVersion" + } + }, + "ThirdPartyCloudRegion": { + "type": "string", + "min": 1, + "max": 128 + }, + "TimeWindow": { + "type": "structure", + "members": {} + }, + "UntagResourceRequest": { + "type": "structure", + "required": [ + "ResourceArn", + "TagKeys" + ], + "members": { + "ResourceArn": "AmazonResourceName", + "TagKeys": "TagKeyList" + } + }, + "Value": { + "type": "string" + } + } +} diff --git a/src/test/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisionerTest.java b/src/test/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisionerTest.java index c1c8c04176..6ba9307e3d 100644 --- a/src/test/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisionerTest.java +++ b/src/test/java/io/floci/aws/services/cloudformation/provisioners/ConfigCfnProvisionerTest.java @@ -9,6 +9,8 @@ import io.floci.aws.services.cloudformation.model.StackResource; import io.floci.aws.services.configservice.AwsConfigService; import io.floci.aws.services.configservice.model.ConfigRule; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; @@ -124,6 +126,36 @@ class ConfigCfnProvisionerTest { verifyNoInteractions(config); } + @ParameterizedTest + @ValueSource(strings = { + "{\"Source\":{}}", + "{\"Source\":{\"Owner\":\"SOMEONE\"}}", + "{\"Source\":{\"Owner\":\"CUSTOM_LAMBDA\",\"SourceDetails\":[{\"MessageType\":\"Daily\"}]}}", + "{\"Source\":{\"Owner\":\"AWS\"},\"MaximumExecutionFrequency\":\"Hourly\"}", + "{\"Source\":{\"Owner\":\"AWS\"},\"EvaluationModes\":[{\"Mode\":\"BOTH\"}]}"}) + void configRuleOutsideTheModeledConstraintsFailsBeforeCallingConfig(String props) throws Exception { + JsonNode template = mapper.readTree(props); + + AwsException failure = assertThrows(AwsException.class, + () -> provisioner.provision(resource(), template, context())); + + assertEquals("ValidationException", failure.getErrorCode()); + verifyNoInteractions(config); + } + + @Test + void configRuleViolationUsesTheConfigValidationMessage() { + ObjectNode props = mapper.createObjectNode().put("Description", "d".repeat(257)); + props.set("Source", mapper.createObjectNode().put("Owner", "AWS")); + + AwsException failure = assertThrows(AwsException.class, + () -> provisioner.provision(resource(), props, context())); + + assertEquals("Invalid parameter at 'ConfigRule.Description' failed to satisfy constraint: " + + "'Member must have length less than or equal to 256'", failure.getMessage()); + verifyNoInteractions(config); + } + @Test void scopeWithoutComplianceResourceTypesLeavesThemUnset() { ObjectNode props = mapper.createObjectNode().put("ConfigRuleName", "tagged-only"); diff --git a/src/test/java/io/floci/aws/services/configservice/AggregationAuthorizationIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/AggregationAuthorizationIntegrationTest.java index 4c724009db..0ca50be528 100644 --- a/src/test/java/io/floci/aws/services/configservice/AggregationAuthorizationIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/AggregationAuthorizationIntegrationTest.java @@ -182,11 +182,23 @@ class AggregationAuthorizationIntegrationTest { """) .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); + } + + /** DescribeAggregationAuthorizations models InvalidLimitException for a Limit out of range. */ + @Test + @Order(9) + void describeRejectsALimitAboveTheModeledMaximum() { + RestAssuredJsonUtils.awsAction("StarlingDoveService", "DescribeAggregationAuthorizations", """ + {"Limit": 101} + """) + .then() + .statusCode(400) + .body("__type", equalTo("InvalidLimitException")); } @Test - @Order(9) + @Order(10) void unrelatedActionsStillReportInvalidAction() { call("PutAggregationAuthorizations", authorizationBody()) .then() diff --git a/src/test/java/io/floci/aws/services/configservice/AwsConfigServiceAggregationAuthorizationTest.java b/src/test/java/io/floci/aws/services/configservice/AwsConfigServiceAggregationAuthorizationTest.java index ed28f7cfe0..50ee059d32 100644 --- a/src/test/java/io/floci/aws/services/configservice/AwsConfigServiceAggregationAuthorizationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/AwsConfigServiceAggregationAuthorizationTest.java @@ -245,15 +245,6 @@ class AwsConfigServiceAggregationAuthorizationTest { assertTrue(service.storedTags(arn).isEmpty(), "the deleted pack's tags survived"); } - @Test - void rejectsAnAccountIdThatIsNotTwelveDigits() { - AwsConfigService service = service(); - - AwsException ex = assertThrows(AwsException.class, - () -> service.putAggregationAuthorization(REGION, "12345", "eu-west-1", null)); - assertEquals("InvalidParameterValueException", ex.getErrorCode()); - } - @Test void rejectsAMissingAuthorizedRegion() { AwsConfigService service = service(); @@ -263,15 +254,6 @@ class AwsConfigServiceAggregationAuthorizationTest { assertEquals("InvalidParameterValueException", ex.getErrorCode()); } - @Test - void rejectsALimitAboveTheModeledMaximum() { - AwsConfigService service = service(); - - AwsException ex = assertThrows(AwsException.class, - () -> service.describeAggregationAuthorizations(REGION, 101, null)); - assertEquals("InvalidLimitException", ex.getErrorCode()); - } - @Test void describePaginatesWithNextToken() { AwsConfigService service = service(); diff --git a/src/test/java/io/floci/aws/services/configservice/ComplianceEvaluationIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/ComplianceEvaluationIntegrationTest.java index 7d6d70b957..dac2fbaba0 100644 --- a/src/test/java/io/floci/aws/services/configservice/ComplianceEvaluationIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/ComplianceEvaluationIntegrationTest.java @@ -424,7 +424,7 @@ class ComplianceEvaluationIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidResultTokenException")); + .body("__type", equalTo("ValidationException")); } @Test @@ -476,7 +476,7 @@ class ComplianceEvaluationIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } @Test diff --git a/src/test/java/io/floci/aws/services/configservice/ConfigPaginationIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/ConfigPaginationIntegrationTest.java index 0cc881c335..d27d14603d 100644 --- a/src/test/java/io/floci/aws/services/configservice/ConfigPaginationIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/ConfigPaginationIntegrationTest.java @@ -192,7 +192,7 @@ class ConfigPaginationIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } @Test diff --git a/src/test/java/io/floci/aws/services/configservice/ConfigRuleIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/ConfigRuleIntegrationTest.java index 581a6c0169..63d393aee8 100644 --- a/src/test/java/io/floci/aws/services/configservice/ConfigRuleIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/ConfigRuleIntegrationTest.java @@ -10,7 +10,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import java.util.Collections; -import java.util.List; +import java.util.Map; import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.*; @@ -284,7 +284,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("NoSuchConfigRuleException")); + .body("__type", equalTo("ValidationException")); } /** @@ -324,7 +324,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } // Nothing was stored under any of the rejected names. @@ -373,7 +373,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } StringBuilder tooManyTypes = new StringBuilder(); @@ -390,7 +390,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); given() .header("X-Amz-Target", TARGET_PREFIX + "DescribeConfigRules") @@ -423,7 +423,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } @Test @@ -439,7 +439,7 @@ class ConfigRuleIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } @Test @@ -478,19 +478,20 @@ class ConfigRuleIntegrationTest { } /** PutConfigRule's TagsList (config/2014-11-12): at most 50 tags, Key 1-128, Value 0-256, - * rejected with the operation's modelled InvalidParameterValueException and nothing stored. */ + * rejected with ValidationException and nothing stored. The model leaves Key optional, so a + * tag without one keeps the operation's modelled InvalidParameterValueException. */ @Test @Order(101) void putConfigRuleRejectsInvalidTagsWithoutCreatingTheRule() { String fiftyOne = String.join(",", Collections.nCopies(51, "{\"Key\": \"k\", \"Value\": \"v\"}")); - List invalid = List.of( - "{\"Value\": \"v\"}", - "{\"Key\": \"\", \"Value\": \"v\"}", - "{\"Key\": \"" + "k".repeat(129) + "\", \"Value\": \"v\"}", - "{\"Key\": \"k\", \"Value\": \"" + "v".repeat(257) + "\"}", - "{\"Key\": 7, \"Value\": \"v\"}", - fiftyOne); - for (String tags : invalid) { + Map invalid = Map.of( + "{\"Value\": \"v\"}", "InvalidParameterValueException", + "{\"Key\": \"\", \"Value\": \"v\"}", "ValidationException", + "{\"Key\": \"" + "k".repeat(129) + "\", \"Value\": \"v\"}", "ValidationException", + "{\"Key\": \"k\", \"Value\": \"" + "v".repeat(257) + "\"}", "ValidationException", + "{\"Key\": 7, \"Value\": \"v\"}", "ValidationException", + fiftyOne, "ValidationException"); + invalid.forEach((tags, errorCode) -> post("PutConfigRule", """ { "ConfigRule": { @@ -501,8 +502,7 @@ class ConfigRuleIntegrationTest { } """.formatted(tags)) .then().statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); - } + .body("__type", equalTo(errorCode))); post("DescribeConfigRules", "{\"ConfigRuleNames\": [\"rule-bad-tags\"]}") .then().statusCode(400) .body("__type", equalTo("NoSuchConfigRuleException")); @@ -531,7 +531,7 @@ class ConfigRuleIntegrationTest { post("DeleteConfigRule", "{\"ConfigRuleName\": \"rule-keyonly-tag\"}").then().statusCode(200); } - /** PutAggregationAuthorization takes the same TagsList and models the same error. */ + /** PutAggregationAuthorization takes the same TagsList. */ @Test @Order(103) void putAggregationAuthorizationRejectsAnInvalidTag() { @@ -540,7 +540,7 @@ class ConfigRuleIntegrationTest { "Tags": [{"Key": "", "Value": "v"}]} """) .then().statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); post("DescribeAggregationAuthorizations", "{}") .then().statusCode(200) .body("AggregationAuthorizations.AuthorizedAccountId", not(hasItem("444455556666"))); diff --git a/src/test/java/io/floci/aws/services/configservice/ConfigTaggingIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/ConfigTaggingIntegrationTest.java index f982fb449d..144ffb3c77 100644 --- a/src/test/java/io/floci/aws/services/configservice/ConfigTaggingIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/ConfigTaggingIntegrationTest.java @@ -8,6 +8,8 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import java.util.Map; + import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.*; @@ -146,6 +148,53 @@ class ConfigTaggingIntegrationTest { .body("__type", equalTo("ResourceNotFoundException")); } + /** ResourceArn is an AmazonResourceName, 1-1000 characters, on all three tag operations. */ + @Test + @Order(6) + void aResourceArnOutsideItsModeledLengthIsAValidationException() { + Map requests = Map.of( + "TagResource", "{\"ResourceArn\": \"%s\", \"Tags\": [{\"Key\": \"k\", \"Value\": \"v\"}]}", + "UntagResource", "{\"ResourceArn\": \"%s\", \"TagKeys\": [\"k\"]}", + "ListTagsForResource", "{\"ResourceArn\": \"%s\"}"); + requests.forEach((action, body) -> { + RestAssuredJsonUtils.awsAction("StarlingDoveService", action, body.formatted("")) + .then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", equalTo("Invalid parameter at 'ResourceArn' failed to satisfy constraint: " + + "'Member must have length greater than or equal to 1'")); + RestAssuredJsonUtils.awsAction("StarlingDoveService", action, body.formatted("a".repeat(1001))) + .then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", equalTo("Invalid parameter at 'ResourceArn' failed to satisfy constraint: " + + "'Member must have length less than or equal to 1000'")); + }); + } + + /** A missing required member and a member of the wrong JSON type fail before the operation runs; + * ListTagsForResource models InvalidLimitException for a Limit out of range. */ + @Test + @Order(7) + void requestsOutsideTheModeledShapesFailBeforeTheOperationRuns() { + String arn = getConfigRuleArn("tag-test-rule"); + RestAssuredJsonUtils.awsAction("StarlingDoveService", "UntagResource", """ + {"ResourceArn": "%s"} + """.formatted(arn)) + .then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", equalTo("Invalid parameter at 'TagKeys' failed to satisfy constraint: " + + "'Member must not be null'")); + RestAssuredJsonUtils.awsAction("StarlingDoveService", "TagResource", """ + {"ResourceArn": "%s", "Tags": {"Key": "k", "Value": "v"}} + """.formatted(arn)) + .then().statusCode(400) + .body("__type", equalTo("ValidationException")); + RestAssuredJsonUtils.awsAction("StarlingDoveService", "ListTagsForResource", """ + {"ResourceArn": "%s", "Limit": 101} + """.formatted(arn)) + .then().statusCode(400) + .body("__type", equalTo("InvalidLimitException")); + } + private String getConfigRuleArn(String ruleName) { return given() .header("X-Amz-Target", TARGET_PREFIX + "DescribeConfigRules") diff --git a/src/test/java/io/floci/aws/services/configservice/ConfigurationRecorderIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/ConfigurationRecorderIntegrationTest.java index efd15c7bf8..c938106dab 100644 --- a/src/test/java/io/floci/aws/services/configservice/ConfigurationRecorderIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/ConfigurationRecorderIntegrationTest.java @@ -8,6 +8,8 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import java.util.List; + import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.*; @@ -432,8 +434,7 @@ class ConfigurationRecorderIntegrationTest { .body("ConfigurationRecorders[0]", not(hasKey("recordingMode"))); } - /** PutConfigurationRecorder's Tags is a TagsList, and the operation models ValidationException, - * not the InvalidParameterValueException PutConfigRule answers. */ + /** PutConfigurationRecorder's Tags is a TagsList, and the operation models ValidationException. */ @Test @Order(19) void putConfigurationRecorderRejectsAnInvalidTagWithoutStoringIt() { @@ -592,4 +593,22 @@ class ConfigurationRecorderIntegrationTest { .then().statusCode(400) .body("__type", equalTo("NoSuchConfigurationRecorderException")); } + + /** Arn is an AmazonResourceName, 1-1000 characters, on both Describe calls. */ + @Test + @Order(23) + void anArnOutsideItsModeledLengthIsAValidationException() { + for (String action : List.of("DescribeConfigurationRecorders", "DescribeConfigurationRecorderStatus")) { + RestAssuredJsonUtils.awsAction("StarlingDoveService", action, "{\"Arn\": \"\"}") + .then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", equalTo("Invalid parameter at 'Arn' failed to satisfy constraint: " + + "'Member must have length greater than or equal to 1'")); + RestAssuredJsonUtils.awsAction("StarlingDoveService", action, "{\"Arn\": \"" + "a".repeat(1001) + "\"}") + .then().statusCode(400) + .body("__type", equalTo("ValidationException")) + .body("message", equalTo("Invalid parameter at 'Arn' failed to satisfy constraint: " + + "'Member must have length less than or equal to 1000'")); + } + } } diff --git a/src/test/java/io/floci/aws/services/configservice/DescribeConfigRulesLimitTest.java b/src/test/java/io/floci/aws/services/configservice/DescribeConfigRulesLimitTest.java index 6dee8e125b..6df1beb43a 100644 --- a/src/test/java/io/floci/aws/services/configservice/DescribeConfigRulesLimitTest.java +++ b/src/test/java/io/floci/aws/services/configservice/DescribeConfigRulesLimitTest.java @@ -1,20 +1,19 @@ package io.floci.aws.services.configservice; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; import io.floci.aws.core.common.AwsException; import io.floci.aws.core.common.RegionResolver; import org.junit.jupiter.api.Test; -import java.util.ArrayList; -import java.util.List; - import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; /** * DescribeConfigRules' ConfigRuleNames member is modeled with {@code Maximum 25 items} - * (confirmed against botocore's config service-2.json). Every other array-size limit this - * PR touches (Scope.ComplianceResourceTypes, PutEvaluations, PutRetentionConfiguration's - * day range) is enforced; this one was not. + * (confirmed against botocore's config service-2.json), which ConfigRequestShapes checks + * before the handler reads the names. */ class DescribeConfigRulesLimitTest { @@ -22,14 +21,17 @@ class DescribeConfigRulesLimitTest { @Test void rejectsMoreThanTwentyFiveRuleNames() { - AwsConfigService service = new AwsConfigService(new RegionResolver(REGION, "000000000000"), null); - List tooMany = new ArrayList<>(); + ObjectMapper mapper = new ObjectMapper(); + ConfigServiceJsonHandler handler = new ConfigServiceJsonHandler( + new AwsConfigService(new RegionResolver(REGION, "000000000000"), null), mapper); + ObjectNode request = mapper.createObjectNode(); + ArrayNode tooMany = request.putArray("ConfigRuleNames"); for (int i = 0; i < 26; i++) { tooMany.add("rule-" + i); } AwsException ex = assertThrows(AwsException.class, - () -> service.describeConfigRules(REGION, tooMany)); - assertEquals("InvalidParameterValueException", ex.getErrorCode()); + () -> handler.handle("DescribeConfigRules", request, REGION)); + assertEquals("ValidationException", ex.getErrorCode()); } } diff --git a/src/test/java/io/floci/aws/services/configservice/RetentionConfigurationIntegrationTest.java b/src/test/java/io/floci/aws/services/configservice/RetentionConfigurationIntegrationTest.java index d26a5b83a3..fc46e0fe92 100644 --- a/src/test/java/io/floci/aws/services/configservice/RetentionConfigurationIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/configservice/RetentionConfigurationIntegrationTest.java @@ -69,7 +69,7 @@ class RetentionConfigurationIntegrationTest { .post("/") .then() .statusCode(400) - .body("__type", equalTo("InvalidParameterValueException")); + .body("__type", equalTo("ValidationException")); } @Test diff --git a/tools/aws/regen_config_shapes.py b/tools/aws/regen_config_shapes.py new file mode 100644 index 0000000000..7b7c93b767 --- /dev/null +++ b/tools/aws/regen_config_shapes.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Vendor every AWS Config operation's request constraints for RequestConstraintCheck.""" +from __future__ import annotations + +from pathlib import Path + +import request_shapes + +MODEL = Path("config/2014-11-12") +OUTPUT = request_shapes.REPO_ROOT / "src/main/resources/aws/config-request-shapes.json" + + +def main(argv: list[str] | None = None) -> int: + return request_shapes.main(argv, script=__file__, model=MODEL, output=OUTPUT, + description=__doc__, constraints=True, + prepare=request_shapes.drop_blob_and_timestamp_members) + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tools/aws/regen_kinesis_shapes.py b/tools/aws/regen_kinesis_shapes.py index e512c031b6..2a496f435f 100644 --- a/tools/aws/regen_kinesis_shapes.py +++ b/tools/aws/regen_kinesis_shapes.py @@ -10,22 +10,10 @@ MODEL = Path("kinesis/2013-12-02") OUTPUT = request_shapes.REPO_ROOT / "src/main/resources/aws/kinesis-request-shapes.json" -def prepare(model: dict) -> dict: - # The shared checker does not parse blob or timestamp wire types. Keep their required - # markers while leaving present values to the existing handlers (including PutRecords' - # per-record error path for malformed Data). - for shape in model["shapes"].values(): - if shape["type"] != "structure": - continue - for member, spec in list(shape.get("members", {}).items()): - if model["shapes"][spec["shape"]]["type"] in {"blob", "timestamp"}: - del shape["members"][member] - return model - - def main(argv: list[str] | None = None) -> int: return request_shapes.main(argv, script=__file__, model=MODEL, output=OUTPUT, - description=__doc__, constraints=True, prepare=prepare) + description=__doc__, constraints=True, + prepare=request_shapes.drop_blob_and_timestamp_members) if __name__ == "__main__": diff --git a/tools/aws/request_shapes.py b/tools/aws/request_shapes.py index a056fa2811..cbd61eb625 100644 --- a/tools/aws/request_shapes.py +++ b/tools/aws/request_shapes.py @@ -141,6 +141,21 @@ def widen_partition_and_region(model: dict) -> dict: return model +def drop_blob_and_timestamp_members(model: dict) -> dict: + """The model, with every structure member whose shape is a blob or a timestamp dropped. + + `RequestConstraintCheck` parses neither wire type, so a present value is left to the service's + handler. The structure still lists a dropped member as required, so a request without it is refused. + """ + for shape in model["shapes"].values(): + if shape["type"] != "structure": + continue + for member, spec in list(shape.get("members", {}).items()): + if model["shapes"][spec["shape"]]["type"] in {"blob", "timestamp"}: + del shape["members"][member] + return model + + def render(doc: dict) -> str: return json.dumps(doc, indent=2, sort_keys=False) + "\n" diff --git a/tools/aws/test_request_shapes.py b/tools/aws/test_request_shapes.py index 39ee213a65..d596efde6d 100644 --- a/tools/aws/test_request_shapes.py +++ b/tools/aws/test_request_shapes.py @@ -30,6 +30,7 @@ import regen_eks_shapes import regen_emr_serverless_shapes import regen_iam_shapes import regen_cloudfront_keyvaluestore_shapes +import regen_config_shapes import regen_kinesis_shapes import regen_lambda_microvm_shapes import regen_organizations_shapes @@ -269,6 +270,7 @@ CONSTRAINED_MODEL = { @pytest.mark.parametrize("script, model_path", [ (regen_athena_shapes, "athena/2017-05-18"), + (regen_config_shapes, "config/2014-11-12"), (regen_kinesis_shapes, "kinesis/2013-12-02"), (regen_rekognition_shapes, "rekognition/2016-06-27"), ]) @@ -449,6 +451,7 @@ def vendored(script) -> tuple[str, ...]: regen_resource_groups_shapes, regen_sts_shapes, regen_securityhub_shapes, regen_kinesis_shapes, + regen_config_shapes, regen_rekognition_shapes, regen_athena_shapes, regen_cur_shapes, @@ -569,6 +572,18 @@ def test_kinesis_shapes_keep_tag_bounds_and_leave_wire_types_to_handlers(): assert "Timestamp" not in shapes["GetShardIteratorInput"]["members"] +def test_config_shapes_keep_arn_bounds_and_leave_timestamps_to_handlers(): + doc = json.loads(regen_config_shapes.OUTPUT.read_text(encoding="utf-8")) + shapes = doc["shapes"] + + assert shapes["DescribeConfigurationRecordersRequest"]["members"]["Arn"] == "AmazonResourceName" + assert shapes["ListTagsForResourceRequest"]["members"]["ResourceArn"] == "AmazonResourceName" + assert shapes["AmazonResourceName"]["min"] == 1 + assert shapes["AmazonResourceName"]["max"] == 1000 + assert "OrderingTimestamp" not in shapes["Evaluation"]["members"] + assert "OrderingTimestamp" in shapes["Evaluation"]["required"] + + def test_securityhub_shapes_keep_required_findings_and_resource_strings(): doc = json.loads(regen_securityhub_shapes.OUTPUT.read_text(encoding="utf-8")) shapes = doc["shapes"]