mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
fix(controltower): generate IAM routes and request resources (#7872)
This commit is contained in:
1 parent
c2aba45553
commit
ef1e00fba7
21 files changed
+916
-104
No files matched your search
@@ -25,6 +25,10 @@ Enabled-baseline operations are recorded with AWS operation names such as `ENABL
|
||||
|
||||
`TagResource`, `UntagResource` and `ListTagsForResource` serve landing zones and enabled controls in the caller's account and Region; an ARN naming another account or Region returns `ResourceNotFoundException`. A landing zone keeps the tags passed to `CreateLandingZone`, and an enabled control those passed to `EnableControl`. Enabled baselines don't store tags yet, so a tag request for one returns `ResourceNotFoundException`, where AWS would answer.
|
||||
|
||||
## IAM authorization
|
||||
|
||||
With IAM enforcement enabled, Control Tower uses generated SDK routes and request-resource definitions. Landing-zone reads and mutations authorize the ARN or ID supplied by the request. Enabled-baseline and enabled-control identifiers name their full ARNs; enabling a control authorizes the new enabled-control resource with its generated ID left open. List and other resource-less actions require wildcard resource grants. Tag requests authorize the resource ARN on the shared tag route before changing tags. This does not add unsupported operations or enabled-baseline tag storage.
|
||||
|
||||
## Supported operations
|
||||
|
||||
| Operation | Method and path | Behavior |
|
||||
|
||||
@@ -444,6 +444,12 @@
|
||||
<version>${aws.sdk.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>controltower</artifactId>
|
||||
<version>${aws.sdk.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
<artifactId>organizations</artifactId>
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.floci.aws.core.common;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import io.floci.aws.services.iam.IamActionRegistry;
|
||||
import jakarta.ws.rs.container.ContainerRequestContext;
|
||||
import jakarta.ws.rs.core.MultivaluedMap;
|
||||
|
||||
@@ -262,7 +263,7 @@ public final class RequestResources {
|
||||
*/
|
||||
private static JsonNode located(RequestResourceMembers.Table table, String operation, JsonNode body,
|
||||
ContainerRequestContext ctx, Map<String, String> labels) {
|
||||
Map<String, String> located = table.located().getOrDefault(operation, Map.of());
|
||||
Map<String, String> located = locatedMembers(table, operation, ctx);
|
||||
if (located.isEmpty()) {
|
||||
return body;
|
||||
}
|
||||
@@ -281,7 +282,7 @@ public final class RequestResources {
|
||||
private static Map<String, String> located(RequestResourceMembers.Table table, String operation,
|
||||
Map<String, String> form, ContainerRequestContext ctx,
|
||||
Map<String, String> labels) {
|
||||
Map<String, String> located = table.located().getOrDefault(operation, Map.of());
|
||||
Map<String, String> located = locatedMembers(table, operation, ctx);
|
||||
if (form.isEmpty() || located.isEmpty()) {
|
||||
return form;
|
||||
}
|
||||
@@ -291,6 +292,24 @@ public final class RequestResources {
|
||||
return overlaid;
|
||||
}
|
||||
|
||||
private static Map<String, String> locatedMembers(RequestResourceMembers.Table table, String operation,
|
||||
ContainerRequestContext ctx) {
|
||||
Map<String, String> located = table.located().getOrDefault(operation, Map.of());
|
||||
Map<String, String> alternatives = IamActionRegistry.routeMemberLocations(operation, ctx);
|
||||
if (alternatives.isEmpty()) {
|
||||
return located;
|
||||
}
|
||||
Map<String, String> merged = new HashMap<>(located);
|
||||
alternatives.forEach((member, source) -> {
|
||||
if ("body".equals(source)) {
|
||||
merged.remove(member);
|
||||
} else {
|
||||
merged.put(member, source);
|
||||
}
|
||||
});
|
||||
return merged;
|
||||
}
|
||||
|
||||
/**
|
||||
* The value the request gives each member the table locates, by the member's name: a path label's from
|
||||
* {@code labels}, a query parameter's first value; none for one the request does not give.
|
||||
@@ -469,7 +488,8 @@ public final class RequestResources {
|
||||
RequestResourceMembers.ArnFormat named = arnOf(resource, variable.getValue().path(), formats);
|
||||
if (resource.fill().size() == 1 && fromRequest == null) {
|
||||
List<String> asArns = values.stream()
|
||||
.filter(value -> !isArnOf(named, value) && format.pattern().matcher(value).matches()).toList();
|
||||
.filter(value -> !isArnOf(named, value)
|
||||
&& format.pattern().matcher(value).matches()).toList();
|
||||
asArns.forEach(value -> addNamed(arns, format.checked(value), format.awsOwned(), partition, region,
|
||||
accountId));
|
||||
values = values.stream().filter(value -> !asArns.contains(value)).toList();
|
||||
|
||||
@@ -434,11 +434,6 @@ public class IamActionRegistry {
|
||||
rule("eks", "POST", "^/tags(/.+)?$", "eks:TagResource"),
|
||||
rule("eks", "DELETE", "^/tags(/.+)?$", "eks:UntagResource"),
|
||||
|
||||
// ── Control Tower ──────────────────────────────────────────────────────
|
||||
rule("controltower", "GET", "^/tags(/.+)?$", "controltower:ListTagsForResource"),
|
||||
rule("controltower", "POST", "^/tags(/.+)?$", "controltower:TagResource"),
|
||||
rule("controltower", "DELETE", "^/tags(/.+)?$", "controltower:UntagResource"),
|
||||
|
||||
// ── Bedrock ────────────────────────────────────────────────────────────
|
||||
rule("bedrock", "POST", "^/resource-policy$", "bedrock:PutResourcePolicy"),
|
||||
rule("bedrock", "GET", "^/resource-policy/.+", "bedrock:GetResourcePolicy"),
|
||||
@@ -763,6 +758,19 @@ public class IamActionRegistry {
|
||||
.map(IamRestRoutes.Match::labels).orElse(Map.of());
|
||||
}
|
||||
|
||||
/** Member locations of a generated alternative route; absent entries keep the operation's model locations. */
|
||||
public static Map<String, String> routeMemberLocations(String operation, ContainerRequestContext ctx) {
|
||||
int separator = operation.indexOf(':');
|
||||
if (separator < 0 || ctx.getMethod() == null || ctx.getUriInfo() == null
|
||||
|| ctx.getUriInfo().getRequestUri() == null) {
|
||||
return Map.of();
|
||||
}
|
||||
return IamRestRoutes.vendored().match(operation.substring(0, separator), ctx.getMethod().toUpperCase(),
|
||||
routedPath(ctx), ctx.getUriInfo().getQueryParameters())
|
||||
.filter(match -> match.operation().equals(operation.substring(separator + 1)))
|
||||
.map(IamRestRoutes.Match::located).orElse(Map.of());
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a request of the operation is checked on the resources AWS checks its action on: those its request
|
||||
* names, which the vendored request resources read for the operation ({@link RequestResources#reads}) or
|
||||
|
||||
@@ -54,15 +54,16 @@ final class IamRestRoutes {
|
||||
private static final int ONE_SEGMENT = 1;
|
||||
private static final int REST_OF_PATH = 0;
|
||||
|
||||
/** A route a request matched: its operation, and the value its path gives each of the route's labels, decoded. */
|
||||
record Match(String operation, Map<String, String> labels) {
|
||||
/** A matched operation, decoded path labels, and generated alternative member locations. */
|
||||
record Match(String operation, Map<String, String> labels, Map<String, String> located) {
|
||||
}
|
||||
|
||||
/**
|
||||
* A route: its operation, its path as a pattern capturing each label in turn, the labels' names, each segment's
|
||||
* rank, and the query it names.
|
||||
*/
|
||||
private record Route(String operation, Pattern path, List<String> labels, int[] ranks, Map<String, String> query) {
|
||||
private record Route(String operation, Pattern path, List<String> labels, int[] ranks, Map<String, String> query,
|
||||
Map<String, String> located) {
|
||||
|
||||
boolean matches(String requestPath, MultivaluedMap<String, String> parameters) {
|
||||
if (!path.matcher(requestPath).matches()) {
|
||||
@@ -134,7 +135,7 @@ final class IamRestRoutes {
|
||||
best = route;
|
||||
}
|
||||
}
|
||||
return best == null ? Optional.empty() : Optional.of(new Match(best.operation(), best.labelValues(requestPath)));
|
||||
return best == null ? Optional.empty() : Optional.of(new Match(best.operation(), best.labelValues(requestPath), best.located()));
|
||||
}
|
||||
|
||||
/** The modelled denial status, or the existing protocol default when the model declares none. */
|
||||
@@ -188,7 +189,31 @@ final class IamRestRoutes {
|
||||
}
|
||||
routes.computeIfAbsent(scope, ignored -> new HashMap<>())
|
||||
.computeIfAbsent(method, ignored -> new ArrayList<>())
|
||||
.add(route(operation.getKey(), requestUri));
|
||||
.add(route(operation.getKey(), requestUri, Map.of()));
|
||||
JsonNode alternatives = operation.getValue().path("alternatives");
|
||||
if (!alternatives.isMissingNode() && !alternatives.isArray()) {
|
||||
throw new IllegalStateException(RESOURCE_NAME + " gives " + operation.getKey()
|
||||
+ " invalid alternative routes");
|
||||
}
|
||||
alternatives.forEach(alternative -> {
|
||||
String uri = alternative.path("requestUri").asText("");
|
||||
JsonNode members = alternative.path("located");
|
||||
if (!uri.startsWith("/") || !members.isObject()) {
|
||||
throw new IllegalStateException(RESOURCE_NAME + " gives " + operation.getKey()
|
||||
+ " an invalid alternative route");
|
||||
}
|
||||
Map<String, String> located = new HashMap<>();
|
||||
members.properties().forEach(member -> {
|
||||
String source = member.getValue().asText("");
|
||||
if (!member.getValue().isTextual() || member.getKey().isEmpty()
|
||||
|| !("body".equals(source) || source.startsWith("?") && source.length() > 1)) {
|
||||
throw new IllegalStateException(RESOURCE_NAME + " gives " + operation.getKey()
|
||||
+ " an invalid alternative member location");
|
||||
}
|
||||
located.put(member.getKey(), source);
|
||||
});
|
||||
routes.get(scope).get(method).add(route(operation.getKey(), uri, Map.copyOf(located)));
|
||||
});
|
||||
});
|
||||
});
|
||||
Map<String, Map<String, List<Route>>> copied = new HashMap<>();
|
||||
@@ -201,7 +226,7 @@ final class IamRestRoutes {
|
||||
}
|
||||
|
||||
/** A route of the operation from its request URI, its path's segments and the query after its {@code ?}. */
|
||||
private static Route route(String operation, String requestUri) {
|
||||
private static Route route(String operation, String requestUri, Map<String, String> located) {
|
||||
int question = requestUri.indexOf('?');
|
||||
String path = IamActionRegistry.withoutTrailingSlash(question < 0 ? requestUri : requestUri.substring(0, question));
|
||||
List<String> segments = path.equals("/") ? List.of() : List.of(path.substring(1).split("/", -1));
|
||||
@@ -238,6 +263,6 @@ final class IamRestRoutes {
|
||||
}
|
||||
}
|
||||
return new Route(operation, Pattern.compile(pattern.isEmpty() ? "/" : pattern.toString()), List.copyOf(labels),
|
||||
ranks, Map.copyOf(query));
|
||||
ranks, Map.copyOf(query), located);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"_source": {
|
||||
"generator": "tools/aws/regen_iam_authorized_actions.py",
|
||||
"reference": "https://servicereference.us-east-1.amazonaws.com/",
|
||||
"retrieved": "2026-11-08",
|
||||
"retrieved": "2026-11-10",
|
||||
"note": "make iam-authorized-actions-verify checks every entry against AWS."
|
||||
},
|
||||
"authorizedActions": {
|
||||
@@ -343,6 +343,56 @@
|
||||
"StartPolicyGeneration",
|
||||
"ValidatePolicy"
|
||||
],
|
||||
"controltower": [
|
||||
"CreateLandingZone",
|
||||
"CreateManagedAccount",
|
||||
"DeregisterManagedAccount",
|
||||
"DeregisterOrganizationalUnit",
|
||||
"DescribeAccountFactoryConfig",
|
||||
"DescribeCoreService",
|
||||
"DescribeGuardrail",
|
||||
"DescribeGuardrailForTarget",
|
||||
"DescribeLandingZoneConfiguration",
|
||||
"DescribeManagedAccount",
|
||||
"DescribeManagedOrganizationalUnit",
|
||||
"DescribeRegisterOrganizationalUnitOperation",
|
||||
"DescribeSingleSignOn",
|
||||
"DisableGuardrail",
|
||||
"EnableBaseline",
|
||||
"EnableGuardrail",
|
||||
"GetAccountInfo",
|
||||
"GetAvailableUpdates",
|
||||
"GetBaselineOperation",
|
||||
"GetControlOperation",
|
||||
"GetGuardrailComplianceStatus",
|
||||
"GetHomeRegion",
|
||||
"GetLandingZoneDriftStatus",
|
||||
"GetLandingZoneOperation",
|
||||
"GetLandingZoneStatus",
|
||||
"ListBaselines",
|
||||
"ListControlOperations",
|
||||
"ListDirectoryGroups",
|
||||
"ListDriftDetails",
|
||||
"ListEnabledBaselines",
|
||||
"ListEnabledControls",
|
||||
"ListEnabledGuardrails",
|
||||
"ListExtendGovernancePrecheckDetails",
|
||||
"ListExternalConfigRuleCompliance",
|
||||
"ListGuardrailViolations",
|
||||
"ListGuardrails",
|
||||
"ListGuardrailsForTarget",
|
||||
"ListLandingZoneOperations",
|
||||
"ListLandingZones",
|
||||
"ListManagedAccounts",
|
||||
"ListManagedAccountsForGuardrail",
|
||||
"ListManagedAccountsForParent",
|
||||
"ListManagedOrganizationalUnits",
|
||||
"ListManagedOrganizationalUnitsForGuardrail",
|
||||
"ManageOrganizationalUnit",
|
||||
"PerformPreLaunchChecks",
|
||||
"SetupLandingZone",
|
||||
"UpdateAccountFactoryConfig"
|
||||
],
|
||||
"dsql": [
|
||||
"InjectError",
|
||||
"ListClusters"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-09", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "rekognition": ["rekognition"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"]},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "rekognition": ["rekognition"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"]},
|
||||
"clientsNotRead": {"kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and name their resources by other members"},
|
||||
"handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts"],
|
||||
"notCovered": {"account": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "controltower": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not Line truncated
|
||||
"notCovered": {"account": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its Line truncated
|
||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudfront-keyvaluestore", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "emr-containers", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web", "xray"],
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Region}:${Account}:trail/${TrailName}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "cur": {"cur": "arn:${Partition}:cur:${Region}:${Account}:definition/${ReportName}"}, "datasync": {"agent": "arn:${Partition}:datasync:${Region}:${Account}:agent/${AgentId}", "discoveryjob": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}/job/${DiscoveryJobId}", "location": "arn:${Partition}:datasync:${Region}:${Account}:location/${LocationId}", "storagesystem": "arn:${Partition}:datasync:${Region}:${Account}:system/${StorageSystemId}", "task": "arn:${Partition}:datasync:${Region}:${Account}:task/${TaskId}", "taskexecution": "arn:${Partition}:datasLine truncated
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Region}:${Account}:trail/${TrailName}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "controltower": {"Baseline": "arn:${Partition}:controltower:${Region}::baseline/${BaselineId}", "EnabledBaseline": "arn:${Partition}:controltower:${Region}:${Account}:enabledbaseline/${EnabledBaselineId}", "EnabledControl": "arn:${Partition}:controltower:${Region}:${Account}:enabledcontrol/${EnabledControlId}", "LandingZone": "arn:${Partition}:controltower:${Region}:${Account}:landingzone/${LandingZoneId}"}, "cur": {"cur": "arn:${Partition}:cur:${Region}:${Account}:definition/${ReportName}"}, "datasync": {"agent": "arn:${Partition}:datasync:${Region}:${Account}:agent/${AgenLine truncated
|
||||
"unqualified": {"states": ["statemachine"]},
|
||||
"mintedIds": {"events": ["api-destination", "connection"]},
|
||||
"operations": {
|
||||
@@ -616,6 +616,34 @@
|
||||
"cognito-idp:UpdateUserPoolReplica": {"action": "cognito-idp:UpdateUserPoolReplica", "types": ["userpool"], "resources": [{"type": "userpool", "fill": {"UserPoolId": "UserPoolId"}}]},
|
||||
"cognito-idp:VerifySoftwareToken": {"action": "cognito-idp:VerifySoftwareToken", "types": [], "resources": []},
|
||||
"cognito-idp:VerifyUserAttribute": {"action": "cognito-idp:VerifyUserAttribute", "types": [], "resources": []},
|
||||
"controltower:CreateLandingZone": {"action": "controltower:CreateLandingZone", "types": [], "resources": []},
|
||||
"controltower:DeleteLandingZone": {"action": "controltower:DeleteLandingZone", "types": ["LandingZone"], "resources": [{"type": "LandingZone", "fill": {"LandingZoneId": "landingZoneIdentifier"}}]},
|
||||
"controltower:DisableBaseline": {"action": "controltower:DisableBaseline", "types": ["EnabledBaseline"], "resources": [{"types": ["EnabledBaseline"], "arn": "enabledBaselineIdentifier"}]},
|
||||
"controltower:DisableControl": {"action": "controltower:DisableControl", "types": ["EnabledControl"], "resources": [{"types": ["EnabledControl"], "arn": "controlIdentifier"}, {"types": ["EnabledControl"], "arn": "enabledControlIdentifier"}, {"types": ["EnabledControl"], "arn": "targetIdentifier"}]},
|
||||
"controltower:EnableBaseline": {"action": "controltower:EnableBaseline", "types": [], "resources": []},
|
||||
"controltower:EnableControl": {"action": "controltower:EnableControl", "types": ["EnabledControl"], "resources": [{"types": ["EnabledControl"], "arn": "controlIdentifier"}, {"types": ["EnabledControl"], "arn": "targetIdentifier"}, {"type": "EnabledControl", "fill": {}}]},
|
||||
"controltower:GetBaseline": {"action": "controltower:GetBaseline", "types": ["Baseline"], "resources": [{"types": ["Baseline"], "arn": "baselineIdentifier"}]},
|
||||
"controltower:GetBaselineOperation": {"action": "controltower:GetBaselineOperation", "types": [], "resources": []},
|
||||
"controltower:GetControlOperation": {"action": "controltower:GetControlOperation", "types": [], "resources": []},
|
||||
"controltower:GetEnabledBaseline": {"action": "controltower:GetEnabledBaseline", "types": ["EnabledBaseline"], "resources": [{"types": ["EnabledBaseline"], "arn": "enabledBaselineIdentifier"}]},
|
||||
"controltower:GetEnabledControl": {"action": "controltower:GetEnabledControl", "types": ["EnabledControl"], "resources": [{"types": ["EnabledControl"], "arn": "enabledControlIdentifier"}]},
|
||||
"controltower:GetLandingZone": {"action": "controltower:GetLandingZone", "types": ["LandingZone"], "resources": [{"type": "LandingZone", "fill": {"LandingZoneId": "landingZoneIdentifier"}}]},
|
||||
"controltower:GetLandingZoneOperation": {"action": "controltower:GetLandingZoneOperation", "types": [], "resources": []},
|
||||
"controltower:ListBaselines": {"action": "controltower:ListBaselines", "types": [], "resources": []},
|
||||
"controltower:ListControlOperations": {"action": "controltower:ListControlOperations", "types": [], "resources": []},
|
||||
"controltower:ListEnabledBaselines": {"action": "controltower:ListEnabledBaselines", "types": [], "resources": []},
|
||||
"controltower:ListEnabledControls": {"action": "controltower:ListEnabledControls", "types": [], "resources": []},
|
||||
"controltower:ListLandingZoneOperations": {"action": "controltower:ListLandingZoneOperations", "types": [], "resources": []},
|
||||
"controltower:ListLandingZones": {"action": "controltower:ListLandingZones", "types": [], "resources": []},
|
||||
"controltower:ListTagsForResource": {"action": "controltower:ListTagsForResource", "types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "resources": [{"types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"controltower:ResetEnabledBaseline": {"action": "controltower:ResetEnabledBaseline", "types": ["EnabledBaseline"], "resources": [{"types": ["EnabledBaseline"], "arn": "enabledBaselineIdentifier"}]},
|
||||
"controltower:ResetEnabledControl": {"action": "controltower:ResetEnabledControl", "types": ["EnabledControl"], "resources": [{"types": ["EnabledControl"], "arn": "enabledControlIdentifier"}]},
|
||||
"controltower:ResetLandingZone": {"action": "controltower:ResetLandingZone", "types": ["LandingZone"], "resources": [{"type": "LandingZone", "fill": {"LandingZoneId": "landingZoneIdentifier"}}]},
|
||||
"controltower:TagResource": {"action": "controltower:TagResource", "types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "resources": [{"types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"controltower:UntagResource": {"action": "controltower:UntagResource", "types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "resources": [{"types": ["EnabledBaseline", "EnabledControl", "LandingZone"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
|
||||
"controltower:UpdateEnabledBaseline": {"action": "controltower:UpdateEnabledBaseline", "types": ["EnabledBaseline"], "resources": [{"types": ["EnabledBaseline"], "arn": "enabledBaselineIdentifier"}]},
|
||||
"controltower:UpdateEnabledControl": {"action": "controltower:UpdateEnabledControl", "types": ["EnabledControl"], "resources": [{"types": ["EnabledControl"], "arn": "enabledControlIdentifier"}]},
|
||||
"controltower:UpdateLandingZone": {"action": "controltower:UpdateLandingZone", "types": ["LandingZone"], "resources": [{"type": "LandingZone", "fill": {"LandingZoneId": "landingZoneIdentifier"}}]},
|
||||
"cur:DeleteReportDefinition": {"action": "cur:DeleteReportDefinition", "types": ["cur"], "resources": [{"type": "cur", "fill": {"ReportName": "ReportName"}}]},
|
||||
"cur:DescribeReportDefinitions": {"action": "cur:DescribeReportDefinitions", "types": [], "resources": []},
|
||||
"cur:ListTagsForResource": {"action": "cur:ListTagsForResource", "types": ["cur"], "resources": [{"type": "cur", "fill": {"ReportName": "ReportName"}}]},
|
||||
@@ -747,7 +775,7 @@
|
||||
"ec2:CreateCapacityReservation": {"action": "ec2:CreateCapacityReservation", "types": ["capacity-reservation"], "resources": []},
|
||||
"ec2:CreateCapacityReservationBySplitting": {"action": "ec2:CreateCapacityReservationBySplitting", "types": ["capacity-reservation"], "resources": []},
|
||||
"ec2:CreateCapacityReservationCancellationQuote": {"action": "ec2:CreateCapacityReservationCancellationQuote", "types": ["capacity-reservation", "capacity-reservation-cancellation-quote"], "resources": []},
|
||||
"ec2:CreateCapacityReservationDateChangeQuote": {"action": "ec2:CreateCapacityReservationDateChangeQuote", "types": [], "resources": []},
|
||||
"ec2:CreateCapacityReservationDateChangeQuote": {"action": "ec2:CreateCapacityReservationDateChangeQuote", "types": ["capacity-reservation", "capacity-reservation-modification-quote"], "resources": []},
|
||||
"ec2:CreateCapacityReservationFleet": {"action": "ec2:CreateCapacityReservationFleet", "types": ["capacity-reservation-fleet"], "resources": []},
|
||||
"ec2:CreateCarrierGateway": {"action": "ec2:CreateCarrierGateway", "types": ["carrier-gateway", "vpc"], "resources": []},
|
||||
"ec2:CreateClientVpnEndpoint": {"action": "ec2:CreateClientVpnEndpoint", "types": ["client-vpn-endpoint", "security-group", "transit-gateway", "vpc"], "resources": []},
|
||||
@@ -856,7 +884,7 @@
|
||||
"ec2:DeleteCapacityManagerDataExport": {"action": "ec2:DeleteCapacityManagerDataExport", "types": ["capacity-manager-data-export"], "resources": []},
|
||||
"ec2:DeleteCarrierGateway": {"action": "ec2:DeleteCarrierGateway", "types": ["carrier-gateway"], "resources": []},
|
||||
"ec2:DeleteClientVpnEndpoint": {"action": "ec2:DeleteClientVpnEndpoint", "types": ["client-vpn-endpoint"], "resources": []},
|
||||
"ec2:DeleteClientVpnEndpointAuthorizationPolicy": {"action": "ec2:DeleteClientVpnEndpointAuthorizationPolicy", "types": [], "resources": []},
|
||||
"ec2:DeleteClientVpnEndpointAuthorizationPolicy": {"action": "ec2:DeleteClientVpnEndpointAuthorizationPolicy", "types": ["client-vpn-endpoint"], "resources": []},
|
||||
"ec2:DeleteClientVpnRoute": {"action": "ec2:DeleteClientVpnRoute", "types": ["client-vpn-endpoint", "subnet"], "resources": []},
|
||||
"ec2:DeleteCoipCidr": {"action": "ec2:DeleteCoipCidr", "types": ["coip-pool"], "resources": []},
|
||||
"ec2:DeleteCoipPool": {"action": "ec2:DeleteCoipPool", "types": ["coip-pool"], "resources": []},
|
||||
@@ -1240,7 +1268,7 @@
|
||||
"ec2:GetCapacityManagerMonitoredTagKeys": {"action": "ec2:GetCapacityManagerMonitoredTagKeys", "types": [], "resources": []},
|
||||
"ec2:GetCapacityManagerSupportabilityScores": {"action": "ec2:GetCapacityManagerSupportabilityScores", "types": [], "resources": []},
|
||||
"ec2:GetCapacityReservationUsage": {"action": "ec2:GetCapacityReservationUsage", "types": ["capacity-reservation"], "resources": []},
|
||||
"ec2:GetClientVpnEndpointAuthorizationPolicy": {"action": "ec2:GetClientVpnEndpointAuthorizationPolicy", "types": [], "resources": []},
|
||||
"ec2:GetClientVpnEndpointAuthorizationPolicy": {"action": "ec2:GetClientVpnEndpointAuthorizationPolicy", "types": ["client-vpn-endpoint"], "resources": []},
|
||||
"ec2:GetCoipPoolUsage": {"action": "ec2:GetCoipPoolUsage", "types": ["coip-pool"], "resources": []},
|
||||
"ec2:GetConsoleOutput": {"action": "ec2:GetConsoleOutput", "types": ["instance"], "resources": []},
|
||||
"ec2:GetConsoleScreenshot": {"action": "ec2:GetConsoleScreenshot", "types": ["instance"], "resources": []},
|
||||
@@ -1254,7 +1282,7 @@
|
||||
"ec2:GetHostReservationPurchasePreview": {"action": "ec2:GetHostReservationPurchasePreview", "types": [], "resources": []},
|
||||
"ec2:GetImageAncestry": {"action": "ec2:GetImageAncestry", "types": ["image"], "resources": []},
|
||||
"ec2:GetImageBlockPublicAccessState": {"action": "ec2:GetImageBlockPublicAccessState", "types": [], "resources": []},
|
||||
"ec2:GetImageFindings": {"action": "ec2:GetImageFindings", "types": [], "resources": []},
|
||||
"ec2:GetImageFindings": {"action": "ec2:GetImageFindings", "types": ["image"], "resources": []},
|
||||
"ec2:GetInstanceMetadataDefaults": {"action": "ec2:GetInstanceMetadataDefaults", "types": [], "resources": []},
|
||||
"ec2:GetInstanceTpmEkPub": {"action": "ec2:GetInstanceTpmEkPub", "types": ["instance"], "resources": []},
|
||||
"ec2:GetInstanceTypesFromInstanceRequirements": {"action": "ec2:GetInstanceTypesFromInstanceRequirements", "types": [], "resources": []},
|
||||
@@ -1294,7 +1322,7 @@
|
||||
"ec2:GetSnapshotBlockPublicAccessState": {"action": "ec2:GetSnapshotBlockPublicAccessState", "types": [], "resources": []},
|
||||
"ec2:GetSpotPlacementScores": {"action": "ec2:GetSpotPlacementScores", "types": [], "resources": []},
|
||||
"ec2:GetSubnetCidrReservations": {"action": "ec2:GetSubnetCidrReservations", "types": [], "resources": []},
|
||||
"ec2:GetTransitGatewayAttachmentNatConfiguration": {"action": "ec2:GetTransitGatewayAttachmentNatConfiguration", "types": [], "resources": []},
|
||||
"ec2:GetTransitGatewayAttachmentNatConfiguration": {"action": "ec2:GetTransitGatewayAttachmentNatConfiguration", "types": ["transit-gateway-attachment"], "resources": []},
|
||||
"ec2:GetTransitGatewayAttachmentPropagations": {"action": "ec2:GetTransitGatewayAttachmentPropagations", "types": [], "resources": []},
|
||||
"ec2:GetTransitGatewayMeteringPolicyEntries": {"action": "ec2:GetTransitGatewayMeteringPolicyEntries", "types": ["transit-gateway-metering-policy"], "resources": []},
|
||||
"ec2:GetTransitGatewayMulticastDomainAssociations": {"action": "ec2:GetTransitGatewayMulticastDomainAssociations", "types": ["transit-gateway-multicast-domain"], "resources": []},
|
||||
@@ -1324,10 +1352,10 @@
|
||||
"ec2:ModifyAddressAttribute": {"action": "ec2:ModifyAddressAttribute", "types": ["elastic-ip"], "resources": []},
|
||||
"ec2:ModifyApplicationStatusCheck": {"action": "ec2:ModifyApplicationStatusCheck", "types": ["application-status-check", "security-group", "subnet"], "resources": []},
|
||||
"ec2:ModifyAvailabilityZoneGroup": {"action": "ec2:ModifyAvailabilityZoneGroup", "types": [], "resources": []},
|
||||
"ec2:ModifyCapacityReservation": {"action": "ec2:ModifyCapacityReservation", "types": ["capacity-reservation"], "resources": []},
|
||||
"ec2:ModifyCapacityReservation": {"action": "ec2:ModifyCapacityReservation", "types": ["capacity-reservation", "capacity-reservation-modification-quote"], "resources": []},
|
||||
"ec2:ModifyCapacityReservationFleet": {"action": "ec2:ModifyCapacityReservationFleet", "types": ["capacity-reservation-fleet"], "resources": []},
|
||||
"ec2:ModifyClientVpnEndpoint": {"action": "ec2:ModifyClientVpnEndpoint", "types": ["client-vpn-endpoint", "security-group", "transit-gateway", "vpc"], "resources": []},
|
||||
"ec2:ModifyClientVpnEndpointAuthorizationPolicy": {"action": "ec2:ModifyClientVpnEndpointAuthorizationPolicy", "types": [], "resources": []},
|
||||
"ec2:ModifyClientVpnEndpointAuthorizationPolicy": {"action": "ec2:ModifyClientVpnEndpointAuthorizationPolicy", "types": ["client-vpn-endpoint"], "resources": []},
|
||||
"ec2:ModifyDefaultCreditSpecification": {"action": "ec2:ModifyDefaultCreditSpecification", "types": [], "resources": []},
|
||||
"ec2:ModifyEbsDefaultKmsKeyId": {"action": "ec2:ModifyEbsDefaultKmsKeyId", "types": [], "resources": []},
|
||||
"ec2:ModifyFleet": {"action": "ec2:ModifyFleet", "types": ["fleet", "image", "launch-template", "subnet"], "resources": []},
|
||||
@@ -1376,7 +1404,7 @@
|
||||
"ec2:ModifyTrafficMirrorFilterRule": {"action": "ec2:ModifyTrafficMirrorFilterRule", "types": ["traffic-mirror-filter", "traffic-mirror-filter-rule"], "resources": []},
|
||||
"ec2:ModifyTrafficMirrorSession": {"action": "ec2:ModifyTrafficMirrorSession", "types": ["traffic-mirror-filter", "traffic-mirror-session", "traffic-mirror-target"], "resources": []},
|
||||
"ec2:ModifyTransitGateway": {"action": "ec2:ModifyTransitGateway", "types": ["transit-gateway", "transit-gateway-route-table"], "resources": []},
|
||||
"ec2:ModifyTransitGatewayAttachmentNatConfiguration": {"action": "ec2:ModifyTransitGatewayAttachmentNatConfiguration", "types": [], "resources": []},
|
||||
"ec2:ModifyTransitGatewayAttachmentNatConfiguration": {"action": "ec2:ModifyTransitGatewayAttachmentNatConfiguration", "types": ["transit-gateway-attachment"], "resources": []},
|
||||
"ec2:ModifyTransitGatewayMeteringPolicy": {"action": "ec2:ModifyTransitGatewayMeteringPolicy", "types": ["transit-gateway-attachment", "transit-gateway-metering-policy"], "resources": []},
|
||||
"ec2:ModifyTransitGatewayPolicyTableEntry": {"action": "ec2:ModifyTransitGatewayPolicyTableEntry", "types": ["transit-gateway-policy-table", "transit-gateway-route-table"], "resources": []},
|
||||
"ec2:ModifyTransitGatewayPrefixListReference": {"action": "ec2:ModifyTransitGatewayPrefixListReference", "types": ["prefix-list", "transit-gateway-attachment", "transit-gateway-route-table"], "resources": []},
|
||||
@@ -2353,7 +2381,7 @@
|
||||
"redshift-data:ListTables": {"action": "redshift-data:ListTables", "types": ["cluster", "workgroup"], "resources": [{"types": ["cluster", "workgroup"], "arn": "SecretArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}, {"type": "workgroup", "fill": {}, "find": ["WorkgroupName"]}]},
|
||||
"redshift:AcceptReservedNodeExchange": {"action": "redshift:AcceptReservedNodeExchange", "types": [], "resources": []},
|
||||
"redshift:AddPartner": {"action": "redshift:AddPartner", "types": [], "resources": []},
|
||||
"redshift:AssociateDataShareConsumer": {"action": "redshift:AssociateDataShareConsumer", "types": ["datashare"], "resources": [{"types": ["datashare"], "arn": "DataShareArn"}]},
|
||||
"redshift:AssociateDataShareConsumer": {"action": "redshift:AssociateDataShareConsumer", "types": ["datashare"], "resources": [{"types": ["datashare"], "arn": "ConsumerArn"}, {"types": ["datashare"], "arn": "DataShareArn"}]},
|
||||
"redshift:AuthorizeClusterSecurityGroupIngress": {"action": "redshift:AuthorizeClusterSecurityGroupIngress", "types": ["securitygroup", "securitygroupingress-ec2securitygroup"], "resources": []},
|
||||
"redshift:AuthorizeDataShare": {"action": "redshift:AuthorizeDataShare", "types": ["datashare"], "resources": [{"types": ["datashare"], "arn": "DataShareArn"}]},
|
||||
"redshift:AuthorizeEndpointAccess": {"action": "redshift:AuthorizeEndpointAccess", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
@@ -2363,17 +2391,17 @@
|
||||
"redshift:CancelResize": {"action": "redshift:CancelResize", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CopyClusterSnapshot": {"action": "redshift:CopyClusterSnapshot", "types": ["cluster", "snapshot"], "resources": [{"type": "cluster", "fill": {"ClusterName": "SourceSnapshotClusterIdentifier"}}, {"type": "snapshot", "fill": {"ClusterName": "SourceSnapshotClusterIdentifier", "SnapshotName": "SourceSnapshotIdentifier"}, "made": true}]},
|
||||
"redshift:CreateAuthenticationProfile": {"action": "redshift:CreateAuthenticationProfile", "types": [], "resources": []},
|
||||
"redshift:CreateCluster": {"action": "redshift:CreateCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CreateCluster": {"action": "redshift:CreateCluster", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "DefaultIamRoleArn"}, {"types": ["cluster"], "arn": "RedshiftIdcApplicationArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CreateClusterParameterGroup": {"action": "redshift:CreateClusterParameterGroup", "types": ["parametergroup"], "resources": [{"type": "parametergroup", "fill": {"ParameterGroupName": "ParameterGroupName"}}]},
|
||||
"redshift:CreateClusterSecurityGroup": {"action": "redshift:CreateClusterSecurityGroup", "types": ["securitygroup"], "resources": [{"type": "securitygroup", "fill": {"SecurityGroupName": "ClusterSecurityGroupName"}}]},
|
||||
"redshift:CreateClusterSnapshot": {"action": "redshift:CreateClusterSnapshot", "types": ["cluster", "snapshot"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}, {"type": "snapshot", "fill": {"ClusterName": "ClusterIdentifier", "SnapshotName": "SnapshotIdentifier"}, "made": true}]},
|
||||
"redshift:CreateClusterSubnetGroup": {"action": "redshift:CreateClusterSubnetGroup", "types": ["subnetgroup"], "resources": [{"type": "subnetgroup", "fill": {"SubnetGroupName": "ClusterSubnetGroupName"}}]},
|
||||
"redshift:CreateCustomDomainAssociation": {"action": "redshift:CreateCustomDomainAssociation", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CreateCustomDomainAssociation": {"action": "redshift:CreateCustomDomainAssociation", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "CustomDomainCertificateArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CreateEndpointAccess": {"action": "redshift:CreateEndpointAccess", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:CreateEventSubscription": {"action": "redshift:CreateEventSubscription", "types": ["eventsubscription"], "resources": [{"type": "eventsubscription", "fill": {"EventSubscriptionName": "SubscriptionName"}}]},
|
||||
"redshift:CreateEventSubscription": {"action": "redshift:CreateEventSubscription", "types": ["eventsubscription"], "resources": [{"types": ["eventsubscription"], "arn": "SnsTopicArn"}, {"type": "eventsubscription", "fill": {"EventSubscriptionName": "SubscriptionName"}}]},
|
||||
"redshift:CreateHsmClientCertificate": {"action": "redshift:CreateHsmClientCertificate", "types": ["hsmclientcertificate"], "resources": [{"type": "hsmclientcertificate", "fill": {"HSMClientCertificateId": "HsmClientCertificateIdentifier"}}]},
|
||||
"redshift:CreateHsmConfiguration": {"action": "redshift:CreateHsmConfiguration", "types": ["hsmconfiguration"], "resources": [{"type": "hsmconfiguration", "fill": {"HSMConfigurationId": "HsmConfigurationIdentifier"}}]},
|
||||
"redshift:CreateIntegration": {"action": "redshift:CreateIntegration", "types": ["integration"], "resources": [{"type": "integration", "fill": {}}]},
|
||||
"redshift:CreateIntegration": {"action": "redshift:CreateIntegration", "types": ["integration"], "resources": [{"types": ["integration"], "arn": "SourceArn"}, {"types": ["integration"], "arn": "TargetArn"}, {"type": "integration", "fill": {}}]},
|
||||
"redshift:CreateQev2IdcApplication": {"action": "redshift:CreateQev2IdcApplication", "types": [], "resources": []},
|
||||
"redshift:CreateRedshiftIdcApplication": {"action": "redshift:CreateRedshiftIdcApplication", "types": [], "resources": []},
|
||||
"redshift:CreateScheduledAction": {"action": "redshift:CreateScheduledAction", "types": [], "resources": []},
|
||||
@@ -2410,7 +2438,7 @@
|
||||
"redshift:DescribeClusterParameterGroups": {"action": "redshift:DescribeClusterParameterGroups", "types": [], "resources": []},
|
||||
"redshift:DescribeClusterParameters": {"action": "redshift:DescribeClusterParameters", "types": ["parametergroup"], "resources": [{"type": "parametergroup", "fill": {"ParameterGroupName": "ParameterGroupName"}}]},
|
||||
"redshift:DescribeClusterSecurityGroups": {"action": "redshift:DescribeClusterSecurityGroups", "types": [], "resources": []},
|
||||
"redshift:DescribeClusterSnapshots": {"action": "redshift:DescribeClusterSnapshots", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeClusterSnapshots": {"action": "redshift:DescribeClusterSnapshots", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "SnapshotArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeClusterSubnetGroups": {"action": "redshift:DescribeClusterSubnetGroups", "types": [], "resources": []},
|
||||
"redshift:DescribeClusterTracks": {"action": "redshift:DescribeClusterTracks", "types": [], "resources": []},
|
||||
"redshift:DescribeClusterVersions": {"action": "redshift:DescribeClusterVersions", "types": [], "resources": []},
|
||||
@@ -2430,7 +2458,7 @@
|
||||
"redshift:DescribeInboundIntegrations": {"action": "redshift:DescribeInboundIntegrations", "types": [], "resources": []},
|
||||
"redshift:DescribeIntegrations": {"action": "redshift:DescribeIntegrations", "types": ["integration"], "resources": [{"types": ["integration"], "arn": "IntegrationArn"}]},
|
||||
"redshift:DescribeLoggingStatus": {"action": "redshift:DescribeLoggingStatus", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeNodeConfigurationOptions": {"action": "redshift:DescribeNodeConfigurationOptions", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeNodeConfigurationOptions": {"action": "redshift:DescribeNodeConfigurationOptions", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "SnapshotArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeOrderableClusterOptions": {"action": "redshift:DescribeOrderableClusterOptions", "types": [], "resources": []},
|
||||
"redshift:DescribePartners": {"action": "redshift:DescribePartners", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DescribeQev2IdcApplications": {"action": "redshift:DescribeQev2IdcApplications", "types": [], "resources": []},
|
||||
@@ -2448,7 +2476,7 @@
|
||||
"redshift:DescribeUsageLimits": {"action": "redshift:DescribeUsageLimits", "types": ["cluster", "usagelimit"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}, {"type": "usagelimit", "fill": {"UsageLimitId": "UsageLimitId"}}]},
|
||||
"redshift:DisableLogging": {"action": "redshift:DisableLogging", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DisableSnapshotCopy": {"action": "redshift:DisableSnapshotCopy", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:DisassociateDataShareConsumer": {"action": "redshift:DisassociateDataShareConsumer", "types": ["datashare"], "resources": [{"types": ["datashare"], "arn": "DataShareArn"}]},
|
||||
"redshift:DisassociateDataShareConsumer": {"action": "redshift:DisassociateDataShareConsumer", "types": ["datashare"], "resources": [{"types": ["datashare"], "arn": "ConsumerArn"}, {"types": ["datashare"], "arn": "DataShareArn"}]},
|
||||
"redshift:EnableLogging": {"action": "redshift:EnableLogging", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:EnableSnapshotCopy": {"action": "redshift:EnableSnapshotCopy", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:FailoverPrimaryCompute": {"action": "redshift:FailoverPrimaryCompute", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
@@ -2458,24 +2486,24 @@
|
||||
"redshift:GetReservedNodeExchangeConfigurationOptions": {"action": "redshift:GetReservedNodeExchangeConfigurationOptions", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:GetReservedNodeExchangeOfferings": {"action": "redshift:GetReservedNodeExchangeOfferings", "types": [], "resources": []},
|
||||
"redshift:GetResourcePolicy": {"action": "redshift:GetResourcePolicy", "types": ["namespace"], "resources": [{"types": ["namespace"], "arn": "ResourceArn"}]},
|
||||
"redshift:ListRecommendations": {"action": "redshift:ListRecommendations", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ListRecommendations": {"action": "redshift:ListRecommendations", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "NamespaceArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyAquaConfiguration": {"action": "redshift:ModifyAquaConfiguration", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyAuthenticationProfile": {"action": "redshift:ModifyAuthenticationProfile", "types": [], "resources": []},
|
||||
"redshift:ModifyCluster": {"action": "redshift:ModifyCluster", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterDbRevision": {"action": "redshift:ModifyClusterDbRevision", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterIamRoles": {"action": "redshift:ModifyClusterIamRoles", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterIamRoles": {"action": "redshift:ModifyClusterIamRoles", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "DefaultIamRoleArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterMaintenance": {"action": "redshift:ModifyClusterMaintenance", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterParameterGroup": {"action": "redshift:ModifyClusterParameterGroup", "types": ["parametergroup"], "resources": [{"type": "parametergroup", "fill": {"ParameterGroupName": "ParameterGroupName"}}]},
|
||||
"redshift:ModifyClusterSnapshot": {"action": "redshift:ModifyClusterSnapshot", "types": ["snapshot"], "resources": [{"type": "snapshot", "fill": {"SnapshotName": "SnapshotIdentifier"}}]},
|
||||
"redshift:ModifyClusterSnapshotSchedule": {"action": "redshift:ModifyClusterSnapshotSchedule", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyClusterSubnetGroup": {"action": "redshift:ModifyClusterSubnetGroup", "types": ["subnetgroup"], "resources": [{"type": "subnetgroup", "fill": {"SubnetGroupName": "ClusterSubnetGroupName"}}]},
|
||||
"redshift:ModifyCustomDomainAssociation": {"action": "redshift:ModifyCustomDomainAssociation", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyCustomDomainAssociation": {"action": "redshift:ModifyCustomDomainAssociation", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "CustomDomainCertificateArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyEndpointAccess": {"action": "redshift:ModifyEndpointAccess", "types": [], "resources": []},
|
||||
"redshift:ModifyEventSubscription": {"action": "redshift:ModifyEventSubscription", "types": ["eventsubscription"], "resources": [{"type": "eventsubscription", "fill": {"EventSubscriptionName": "SubscriptionName"}}]},
|
||||
"redshift:ModifyEventSubscription": {"action": "redshift:ModifyEventSubscription", "types": ["eventsubscription"], "resources": [{"types": ["eventsubscription"], "arn": "SnsTopicArn"}, {"type": "eventsubscription", "fill": {"EventSubscriptionName": "SubscriptionName"}}]},
|
||||
"redshift:ModifyIntegration": {"action": "redshift:ModifyIntegration", "types": ["integration"], "resources": [{"types": ["integration"], "arn": "IntegrationArn"}]},
|
||||
"redshift:ModifyLakehouseConfiguration": {"action": "redshift:ModifyLakehouseConfiguration", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyLakehouseConfiguration": {"action": "redshift:ModifyLakehouseConfiguration", "types": ["cluster"], "resources": [{"types": ["cluster"], "arn": "LakehouseIdcApplicationArn"}, {"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifyQev2IdcApplication": {"action": "redshift:ModifyQev2IdcApplication", "types": ["qev2idcapplication"], "resources": [{"types": ["qev2idcapplication"], "arn": "Qev2IdcApplicationArn"}]},
|
||||
"redshift:ModifyRedshiftIdcApplication": {"action": "redshift:ModifyRedshiftIdcApplication", "types": ["redshiftidcapplication"], "resources": [{"types": ["redshiftidcapplication"], "arn": "RedshiftIdcApplicationArn"}]},
|
||||
"redshift:ModifyRedshiftIdcApplication": {"action": "redshift:ModifyRedshiftIdcApplication", "types": ["redshiftidcapplication"], "resources": [{"types": ["redshiftidcapplication"], "arn": "AuthorizedTokenIssuerList[].TrustedTokenIssuerArn"}, {"types": ["redshiftidcapplication"], "arn": "IamRoleArn"}, {"types": ["redshiftidcapplication"], "arn": "RedshiftIdcApplicationArn"}]},
|
||||
"redshift:ModifyScheduledAction": {"action": "redshift:ModifyScheduledAction", "types": [], "resources": []},
|
||||
"redshift:ModifySnapshotCopyRetentionPeriod": {"action": "redshift:ModifySnapshotCopyRetentionPeriod", "types": ["cluster"], "resources": [{"type": "cluster", "fill": {"ClusterName": "ClusterIdentifier"}}]},
|
||||
"redshift:ModifySnapshotSchedule": {"action": "redshift:ModifySnapshotSchedule", "types": ["snapshotschedule"], "resources": [{"type": "snapshotschedule", "fill": {"ScheduleIdentifier": "ScheduleIdentifier"}}]},
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_tag_on_create.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-09", "note": "make iam-tag-on-create-check re-derives every member from botocore; make iam-tag-on-create-verify checks every operation against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "autoscaling": ["autoscaling"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudformation"], "cloudhsm": ["cloudhsmv2"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codedeploy": ["codedeploy"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "iam": ["iam"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "lightsail": ["lightsail"], "logs": ["logs"], "memorydb": ["memorydb"], "network-firewall": ["network-firewall"], "organizations": ["organizations"], "payment-cryptography": ["payment-cryptography"], "pipes": ["pipes"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-groups": ["resource-groups"], "route53resolver": ["route53resolver"], "sagemaker": ["sagemaker"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "servicediscovery": ["servicediscovery"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "signer": ["signer"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "swf": ["swf"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "wafv2": ["wafv2"]},
|
||||
"notCovered": {"airflow": "REST routes no rule maps yet", "app-integrations": "REST routes no rule maps yet", "appconfig": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aps": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "batch": "REST routes no rule maps yet", "bedrock": "REST routes no rule maps yet", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "REST routes no rule maps yet", "codeguru-reviewer": "REST routes no rule maps yet", "connect": "REST routes no rule maps yet", "controltower": "REST routes no rule maps yet", "detective": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "elasticfilesystem": "REST routes no rule maps yet", "emr-serverless": "REST routes no rule maps yet", "fis": "REST routes no rule maps yet", "guardduty": "REST routes no rule maps yet", "inspector2": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "macie2": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "oam": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; creation-tag IAM authorization is not implemented", "ram": "REST routes no rule maps yet", "resource-explorer-2": "REST routes no rule maps yet", "rum": "REST routes no rule maps yet", "s3": "authorized by route; S3 checks s3:PutObjectTagging for an object it creates with tags itself", "s3tables": "REST routes no rule maps yet", "securityhub": "REST routes no rule maps yet", "servicecatalog": "its operations that tag are AppRegistry's, whose REST routes no rule maps yet"},
|
||||
"_source": {"generator": "tools/aws/regen_iam_tag_on_create.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-10", "note": "make iam-tag-on-create-check re-derives every member from botocore; make iam-tag-on-create-verify checks every operation against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "autoscaling": ["autoscaling"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudformation"], "cloudhsm": ["cloudhsmv2"], "cloudtrail": ["cloudtrail"], "cloudwatch": ["cloudwatch", "cloudwatchomni"], "codedeploy": ["codedeploy"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "comprehend": ["comprehend"], "config": ["config"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dms": ["dms"], "dsql": ["dsql"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "eks": ["eks"], "elasticache": ["elasticache"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "iam": ["iam"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "kms": ["kms"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "lightsail": ["lightsail"], "logs": ["logs"], "memorydb": ["memorydb"], "network-firewall": ["network-firewall"], "organizations": ["organizations"], "payment-cryptography": ["payment-cryptography"], "pipes": ["pipes"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-groups": ["resource-groups"], "route53resolver": ["route53resolver"], "sagemaker": ["sagemaker"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "servicediscovery": ["servicediscovery"], "ses": ["mailmanager", "pinpoint-email", "ses", "sesv2"], "signer": ["signer"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "swf": ["swf"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "transcribe": ["transcribe"], "transfer": ["transfer"], "translate": ["translate"], "wafv2": ["wafv2"]},
|
||||
"notCovered": {"airflow": "REST routes no rule maps yet", "app-integrations": "REST routes no rule maps yet", "appconfig": "REST routes no rule maps yet", "appsync": "REST routes no rule maps yet", "aps": "REST routes no rule maps yet", "aws-marketplace": "REST routes no rule maps yet", "backup": "REST routes no rule maps yet", "batch": "REST routes no rule maps yet", "bedrock": "REST routes no rule maps yet", "bedrock-agentcore": "REST routes no rule maps yet", "cloudfront": "REST routes no rule maps yet", "codeguru-reviewer": "REST routes no rule maps yet", "connect": "REST routes no rule maps yet", "detective": "REST routes no rule maps yet", "dlm": "REST routes no rule maps yet", "elasticfilesystem": "REST routes no rule maps yet", "emr-serverless": "REST routes no rule maps yet", "fis": "REST routes no rule maps yet", "guardduty": "REST routes no rule maps yet", "inspector2": "REST routes no rule maps yet", "iot": "REST routes no rule maps yet", "kafka": "REST routes no rule maps yet", "macie2": "REST routes no rule maps yet", "mq": "REST routes no rule maps yet", "oam": "REST routes no rule maps yet", "quicksight": "metadata-only REST subset; creation-tag IAM authorization is not implemented", "ram": "REST routes no rule maps yet", "resource-explorer-2": "REST routes no rule maps yet", "rum": "REST routes no rule maps yet", "s3": "authorized by route; S3 checks s3:PutObjectTagging for an object it creates with tags itself", "s3tables": "REST routes no rule maps yet", "securityhub": "REST routes no rule maps yet", "servicecatalog": "its operations that tag are AppRegistry's, whose REST routes no rule maps yet"},
|
||||
"otherNamespaces": ["account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifyuibuilder", "aoss", "appfabric", "appflow", "application-signals", "applicationinsights", "appmesh", "apprunner", "appstream", "arc-region-switch", "artifact", "auditmanager", "b2bi", "backup-gateway", "backup-search", "bcm-dashboards", "billing", "billingconductor", "braket", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "connect-campaigns", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "directconnect", "docdb-elastic", "drs", "ds", "ebs", "ecr-public", "elemental-inference", "emr-containers", "entityresolution", "evs", "fms", "forecast", "frauddetector", "fsx", "gamelift", "gameliftstreams", "geo", "grafana", "greengrass", "groundstation", "health-agent", "healthlake", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotdeviceadvisor", "iotfleetwise", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "ivs", "ivschat", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "m2", "managedblockchain", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgn", "migrationhub-orchestrator", "mobiletargeting", "mpa", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "notifications", "notifications-contacts", "observabilityadmin", "odb", "omics", "opensearch", "osis", "outposts", "partnercentral", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "profile", "proton", "qbusiness", "rbin", "refactor-spaces", "repostspace", "resiliencehub", "rolesanywhere", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3files", "sagemaker-geospatial", "savingsplans", "schemas", "scn", "security-ir", "securityagent", "securitylake", "shield", "sms-voice", "snow-device-management", "social-messaging", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "voiceid", "vpc-lattice", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workspaces", "workspaces-instances", "workspaces-web", "xray"],
|
||||
"resourceArns": {"ec2": {"application-status-check": "arn:${Partition}:ec2:${Region}:${Account}:application-status-check/*", "capacity-block": "arn:${Partition}:ec2:${Region}:${Account}:capacity-block/*", "capacity-manager-data-export": "arn:${Partition}:ec2:${Region}:${Account}:capacity-manager-data-export/*", "capacity-reservation": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation/*", "capacity-reservation-cancellation-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-cancellation-quote/*", "capacity-reservation-fleet": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-fleet/*", "carrier-gateway": "arn:${Partition}:ec2:${Region}:${Account}:carrier-gateway/*", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/*", "client-vpn-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:client-vpn-endpoint/*", "coip-pool": "arn:${Partition}:ec2:${Region}:${Account}:coip-pool/*", "customer-gateway": "arn:${Partition}:ec2:${Region}:${Account}:customer-gateway/*", "declarative-policies-report": "arn:${Partition}:ec2:${Region}:${Account}:declarative-policies-report/*", "dedicated-host": "arn:${Partition}:ec2:${Region}:${Account}:dedicated-host/*", "dhcp-options": "arn:${Partition}:ec2:${Region}:${Account}:dhcp-options/*", "egress-only-internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:egress-only-internet-gateway/*", "elastic-gpu": "arn:${Partition}:ec2:${Region}:${Account}:elastic-gpu/*", "elastic-inference": "arn:${Partition}:elastic-inference:${Region}:${Account}:elastic-inference-accelerator/*", "elastic-ip": "arn:${Partition}:ec2:${Region}:${Account}:elastic-ip/*", "export-image-task": "arn:${Partition}:ec2:${Region}:${Account}:export-image-task/*", "export-instance-task": "arn:${Partition}:ec2:${Region}:${Account}:export-instance-task/*", "fleet": "arn:${Partition}:ec2:${Region}:${Account}:fleet/*", "fpga-image": "arn:${Partition}:ec2:${Region}:${Account}:fpga-image/*", "group": "arn:${Partition}:resource-groups:${Region}:${Account}:group/*", "host-reservation": "arn:${Partition}:ec2:${Region}:${Account}:host-reservation/*", "image": "arn:${Partition}:ec2:${Region}::image/*", "image-usage-report": "arn:${Partition}:ec2:${Region}:${Account}:image-usage-report/*", "import-image-task": "arn:${Partition}:ec2:${Region}:${Account}:import-image-task/*", "import-snapshot-task": "arn:${Partition}:ec2:${Region}:${Account}:import-snapshot-task/*", "instance": "arn:${Partition}:ec2:${Region}:${Account}:instance/*", "instance-connect-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:instance-connect-endpoint/*", "instance-event-window": "arn:${Partition}:ec2:${Region}:${Account}:instance-event-window/*", "internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:internet-gateway/*", "ipam": "arn:${Partition}:ec2::${Account}:ipam/*", "ipam-external-resource-verification-token": "arn:${Partition}:ec2::${Account}:ipam-external-resource-verification-token/*", "ipam-internet-registry-association": "arn:${Partition}:ec2::${Account}:ipam-internet-registry-association/*", "ipam-policy": "arn:${Partition}:ec2::${Account}:ipam-policy/*", "ipam-pool": "arn:${Partition}:ec2::${Account}:ipam-pool/*", "ipam-pool-allocation": "arn:${Partition}:ec2:${Region}:${Account}:ipam-pool-allocation/*", "ipam-prefix-list-resolver": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver/*", "ipam-prefix-list-resolver-target": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver-target/*", "ipam-resource-discovery": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery/*", "ipam-resource-discovery-association": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery-association/*", "ipam-scope": "arn:${Partition}:ec2::${Account}:ipam-scope/*", "ipv4pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv4pool-ec2/*", "ipv6pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv6pool-ec2/*", "key-pair": "arn:${Partition}:ec2:${Region}:${Account}:key-pair/*", "launch-template": "arn:${Partition}:ec2:${Region}:${Account}:launch-template/*", "license-configuration": "arn:${Partition}:license-manager:${Region}:${Account}:license-configuration:*", "local-gateway": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway/*", "local-gateway-route-table": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table/*", "local-gateway-route-table-virtual-interface-group-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-virtual-interface-group-association/*", "local-gateway-route-table-vpc-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-vpc-association/*", "local-gateway-virtual-interface": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface/*", "local-gateway-virtual-interface-group": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface-group/*", "mac-modification-task": "arn:${Partition}:ec2:${Region}:${Account}:mac-modification-tasLine truncated
|
||||
"resourceArns": {"ec2": {"application-status-check": "arn:${Partition}:ec2:${Region}:${Account}:application-status-check/*", "capacity-block": "arn:${Partition}:ec2:${Region}:${Account}:capacity-block/*", "capacity-manager-data-export": "arn:${Partition}:ec2:${Region}:${Account}:capacity-manager-data-export/*", "capacity-reservation": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation/*", "capacity-reservation-cancellation-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-cancellation-quote/*", "capacity-reservation-fleet": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-fleet/*", "capacity-reservation-modification-quote": "arn:${Partition}:ec2:${Region}:${Account}:capacity-reservation-modification-quote/*", "carrier-gateway": "arn:${Partition}:ec2:${Region}:${Account}:carrier-gateway/*", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/*", "client-vpn-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:client-vpn-endpoint/*", "coip-pool": "arn:${Partition}:ec2:${Region}:${Account}:coip-pool/*", "customer-gateway": "arn:${Partition}:ec2:${Region}:${Account}:customer-gateway/*", "declarative-policies-report": "arn:${Partition}:ec2:${Region}:${Account}:declarative-policies-report/*", "dedicated-host": "arn:${Partition}:ec2:${Region}:${Account}:dedicated-host/*", "dhcp-options": "arn:${Partition}:ec2:${Region}:${Account}:dhcp-options/*", "egress-only-internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:egress-only-internet-gateway/*", "elastic-gpu": "arn:${Partition}:ec2:${Region}:${Account}:elastic-gpu/*", "elastic-inference": "arn:${Partition}:elastic-inference:${Region}:${Account}:elastic-inference-accelerator/*", "elastic-ip": "arn:${Partition}:ec2:${Region}:${Account}:elastic-ip/*", "export-image-task": "arn:${Partition}:ec2:${Region}:${Account}:export-image-task/*", "export-instance-task": "arn:${Partition}:ec2:${Region}:${Account}:export-instance-task/*", "fleet": "arn:${Partition}:ec2:${Region}:${Account}:fleet/*", "fpga-image": "arn:${Partition}:ec2:${Region}:${Account}:fpga-image/*", "group": "arn:${Partition}:resource-groups:${Region}:${Account}:group/*", "host-reservation": "arn:${Partition}:ec2:${Region}:${Account}:host-reservation/*", "image": "arn:${Partition}:ec2:${Region}::image/*", "image-usage-report": "arn:${Partition}:ec2:${Region}:${Account}:image-usage-report/*", "import-image-task": "arn:${Partition}:ec2:${Region}:${Account}:import-image-task/*", "import-snapshot-task": "arn:${Partition}:ec2:${Region}:${Account}:import-snapshot-task/*", "instance": "arn:${Partition}:ec2:${Region}:${Account}:instance/*", "instance-connect-endpoint": "arn:${Partition}:ec2:${Region}:${Account}:instance-connect-endpoint/*", "instance-event-window": "arn:${Partition}:ec2:${Region}:${Account}:instance-event-window/*", "internet-gateway": "arn:${Partition}:ec2:${Region}:${Account}:internet-gateway/*", "ipam": "arn:${Partition}:ec2::${Account}:ipam/*", "ipam-external-resource-verification-token": "arn:${Partition}:ec2::${Account}:ipam-external-resource-verification-token/*", "ipam-internet-registry-association": "arn:${Partition}:ec2::${Account}:ipam-internet-registry-association/*", "ipam-policy": "arn:${Partition}:ec2::${Account}:ipam-policy/*", "ipam-pool": "arn:${Partition}:ec2::${Account}:ipam-pool/*", "ipam-pool-allocation": "arn:${Partition}:ec2:${Region}:${Account}:ipam-pool-allocation/*", "ipam-prefix-list-resolver": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver/*", "ipam-prefix-list-resolver-target": "arn:${Partition}:ec2::${Account}:ipam-prefix-list-resolver-target/*", "ipam-resource-discovery": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery/*", "ipam-resource-discovery-association": "arn:${Partition}:ec2::${Account}:ipam-resource-discovery-association/*", "ipam-scope": "arn:${Partition}:ec2::${Account}:ipam-scope/*", "ipv4pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv4pool-ec2/*", "ipv6pool-ec2": "arn:${Partition}:ec2:${Region}:${Account}:ipv6pool-ec2/*", "key-pair": "arn:${Partition}:ec2:${Region}:${Account}:key-pair/*", "launch-template": "arn:${Partition}:ec2:${Region}:${Account}:launch-template/*", "license-configuration": "arn:${Partition}:license-manager:${Region}:${Account}:license-configuration:*", "local-gateway": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway/*", "local-gateway-route-table": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table/*", "local-gateway-route-table-virtual-interface-group-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-virtual-interface-group-association/*", "local-gateway-route-table-vpc-association": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-route-table-vpc-association/*", "local-gateway-virtual-interface": "arn:${Partition}:ec2:${Region}:${Account}:local-gateway-virtual-interface/*", "local-gateway-virtual-interface-group": "arn:${Partition}:ec2:${Region}:${Account}:Line truncated
|
||||
"operations": {
|
||||
"access-analyzer:CreateAnalyzer": {"tagging": ["access-analyzer:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"acm:ImportCertificate": {"tagging": ["acm:AddTagsToCertificate"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
@@ -86,6 +86,9 @@
|
||||
"config:PutOrganizationConformancePack": {"tagging": ["config:TagResource"], "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"config:PutServiceLinkedConfigurationRecorder": {"tagging": ["config:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"config:PutStoredQuery": {"tagging": ["config:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"controltower:CreateLandingZone": {"tagging": ["controltower:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"controltower:EnableBaseline": {"tagging": ["controltower:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"controltower:EnableControl": {"tagging": ["controltower:TagResource"], "requestTags": true, "tags": [{"member": "tags{}"}]},
|
||||
"cur:PutReportDefinition": {"tagging": ["cur:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"datasync:CreateAgent": {"tagging": ["datasync:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
"datasync:CreateLocationAzureBlob": {"tagging": ["datasync:TagResource"], "requestTags": true, "tags": [{"member": "Tags[]", "key": "Key", "value": "Value"}]},
|
||||
@@ -132,7 +135,7 @@
|
||||
"ec2:CreateCapacityReservation": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecifications[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCapacityReservationBySplitting": {"tagging": ["ec2:CreateTags"], "createAction": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCapacityReservationCancellationQuote": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCapacityReservationDateChangeQuote": {"tagging": ["ec2:CreateTags"], "createAction": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCapacityReservationDateChangeQuote": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCapacityReservationFleet": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateCarrierGateway": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
"ec2:CreateClientVpnEndpoint": {"tagging": ["ec2:CreateTags"], "createAction": true, "requestTags": true, "tags": [{"member": "TagSpecification[item].Tag[item]", "key": "Key", "value": "Value", "resourceType": "ResourceType"}]},
|
||||
|
||||
@@ -291,6 +291,41 @@
|
||||
"UpdateVpcLink": {"method": "PATCH", "requestUri": "/v2/vpclinks/{vpcLinkId}"}
|
||||
}
|
||||
},
|
||||
"controltower": {
|
||||
"credentialScope": "controltower",
|
||||
"apiVersion": "2018-05-10",
|
||||
"accessDeniedStatus": 403,
|
||||
"operations": {
|
||||
"CreateLandingZone": {"method": "POST", "requestUri": "/create-landingzone"},
|
||||
"DeleteLandingZone": {"method": "POST", "requestUri": "/delete-landingzone"},
|
||||
"DisableBaseline": {"method": "POST", "requestUri": "/disable-baseline"},
|
||||
"DisableControl": {"method": "POST", "requestUri": "/disable-control"},
|
||||
"EnableBaseline": {"method": "POST", "requestUri": "/enable-baseline"},
|
||||
"EnableControl": {"method": "POST", "requestUri": "/enable-control"},
|
||||
"GetBaseline": {"method": "POST", "requestUri": "/get-baseline"},
|
||||
"GetBaselineOperation": {"method": "POST", "requestUri": "/get-baseline-operation"},
|
||||
"GetControlOperation": {"method": "POST", "requestUri": "/get-control-operation"},
|
||||
"GetEnabledBaseline": {"method": "POST", "requestUri": "/get-enabled-baseline"},
|
||||
"GetEnabledControl": {"method": "POST", "requestUri": "/get-enabled-control"},
|
||||
"GetLandingZone": {"method": "POST", "requestUri": "/get-landingzone"},
|
||||
"GetLandingZoneOperation": {"method": "POST", "requestUri": "/get-landingzone-operation"},
|
||||
"ListBaselines": {"method": "POST", "requestUri": "/list-baselines"},
|
||||
"ListControlOperations": {"method": "POST", "requestUri": "/list-control-operations"},
|
||||
"ListEnabledBaselines": {"method": "POST", "requestUri": "/list-enabled-baselines"},
|
||||
"ListEnabledControls": {"method": "POST", "requestUri": "/list-enabled-controls"},
|
||||
"ListLandingZoneOperations": {"method": "POST", "requestUri": "/list-landingzone-operations"},
|
||||
"ListLandingZones": {"method": "POST", "requestUri": "/list-landingzones"},
|
||||
"ListTagsForResource": {"method": "GET", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "?resourceArn"}}]},
|
||||
"ResetEnabledBaseline": {"method": "POST", "requestUri": "/reset-enabled-baseline"},
|
||||
"ResetEnabledControl": {"method": "POST", "requestUri": "/reset-enabled-control"},
|
||||
"ResetLandingZone": {"method": "POST", "requestUri": "/reset-landingzone"},
|
||||
"TagResource": {"method": "POST", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "body"}}]},
|
||||
"UntagResource": {"method": "DELETE", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "?resourceArn"}}]},
|
||||
"UpdateEnabledBaseline": {"method": "POST", "requestUri": "/update-enabled-baseline"},
|
||||
"UpdateEnabledControl": {"method": "POST", "requestUri": "/update-enabled-control"},
|
||||
"UpdateLandingZone": {"method": "POST", "requestUri": "/update-landingzone"}
|
||||
}
|
||||
},
|
||||
"dsql": {
|
||||
"credentialScope": "dsql",
|
||||
"apiVersion": "2018-05-10",
|
||||
@@ -1292,15 +1327,15 @@
|
||||
"ListSigningJobs": {"method": "GET", "requestUri": "/_signer/signing-jobs"},
|
||||
"ListSigningPlatforms": {"method": "GET", "requestUri": "/_signer/signing-platforms"},
|
||||
"ListSigningProfiles": {"method": "GET", "requestUri": "/_signer/signing-profiles"},
|
||||
"ListTagsForResource": {"method": "GET", "requestUri": "/tags/{resourceArn+}"},
|
||||
"ListTagsForResource": {"method": "GET", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "?resourceArn"}}]},
|
||||
"PutSigningProfile": {"method": "PUT", "requestUri": "/_signer/signing-profiles/{profileName}"},
|
||||
"RemoveProfilePermission": {"method": "DELETE", "requestUri": "/_signer/signing-profiles/{profileName}/permissions/{statementId}"},
|
||||
"RevokeSignature": {"method": "PUT", "requestUri": "/_signer/signing-jobs/{jobId}/revoke"},
|
||||
"RevokeSigningProfile": {"method": "PUT", "requestUri": "/_signer/signing-profiles/{profileName}/revoke"},
|
||||
"SignPayload": {"method": "POST", "requestUri": "/_signer/signing-jobs/with-payload"},
|
||||
"StartSigningJob": {"method": "POST", "requestUri": "/_signer/signing-jobs"},
|
||||
"TagResource": {"method": "POST", "requestUri": "/tags/{resourceArn+}"},
|
||||
"UntagResource": {"method": "DELETE", "requestUri": "/tags/{resourceArn+}"}
|
||||
"TagResource": {"method": "POST", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "body"}}]},
|
||||
"UntagResource": {"method": "DELETE", "requestUri": "/tags/{resourceArn+}", "alternatives": [{"requestUri": "/tags", "located": {"resourceArn": "?resourceArn"}}]}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +449,8 @@ class RequestResourceMembersTest {
|
||||
*/
|
||||
private static boolean sharesAMember(Resource resource, Map<Member, String> given) {
|
||||
if (resource.arn() != null || resource.fill().values().stream()
|
||||
.noneMatch(member -> given.containsKey(member) && !resource.arnOf().containsKey(member.path()))) {
|
||||
.noneMatch(member -> given.containsKey(member) && (!resource.arnOf().containsKey(member.path())
|
||||
|| !AwsArnUtils.isArn(given.get(member))))) {
|
||||
return false;
|
||||
}
|
||||
Map<String, String> values = given.entrySet().stream()
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -30,6 +31,89 @@ class RequestResourcesTest {
|
||||
private static final ObjectMapper CBOR = new ObjectMapper(new CBORFactory());
|
||||
private static final String MACHINE = "arn:aws:states:us-east-1:000000000000:stateMachine:orders";
|
||||
|
||||
@Test
|
||||
void inferredLandingZoneIdentifiersKeepRawContextAcrossOperations() {
|
||||
String arn = "arn:aws:controltower:::landingzone/missing";
|
||||
for (String operation : List.of("GetLandingZone", "UpdateLandingZone", "ResetLandingZone", "DeleteLandingZone")) {
|
||||
assertEquals(List.of(arn), of("controltower:" + operation,
|
||||
json("{\"landingZoneIdentifier\":\"" + arn + "\"}")));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void controlTowerIdentifiersKeepFullArnsAndLandingZoneIds() {
|
||||
String prefix = "arn:aws:controltower:us-east-1:000000000000:";
|
||||
for (String operation : List.of("GetLandingZone", "UpdateLandingZone", "ResetLandingZone", "DeleteLandingZone")) {
|
||||
for (String identifier : List.of("zone-one", prefix + "landingzone/zone-one")) {
|
||||
assertEquals(List.of(prefix + "landingzone/zone-one"), of("controltower:" + operation,
|
||||
json("{\"landingZoneIdentifier\":\"" + identifier + "\"}")));
|
||||
}
|
||||
}
|
||||
for (String kind : List.of("Baseline", "Control")) {
|
||||
String member = "enabled" + kind + "Identifier";
|
||||
String arn = prefix + "enabled" + kind.toLowerCase() + "/one";
|
||||
for (String verb : List.of("Get", "Update", "Reset")) {
|
||||
assertEquals(List.of(arn), of("controltower:" + verb + "Enabled" + kind,
|
||||
json("{\"" + member + "\":\"" + arn + "\"}")));
|
||||
}
|
||||
}
|
||||
assertEquals(List.of(prefix + "enabledcontrol/*"), of("controltower:EnableControl",
|
||||
json("{\"controlIdentifier\":\"arn:aws:controlcatalog:::control/catalog-one\"}")));
|
||||
assertTrue(RequestResources.actsOnNoResource("controltower:ListLandingZones"));
|
||||
assertTrue(RequestResources.actsOnNoResource("controltower:CreateLandingZone"));
|
||||
assertEquals(List.of("arn:aws-us-gov:controltower:us-gov-west-1:111122223333:landingzone/zone-one"),
|
||||
RequestResources.of("controltower:GetLandingZone", json("{\"landingZoneIdentifier\":\"zone-one\"}"),
|
||||
"aws-us-gov", "us-gov-west-1", "111122223333"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void inferredControlArnsIgnoreOtherResourceTypesAndKeepTheCreatedWildcard() {
|
||||
String enabled = "arn:aws:controltower:us-east-1:000000000000:enabledcontrol/one";
|
||||
String references = "\"controlIdentifier\":\"arn:aws:controlcatalog:::control/catalog-one\","
|
||||
+ "\"targetIdentifier\":\"arn:aws:organizations::111122223333:ou/o-one/ou-one\"";
|
||||
assertEquals(List.of(enabled), of("controltower:DisableControl",
|
||||
json("{" + references + ",\"enabledControlIdentifier\":\"" + enabled + "\"}")));
|
||||
assertEquals(List.of("arn:aws:controltower:us-east-1:000000000000:enabledcontrol/*"),
|
||||
of("controltower:EnableControl", json("{" + references + "}")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sharedBareTagsReadTheirActualBodyOrQueryWithoutChangingArnPathPrecedence() {
|
||||
String arn = "arn:aws:controltower:us-east-1:000000000000:landingzone/one";
|
||||
String spoof = arn + "other";
|
||||
for (String method : List.of("POST", "GET", "DELETE")) {
|
||||
String operation = "controltower:" + switch (method) {
|
||||
case "POST" -> "TagResource";
|
||||
case "GET" -> "ListTagsForResource";
|
||||
default -> "UntagResource";
|
||||
};
|
||||
ContainerRequestContext bare = rest(method, "{\"resourceArn\":\"" + (method.equals("POST") ? arn : spoof)
|
||||
+ "\"}", Map.of("resourceArn", arn));
|
||||
when(bare.getUriInfo().getRequestUri()).thenReturn(URI.create("http://localhost/tags///"));
|
||||
when(bare.getUriInfo().getBaseUri()).thenReturn(URI.create("http://localhost/"));
|
||||
assertEquals(List.of(arn), of(operation, bare));
|
||||
ContainerRequestContext path = rest(method, "{\"resourceArn\":\"" + spoof + "\"}", Map.of("resourceArn", spoof));
|
||||
when(path.getUriInfo().getRequestUri()).thenReturn(URI.create("http://localhost/tags/" + arn));
|
||||
when(path.getUriInfo().getBaseUri()).thenReturn(URI.create("http://localhost/"));
|
||||
assertEquals(List.of(arn), RequestResources.of(operation, path, "aws", "us-east-1", "000000000000",
|
||||
null, Map.of("resourceArn", arn)));
|
||||
assertEquals(List.of(), of(operation, path));
|
||||
}
|
||||
ContainerRequestContext absentQuery = rest("GET", "{\"resourceArn\":\"" + arn + "\"}", Map.of());
|
||||
when(absentQuery.getUriInfo().getRequestUri()).thenReturn(URI.create("http://localhost/tags"));
|
||||
when(absentQuery.getUriInfo().getBaseUri()).thenReturn(URI.create("http://localhost/"));
|
||||
assertEquals(List.of(), of("controltower:ListTagsForResource", absentQuery));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sharedSignerBareTagsUseTheSameLocatedMemberContract() {
|
||||
String arn = "arn:aws:signer:us-east-1:000000000000:/signing-profiles/profile";
|
||||
ContainerRequestContext request = rest("POST", "{\"resourceArn\":\"" + arn + "\"}", Map.of());
|
||||
when(request.getUriInfo().getRequestUri()).thenReturn(URI.create("http://localhost/tags"));
|
||||
when(request.getUriInfo().getBaseUri()).thenReturn(URI.create("http://localhost/"));
|
||||
assertEquals(List.of(arn), of("signer:TagResource", request));
|
||||
}
|
||||
|
||||
@Test
|
||||
void generatedIdTargetsReadModelListsAndSerializedQueryNamesInOrder() throws Exception {
|
||||
String instance = "arn:aws:ec2:us-east-1:000000000000:instance/i-one";
|
||||
@@ -827,6 +911,28 @@ class RequestResourcesTest {
|
||||
json("{\"names\":[\"" + project + "a\",\"" + project + "b\"]}")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void identifierInferenceDoesNotAuthorizeUnrelatedArnPatternMembers() {
|
||||
String prefix = "arn:aws:";
|
||||
assertEquals(List.of(prefix + "athena:us-east-1:000000000000:workgroup/team"), of("athena:StartSession",
|
||||
json("{\"WorkGroup\":\"team\",\"ExecutionRole\":\"arn:aws:iam::000000000000:role/runner\"}")));
|
||||
assertEquals(List.of(prefix + "kinesisanalytics:us-east-1:000000000000:application/job"),
|
||||
of("kinesisanalytics:UpdateApplication", json("{\"ApplicationName\":\"job\","
|
||||
+ "\"ServiceExecutionRoleUpdate\":\"arn:aws:iam::000000000000:role/runner\"}")));
|
||||
String subscription = prefix + "ce::000000000000:anomalysubscription/subscription";
|
||||
assertEquals(List.of(subscription), of("ce:UpdateAnomalySubscription",
|
||||
json("{\"SubscriptionArn\":\"" + subscription + "\",\"MonitorArnList\":["
|
||||
+ "\"arn:aws:ce::000000000000:anomalymonitor/monitor\"]}")));
|
||||
assertEquals(List.of(prefix + "quicksight:us-east-1:000000000000:dashboard/dashboard"),
|
||||
RequestResources.of("quicksight:UpdateDashboardLinks", json("{\"LinkEntities\":["
|
||||
+ "\"arn:aws:quicksight:us-east-1:000000000000:analysis/analysis\"]}"),
|
||||
"aws", "us-east-1", "000000000000", null, Map.of("DashboardId", "dashboard")));
|
||||
String application = prefix + "sso::000000000000:application/ssoins-1234567890123456/apl-1234567890123456";
|
||||
assertEquals(List.of(application), of("sso:PutApplicationAccessScope",
|
||||
json("{\"ApplicationArn\":\"" + application + "\",\"AuthorizedTargets\":["
|
||||
+ "\"arn:aws:sso::000000000000:application/ssoins-1234567890123456/apl-9999999999999999\"]}")));
|
||||
}
|
||||
|
||||
/**
|
||||
* A member two resources share names both: Redshift's {@code SnapshotClusterIdentifier} fills the cluster and the
|
||||
* snapshot's cluster, the snapshot's name open when the request gives none. GetClusterCredentials' database is
|
||||
|
||||
@@ -16,12 +16,28 @@ import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/** How {@link TagOnCreate} reads the tags a request carries and the condition keys it checks them with. */
|
||||
class TagOnCreateTest {
|
||||
|
||||
@Test
|
||||
void controlTowerUsesModeledTagMapsAndChecksTheCreateActionWithTheirTags() {
|
||||
for (String operation : List.of("CreateLandingZone", "EnableControl", "EnableBaseline")) {
|
||||
Tagging tagging = TagOnCreate.of("controltower:" + operation, json(
|
||||
"{\"tags\":{\"team\":\"blue\"}}")).orElseThrow();
|
||||
assertEquals("controltower:TagResource", tagging.action());
|
||||
assertEquals(List.of(set(Map.of("team", "blue"))), tagging.sets());
|
||||
assertTrue(tagging.requestTags());
|
||||
assertFalse(tagging.createAction());
|
||||
assertEquals(List.of(Map.of("aws:RequestTag/team", List.of("blue"), "aws:TagKeys", List.of("team"))),
|
||||
TagOnCreate.requestTagContexts(tagging));
|
||||
assertFalse(TagOnCreate.of("controltower:" + operation, json("{\"tags\":{}}")).isPresent());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void aFormsTagsAreReadFromOneToTheFirstNumberWithNoKey() {
|
||||
assertEquals(List.of(set(Map.of("a", "1", "b", "2"))), sets("sns:CreateTopic", form("Name=t"
|
||||
|
||||
+5
-2
@@ -1,5 +1,6 @@
|
||||
package io.floci.aws.services.controltower;
|
||||
|
||||
import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.floci.aws.services.organizations.OrganizationsService;
|
||||
import io.floci.aws.services.organizations.model.Organization;
|
||||
import io.floci.aws.services.organizations.model.OrganizationalUnit;
|
||||
@@ -130,7 +131,9 @@ class ControlTowerControllerIntegrationTest {
|
||||
given()
|
||||
.header("Authorization", authorization)
|
||||
.when()
|
||||
.get("/tags/" + arn.substring(0, arn.lastIndexOf('/') + 1) + "UNKNOWNLZ")
|
||||
.get("/tags/" + new AwsArnUtils.Arn(AwsArnUtils.parse(arn).partition(), "controltower",
|
||||
AwsArnUtils.parse(arn).region(), AwsArnUtils.parse(arn).accountId(),
|
||||
"landingzone/UNKNOWNLZ"))
|
||||
.then()
|
||||
.statusCode(404)
|
||||
.body("__type", containsString("ResourceNotFoundException"));
|
||||
@@ -180,7 +183,7 @@ class ControlTowerControllerIntegrationTest {
|
||||
void getLandingZoneAcceptsLandingZoneIdLikeTheTerraformProvider() {
|
||||
String authorization = auth("000000000250", EAST);
|
||||
String arn = listLandingZonesArn(authorization);
|
||||
String id = arn.substring(arn.lastIndexOf('/') + 1);
|
||||
String id = AwsArnUtils.parse(arn).resource().substring("landingzone/".length());
|
||||
|
||||
given()
|
||||
.contentType("application/json")
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
package io.floci.aws.services.controltower;
|
||||
|
||||
import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.floci.aws.testing.AwsTestClients;
|
||||
import io.floci.aws.testing.SignedIamEnforcementProfile;
|
||||
import io.floci.aws.testing.SignedIamUsers;
|
||||
import io.quarkus.test.common.http.TestHTTPResource;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.controltower.ControlTowerClient;
|
||||
import software.amazon.awssdk.services.controltower.model.ControlTowerException;
|
||||
import software.amazon.awssdk.services.controltower.model.ListLandingZonesRequest;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static io.restassured.RestAssured.given;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(SignedIamEnforcementProfile.class)
|
||||
class ControlTowerIamIntegrationTest {
|
||||
|
||||
@TestHTTPResource("/")
|
||||
URI endpoint;
|
||||
|
||||
@Test
|
||||
void inferredLandingZoneArnKeepsMissingContextWithoutNamingTheSeededZone() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
String raw = "arn:aws:controltower:::landingzone/" + AwsArnUtils.parse(arn).resource().substring("landingzone/".length());
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:*", raw);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(404, assertThrows(ControlTowerException.class,
|
||||
() -> caller.getLandingZone(r -> r.landingZoneIdentifier(raw))).statusCode());
|
||||
assertEquals(404, assertThrows(ControlTowerException.class,
|
||||
() -> caller.deleteLandingZone(r -> r.landingZoneIdentifier(raw))).statusCode());
|
||||
}
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:*", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
denied(() -> caller.getLandingZone(r -> r.landingZoneIdentifier(raw)));
|
||||
denied(() -> caller.deleteLandingZone(r -> r.landingZoneIdentifier(raw)));
|
||||
}
|
||||
assertEquals(arn, admin.getLandingZone(r -> r.landingZoneIdentifier(arn)).landingZone().arn());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void landingZoneScopedAllowAcceptsIdAndArnButRefusesAnotherResource() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:GetLandingZone", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(arn, caller.getLandingZone(r -> r.landingZoneIdentifier(arn)).landingZone().arn());
|
||||
assertEquals(arn, caller.getLandingZone(r -> r.landingZoneIdentifier(
|
||||
AwsArnUtils.parse(arn).resource().substring("landingzone/".length()))).landingZone().arn());
|
||||
denied(() -> caller.getLandingZone(r -> r.landingZoneIdentifier("different")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void explicitResourceDenyPreventsLandingZoneDeletion() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
try (SignedIamUsers.User user = user("Deny", "controltower:DeleteLandingZone", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
denied(() -> caller.deleteLandingZone(r -> r.landingZoneIdentifier(arn)));
|
||||
assertEquals(arn, admin.getLandingZone(r -> r.landingZoneIdentifier(arn)).landingZone().arn());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void listRequiresWildcardGrant() throws Exception {
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:GetLandingZone", "*");
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
denied(() -> caller.listLandingZones(ListLandingZonesRequest.builder().build()));
|
||||
}
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:ListLandingZones", "*");
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(1, caller.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().size());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void generatedTagResourceUsesArnPathAndDenialPreservesTags() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:ListTagsForResource", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(admin.listTagsForResource(r -> r.resourceArn(arn)).tags(),
|
||||
caller.listTagsForResource(r -> r.resourceArn(arn)).tags());
|
||||
denied(() -> caller.tagResource(r -> r.resourceArn(arn).tags(Map.of("blocked", "yes"))));
|
||||
assertFalse(admin.listTagsForResource(r -> r.resourceArn(arn)).tags().containsKey("blocked"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void enabledControlResourceAllowAndDenyUseEnabledArnRatherThanCatalogArn() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String target = "arn:aws:organizations::000000000000:ou/o-test/ou-" + UUID.randomUUID();
|
||||
String arn = admin.enableControl(r -> r.controlIdentifier("arn:aws:controlcatalog:::control/fixture")
|
||||
.targetIdentifier(target)).arn();
|
||||
String before = admin.getEnabledControl(r -> r.enabledControlIdentifier(arn))
|
||||
.enabledControlDetails().statusSummary().lastOperationIdentifier();
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:GetEnabledControl", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(arn, caller.getEnabledControl(r -> r.enabledControlIdentifier(arn)).enabledControlDetails().arn());
|
||||
denied(() -> caller.getEnabledControl(r -> r.enabledControlIdentifier(arn + "other")));
|
||||
}
|
||||
try (SignedIamUsers.User user = user("Deny", "controltower:ResetEnabledControl", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
denied(() -> caller.resetEnabledControl(r -> r.enabledControlIdentifier(arn)));
|
||||
assertEquals(before, admin.getEnabledControl(r -> r.enabledControlIdentifier(arn))
|
||||
.enabledControlDetails().statusSummary().lastOperationIdentifier());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void enableControlChecksMintedResourceAndDenialDoesNotCreateControl() throws Exception {
|
||||
String target = "arn:aws:organizations::000000000000:ou/o-test/ou-" + UUID.randomUUID();
|
||||
String catalog = "arn:aws:controlcatalog:::control/fixture";
|
||||
String enabled = "arn:aws:controltower:us-east-1:000000000000:enabledcontrol/*";
|
||||
try (ControlTowerClient admin = client("test", "test");
|
||||
SignedIamUsers.User user = user("Deny", "controltower:EnableControl", enabled);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
denied(() -> caller.enableControl(r -> r.controlIdentifier(catalog).targetIdentifier(target)));
|
||||
assertEquals(0, admin.listEnabledControls(r -> r.targetIdentifier(target)).enabledControls().size());
|
||||
}
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:EnableControl", enabled);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
String arn = caller.enableControl(r -> r.controlIdentifier(catalog).targetIdentifier(target)).arn();
|
||||
AwsArnUtils.Arn parsed = AwsArnUtils.parse(arn);
|
||||
assertEquals(enabled.substring(0, enabled.length() - 1), new AwsArnUtils.Arn(parsed.partition(),
|
||||
parsed.service(), parsed.region(), parsed.accountId(), "enabledcontrol/").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void wildcardGrantStillReachesMissingResourceValidation() throws Exception {
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:GetEnabledControl", "*");
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(404, assertThrows(ControlTowerException.class, () -> caller.getEnabledControl(r ->
|
||||
r.enabledControlIdentifier("arn:aws:controltower:us-east-1:000000000000:enabledcontrol/missing")))
|
||||
.statusCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void enabledBaselineScopedGrantReachesItsHandler() throws Exception {
|
||||
String arn = "arn:aws:controltower:us-east-1:000000000000:enabledbaseline/missing";
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:GetEnabledBaseline", arn);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(404, assertThrows(ControlTowerException.class,
|
||||
() -> caller.getEnabledBaseline(r -> r.enabledBaselineIdentifier(arn))).statusCode());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void bareTagsReadsBodyArnAndKeepsScopedGrant() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:TagResource", arn)) {
|
||||
String body = "{\"resourceArn\":\"" + arn + "\",\"tags\":{\"bare\":\"yes\"}}";
|
||||
URI target = endpoint.resolve("/tags?resourceArn="
|
||||
+ URLEncoder.encode(arn + "-foreign", StandardCharsets.UTF_8));
|
||||
try {
|
||||
given().urlEncodingEnabled(false).headers(user.signer("controltower").headersFor("POST", target, Map.of(),
|
||||
body.getBytes(StandardCharsets.UTF_8)))
|
||||
.contentType("application/json").body(body).post(target).then().statusCode(200);
|
||||
assertEquals("yes", admin.listTagsForResource(r -> r.resourceArn(arn)).tags().get("bare"));
|
||||
} finally {
|
||||
admin.untagResource(r -> r.resourceArn(arn).tagKeys("bare"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void bareTagQueryRoutesIgnoreBodyAndRequireScopedQueryResource() throws Exception {
|
||||
try (ControlTowerClient admin = client("test", "test")) {
|
||||
String arn = admin.listLandingZones(ListLandingZonesRequest.builder().build()).landingZones().getFirst().arn();
|
||||
try (SignedIamUsers.User user = user("Allow", "controltower:*", arn)) {
|
||||
String body = "{\"resourceArn\":\"" + arn + "\"}";
|
||||
URI permitted = endpoint.resolve("/tags/?resourceArn=" + URLEncoder.encode(arn, StandardCharsets.UTF_8)
|
||||
+ "&tagKeys=bare-query");
|
||||
URI foreign = endpoint.resolve("/tags?resourceArn="
|
||||
+ URLEncoder.encode(arn + "-foreign", StandardCharsets.UTF_8) + "&tagKeys=bare-query");
|
||||
admin.tagResource(r -> r.resourceArn(arn).tags(Map.of("bare-query", "retained")));
|
||||
try {
|
||||
for (String method : new String[]{"GET", "DELETE"}) {
|
||||
for (URI denied : new URI[]{foreign, endpoint.resolve("/tags")}) {
|
||||
given().urlEncodingEnabled(false).headers(user.signer("controltower").headersFor(method, denied, Map.of(),
|
||||
body.getBytes(StandardCharsets.UTF_8)))
|
||||
.contentType("application/json").body(body).request(method, denied)
|
||||
.then().statusCode(403).body(containsString("not authorized to perform: controltower:"));
|
||||
}
|
||||
}
|
||||
assertEquals("retained", admin.listTagsForResource(r -> r.resourceArn(arn)).tags().get("bare-query"));
|
||||
for (String method : new String[]{"GET", "DELETE"}) {
|
||||
given().urlEncodingEnabled(false).headers(user.signer("controltower").headersFor(method, permitted, Map.of(), new byte[0]))
|
||||
.request(method, permitted).then().statusCode(200);
|
||||
}
|
||||
assertFalse(admin.listTagsForResource(r -> r.resourceArn(arn)).tags().containsKey("bare-query"));
|
||||
} finally {
|
||||
admin.untagResource(r -> r.resourceArn(arn).tagKeys("bare-query"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SignedIamUsers.User user(String effect, String action, String resource) throws Exception {
|
||||
String allow = "Deny".equals(effect) ? "{\"Effect\":\"Allow\",\"Action\":\"controltower:*\",\"Resource\":\"*\"}," : "";
|
||||
return SignedIamUsers.createUser(endpoint, "ct-generated-", "access",
|
||||
"{\"Version\":\"2012-10-17\",\"Statement\":[" + allow + "{\"Effect\":\"" + effect
|
||||
+ "\",\"Action\":\"" + action + "\",\"Resource\":\"" + resource + "\"}]}");
|
||||
}
|
||||
|
||||
private ControlTowerClient client(String key, String secret) {
|
||||
return AwsTestClients.create(ControlTowerClient.builder(), key, secret, Region.US_EAST_1, endpoint);
|
||||
}
|
||||
|
||||
private static void denied(Runnable request) {
|
||||
assertEquals(403, assertThrows(ControlTowerException.class, request::run).statusCode());
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
package io.floci.aws.services.controltower;
|
||||
|
||||
import io.floci.aws.testing.AwsTestClients;
|
||||
import io.floci.aws.testing.SignedIamEnforcementProfile;
|
||||
import io.floci.aws.testing.SignedIamUsers;
|
||||
import io.quarkus.test.common.http.TestHTTPResource;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.junit.TestProfile;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
import software.amazon.awssdk.core.document.Document;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.controltower.ControlTowerClient;
|
||||
import software.amazon.awssdk.services.controltower.model.ControlTowerException;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@QuarkusTest
|
||||
@TestProfile(SignedIamEnforcementProfile.class)
|
||||
class ControlTowerTagOnCreateIntegrationTest {
|
||||
|
||||
private static final Map<String, String> TAGS = Map.of("team", "blocked");
|
||||
private static final String CONTROL = "arn:aws:controlcatalog:::control/fixture";
|
||||
|
||||
@TestHTTPResource("/")
|
||||
URI endpoint;
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"missing", "create", "tag"})
|
||||
void landingZoneTagDenialPreventsCreation(String policy) throws Exception {
|
||||
String[] created = {null};
|
||||
try (ControlTowerClient admin = client("test", "test");
|
||||
SignedIamUsers.User user = user("CreateLandingZone", policy);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
try {
|
||||
assertEquals(403, assertThrows(ControlTowerException.class, () -> created[0] = caller.createLandingZone(r ->
|
||||
r.manifest(Document.fromMap(Map.of())).version("3.3").tags(TAGS)).arn()).statusCode());
|
||||
// A permitted create in the same scope proves the refused request stored no landing zone.
|
||||
created[0] = admin.createLandingZone(r -> r.manifest(Document.fromMap(Map.of()))
|
||||
.version("3.3").tags(TAGS)).arn();
|
||||
assertEquals(TAGS, admin.listTagsForResource(r -> r.resourceArn(created[0])).tags());
|
||||
} finally {
|
||||
if (created[0] != null) {
|
||||
admin.deleteLandingZone(r -> r.landingZoneIdentifier(created[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"missing", "create", "tag"})
|
||||
void enabledControlTagDenialPreventsCreation(String policy) throws Exception {
|
||||
String target = "arn:aws:organizations::000000000000:ou/o-test/ou-" + UUID.randomUUID();
|
||||
try (ControlTowerClient admin = client("test", "test");
|
||||
SignedIamUsers.User user = user("EnableControl", policy);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
assertEquals(403, assertThrows(ControlTowerException.class, () -> caller.enableControl(r ->
|
||||
r.controlIdentifier(CONTROL).targetIdentifier(target).tags(TAGS))).statusCode());
|
||||
assertEquals(0, admin.listEnabledControls(r -> r.targetIdentifier(target)).enabledControls().size());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void landingZoneAllowsTagsWithBothPermissionsAndNeedsNoTagPermissionWithoutTags() throws Exception {
|
||||
for (String policy : new String[]{"allow", "missing"}) {
|
||||
Map<String, String> tags = "allow".equals(policy) ? TAGS : Map.of();
|
||||
try (ControlTowerClient admin = client("test", "test");
|
||||
SignedIamUsers.User user = user("CreateLandingZone", policy);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
String arn = caller.createLandingZone(r -> r.manifest(Document.fromMap(Map.of()))
|
||||
.version("3.3").tags(tags)).arn();
|
||||
try {
|
||||
assertEquals(tags, admin.listTagsForResource(r -> r.resourceArn(arn)).tags());
|
||||
} finally {
|
||||
admin.deleteLandingZone(r -> r.landingZoneIdentifier(arn));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void enabledControlAllowsTagsWithBothPermissionsAndNeedsNoTagPermissionWithoutTags() throws Exception {
|
||||
for (String policy : new String[]{"allow", "missing"}) {
|
||||
Map<String, String> tags = "allow".equals(policy) ? TAGS : Map.of();
|
||||
String target = "arn:aws:organizations::000000000000:ou/o-test/ou-" + UUID.randomUUID();
|
||||
try (ControlTowerClient admin = client("test", "test");
|
||||
SignedIamUsers.User user = user("EnableControl", policy);
|
||||
ControlTowerClient caller = client(user.accessKeyId(), user.secretAccessKey())) {
|
||||
String arn = caller.enableControl(r -> r.controlIdentifier(CONTROL).targetIdentifier(target).tags(tags)).arn();
|
||||
// DisableControl is not served; these unique in-memory targets die with the test application.
|
||||
assertEquals(tags, admin.listTagsForResource(r -> r.resourceArn(arn)).tags());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private SignedIamUsers.User user(String operation, String mode) throws Exception {
|
||||
String actions = "\"controltower:" + operation + "\""
|
||||
+ ("missing".equals(mode) ? "" : ",\"controltower:TagResource\"");
|
||||
String deny = "create".equals(mode) || "tag".equals(mode)
|
||||
? ",{\"Effect\":\"Deny\",\"Action\":\"controltower:"
|
||||
+ ("create".equals(mode) ? operation : "TagResource") + "\",\"Resource\":\"*\","
|
||||
+ "\"Condition\":{\"StringEquals\":{\"aws:RequestTag/team\":\"blocked\"}}}" : "";
|
||||
return SignedIamUsers.createUser(endpoint, "ct-create-tags-", "access",
|
||||
"{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[" + actions
|
||||
+ "],\"Resource\":\"*\"}" + deny + "]}");
|
||||
}
|
||||
|
||||
private ControlTowerClient client(String key, String secret) {
|
||||
return AwsTestClients.create(ControlTowerClient.builder(), key, secret, Region.AP_SOUTHEAST_2, endpoint);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,32 @@ class IamRestRoutesTest {
|
||||
}}
|
||||
}}""";
|
||||
|
||||
@ParameterizedTest
|
||||
@ValueSource(strings = {"controltower", "signer"})
|
||||
void sharedTagAlternativesCarryMemberLocations(String scope) {
|
||||
IamRestRoutes vendored = IamRestRoutes.vendored();
|
||||
Map<String, String> operations = Map.of("POST", "TagResource", "GET", "ListTagsForResource",
|
||||
"DELETE", "UntagResource");
|
||||
operations.forEach((method, operation) -> {
|
||||
IamRestRoutes.Match bare = vendored.match(scope, method, "/tags/", null).orElseThrow();
|
||||
assertEquals(operation, bare.operation());
|
||||
assertEquals(Map.of(), bare.labels());
|
||||
assertEquals(Map.of("resourceArn", "POST".equals(method) ? "body" : "?resourceArn"), bare.located());
|
||||
IamRestRoutes.Match path = vendored.match(scope, method, "/tags/arn%3Aresource%2Fitem", null).orElseThrow();
|
||||
assertEquals(operation, path.operation());
|
||||
assertEquals(Map.of("resourceArn", "arn:resource/item"), path.labels());
|
||||
assertEquals(Map.of(), path.located());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void malformedAlternativeMemberSourceIsRejected() {
|
||||
String alternative = ROUTES.replace("\"requestUri\": \"/things/\"",
|
||||
"\"requestUri\": \"/things/\", \"alternatives\": [{\"requestUri\": \"/other\", "
|
||||
+ "\"located\": {\"member\": \"header\"}}]");
|
||||
assertThrows(IllegalStateException.class, () -> routes(alternative));
|
||||
}
|
||||
|
||||
private final IamRestRoutes routes = routes(ROUTES);
|
||||
|
||||
@Test
|
||||
|
||||
@@ -22,7 +22,8 @@ on, the request names a resource when one of its top-level members holds a strin
|
||||
strings, or, for an ARN, a member of a structure or of each element of a list of structures does
|
||||
(`SetRulePriorities`' `RulePriorities[].RuleArn`), and:
|
||||
|
||||
- holds the resource's ARN: its name ends in `Arn` or `Arns`. Any of the action's types may be the
|
||||
- holds the resource's ARN: its name ends in `Arn` or `Arns`, or it is an Identifier whose modeled
|
||||
pattern only accepts an ARN. Any of the action's types may be the
|
||||
one it holds (`ResourceArn` holds whatever the action acts on, `RuleArn` a `listener-rule/app`),
|
||||
and a value names a resource of a type when it matches the type's ARN format, so an ARN of
|
||||
something the action does not act on is not checked.
|
||||
@@ -164,7 +165,7 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json"
|
||||
# are the ones its handlers mint.
|
||||
NAMESPACES = ("access-analyzer", "acm", "application-autoscaling", "athena", "bcm-data-exports",
|
||||
"bcm-pricing-calculator", "budgets", "ce", "cloudtrail", "codebuild", "codepipeline", "cognito-identity",
|
||||
"cognito-idp", "cur", "datasync", "ec2", "ecr", "elasticloadbalancing", "elasticmapreduce", "es", "events",
|
||||
"cognito-idp", "controltower", "cur", "datasync", "ec2", "ecr", "elasticloadbalancing", "elasticmapreduce", "es", "events",
|
||||
"firehose", "globalaccelerator", "kinesisanalytics", "payment-cryptography", "quicksight", "redshift",
|
||||
"redshift-data", "rekognition", "servicediscovery", "servicequotas", "sso", "states", "textract",
|
||||
"timestream-influxdb", "translate", "signer")
|
||||
@@ -235,7 +236,6 @@ NOT_COVERED: dict[str, str] = {
|
||||
"config": _LATER,
|
||||
"connect": _REST,
|
||||
"controlcatalog": _REST,
|
||||
"controltower": _REST,
|
||||
"detective": _REST,
|
||||
"dlm": _REST,
|
||||
"dms": _LATER,
|
||||
@@ -581,40 +581,6 @@ CORRECTIONS: dict[str, tuple[list[dict], str]] = {
|
||||
"Name (ARN) to which you want to add the tag or tags'), whose name does not end in "
|
||||
"Arn")
|
||||
for operation in ("CreateTags", "DeleteTags", "DescribeTags")},
|
||||
**{f"redshift:{operation}": ([{"type": kind, "fill": fill}], f"{why}, never a {kind}'s")
|
||||
for operation, kind, fill, why in (
|
||||
("CreateCluster", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its DefaultIamRoleArn is an IAM role's ARN and its RedshiftIdcApplicationArn an IAM Identity Center "
|
||||
"application's"),
|
||||
("CreateCustomDomainAssociation", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its CustomDomainCertificateArn is an ACM certificate's ARN"),
|
||||
("CreateEventSubscription", "eventsubscription", {"EventSubscriptionName": "SubscriptionName"},
|
||||
"its SnsTopicArn is an SNS topic's ARN"),
|
||||
("CreateIntegration", "integration", {},
|
||||
"its SourceArn is the source database's ARN and its TargetArn the target data warehouse's"),
|
||||
("DescribeClusterSnapshots", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its SnapshotArn is a snapshot's ARN"),
|
||||
("DescribeNodeConfigurationOptions", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its SnapshotArn is a snapshot's ARN"),
|
||||
("ListRecommendations", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its NamespaceArn is a namespace's ARN"),
|
||||
("ModifyClusterIamRoles", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its DefaultIamRoleArn is an IAM role's ARN"),
|
||||
("ModifyCustomDomainAssociation", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its CustomDomainCertificateArn is an ACM certificate's ARN"),
|
||||
("ModifyEventSubscription", "eventsubscription", {"EventSubscriptionName": "SubscriptionName"},
|
||||
"its SnsTopicArn is an SNS topic's ARN"),
|
||||
("ModifyLakehouseConfiguration", "cluster", {"ClusterName": "ClusterIdentifier"},
|
||||
"its LakehouseIdcApplicationArn is an IAM Identity Center application's ARN"))},
|
||||
**{f"redshift:{operation}": ([{"types": [kind], "arn": arn}], f"{why}, never a {kind}'s")
|
||||
for operation, kind, arn, why in (
|
||||
("AssociateDataShareConsumer", "datashare", "DataShareArn",
|
||||
"its ConsumerArn is the consumer namespace's ARN"),
|
||||
("DisassociateDataShareConsumer", "datashare", "DataShareArn",
|
||||
"its ConsumerArn is the consumer namespace's ARN"),
|
||||
("ModifyRedshiftIdcApplication", "redshiftidcapplication", "RedshiftIdcApplicationArn",
|
||||
"its IamRoleArn is an IAM role's ARN and its AuthorizedTokenIssuerList's TrustedTokenIssuerArn a trusted "
|
||||
"token issuer's"))},
|
||||
}
|
||||
|
||||
# Resource types whose ARN a request may give with a qualifier, one more `:<name>` past its format, which their
|
||||
@@ -686,7 +652,7 @@ BARE = {"name", "names", "id", "ids", "identifier", "identifiers"}
|
||||
# The patterns botocore gives a string shape that holds an account id.
|
||||
ACCOUNT_ID_PATTERNS = {"[0-9]{12}", "^[0-9]{12}$", r"\d{12}", r"^\d{12}$"}
|
||||
# The verbs an operation that creates the resource it is named after starts with.
|
||||
CREATING_RE = re.compile(r"^(Create|Run|Allocate|Register|Put|Import|Copy|Request|Start|Add)")
|
||||
CREATING_RE = re.compile(r"^(Create|Run|Allocate|Register|Put|Import|Copy|Request|Start|Add|Enable)")
|
||||
# An operation's verb: what follows is what it acts on.
|
||||
SUBJECT_RE = re.compile(r"^[A-Z][a-z]+")
|
||||
# The protocols whose requests RequestResources reads: form parameters or a JSON or CBOR body.
|
||||
@@ -777,6 +743,49 @@ def request_members(models: dict[str, dict], operation: str) -> dict[str, str]:
|
||||
return found
|
||||
|
||||
|
||||
def string_patterns(models: dict[str, dict], operation: str) -> dict[str, set[str | None]]:
|
||||
"""Patterns of each top-level string member, including list elements, across the request's clients."""
|
||||
found: dict[str, set[str | None]] = {}
|
||||
for model in models.values():
|
||||
spec = model["operations"].get(operation)
|
||||
if spec is None or "input" not in spec or not READ_PROTOCOLS & _protocols(model):
|
||||
continue
|
||||
for name, member in model["shapes"][spec["input"]["shape"]].get("members", {}).items():
|
||||
if member.get("location") not in BODY_LOCATIONS and _located(member) is None:
|
||||
continue
|
||||
shape = model["shapes"][member["shape"]]
|
||||
if _strings(model, shape) is None:
|
||||
continue
|
||||
element = model["shapes"][shape["member"]["shape"]] if shape["type"] == "list" else shape
|
||||
found.setdefault(name, set()).add(element.get("pattern"))
|
||||
return found
|
||||
|
||||
|
||||
def only_arn(pattern: str | None) -> bool:
|
||||
"""A required ARN prefix, with no top-level alternative that could instead name another value."""
|
||||
if not pattern or not re.match(r"^\^?arn:", pattern):
|
||||
return False
|
||||
depth = 0
|
||||
in_class = False
|
||||
escaped = False
|
||||
for char in pattern:
|
||||
if escaped:
|
||||
escaped = False
|
||||
elif char == "\\":
|
||||
escaped = True
|
||||
elif in_class:
|
||||
in_class = char != "]"
|
||||
elif char == "[":
|
||||
in_class = True
|
||||
elif char == "(":
|
||||
depth += 1
|
||||
elif char == ")":
|
||||
depth -= 1
|
||||
elif char == "|" and depth == 0:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def located_members(models: dict[str, dict], operation: str) -> dict[str, str]:
|
||||
"""The members of a REST request that its path or its query carries, holding a string, by name, with where:
|
||||
`{Label}` for a label of its path, `?name` for a parameter of its query. The reader lays them over the request's
|
||||
@@ -958,12 +967,14 @@ def compatible(member: str, variable: str) -> bool:
|
||||
return not member_kind or not variable_kind or member_kind == variable_kind or member_kind == "identifier"
|
||||
|
||||
|
||||
def resources_for(operation: str, types: list[str], formats: dict[str, str], members: dict[str, str]) -> list[dict]:
|
||||
def resources_for(operation: str, types: list[str], formats: dict[str, str], members: dict[str, str],
|
||||
arn_members: set[str] | None = None) -> list[dict]:
|
||||
"""The resources the rule finds the operation's request naming, as vendored entries."""
|
||||
name = operation.split(":", 1)[1]
|
||||
created = stem(CREATING_RE.sub("", name)) if CREATING_RE.match(name) else None
|
||||
subject = stem(SUBJECT_RE.sub("", name))
|
||||
arns = {member: path for member, path in members.items() if re.search(r"arns?$", member, re.IGNORECASE)}
|
||||
arns = {member: path for member, path in members.items() if re.search(r"arns?$", member, re.IGNORECASE)
|
||||
or member in (arn_members or set())}
|
||||
names = {member: path for member, path in members.items() if member not in arns}
|
||||
by_arn: dict[str, list[str]] = {}
|
||||
filled: dict[str, dict[str, str]] = {}
|
||||
@@ -978,7 +989,8 @@ def resources_for(operation: str, types: list[str], formats: dict[str, str], mem
|
||||
# A top-level ARN member named for the type, or for whatever the action acts on, holds it, and a bare
|
||||
# name then names something else.
|
||||
held = [member for member in arns if "." not in member and (stem(member) in ("", "resource")
|
||||
or related(stem(member), kind_stem) or kind_stem.startswith(stem(member)))]
|
||||
or (stem(member) == kind_stem if member in (arn_members or set())
|
||||
else related(stem(member), kind_stem) or kind_stem.startswith(stem(member))))]
|
||||
variables = [v for v in VARIABLE_RE.findall(formats[kind]) if v not in KNOWN_VARIABLES]
|
||||
fill: dict[str, str] = {}
|
||||
for variable in sorted(variables, key=lambda v: (kind_of(v) == "", v)):
|
||||
@@ -1166,6 +1178,9 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d
|
||||
"""What the file says for one operation."""
|
||||
types = upstream["types"] or []
|
||||
members = request_members(models, operation.split(":", 1)[1])
|
||||
patterns = string_patterns(models, operation.split(":", 1)[1])
|
||||
arn_members = {member for member, values in patterns.items() if kind_of(member) == "identifier"
|
||||
and all(only_arn(value) for value in values)}
|
||||
if namespace_of(operation) in ID_TARGETS:
|
||||
entry = {"action": upstream["action"], "types": types, "resources": []}
|
||||
targets = id_targets(operation, types, formats, models)
|
||||
@@ -1180,7 +1195,7 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d
|
||||
raise ValueError(f"CORRECTIONS serves {operation} on {sorted(unknown)}, no endpoint prefix of the clients "
|
||||
f"it reads ({sorted(endpoints)})")
|
||||
else:
|
||||
resources = with_through(with_found(with_parent_ids(resources_for(operation, types, formats, members),
|
||||
resources = with_through(with_found(with_parent_ids(resources_for(operation, types, formats, members, arn_members),
|
||||
formats, types, members),
|
||||
namespace_of(operation), types, members),
|
||||
namespace_of(operation), types, members)
|
||||
|
||||
@@ -106,7 +106,7 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-tag-on-create.json"
|
||||
NAMESPACES = (
|
||||
"access-analyzer", "acm", "application-autoscaling", "athena", "autoscaling", "bcm-data-exports",
|
||||
"bcm-pricing-calculator", "budgets", "ce", "cloudformation", "cloudhsm", "cloudtrail", "cloudwatch",
|
||||
"codedeploy", "codepipeline", "cognito-identity", "cognito-idp", "comprehend", "config", "cur", "datasync",
|
||||
"codedeploy", "codepipeline", "cognito-identity", "cognito-idp", "comprehend", "config", "controltower", "cur", "datasync",
|
||||
"dms", "dsql", "dynamodb", "ec2", "ecr", "ecs", "eks", "elasticache", "elasticloadbalancing",
|
||||
"elasticmapreduce", "es", "events", "firehose", "globalaccelerator", "glue", "iam", "kinesis", "kinesisanalytics",
|
||||
"kms", "lambda", "lightsail", "logs", "memorydb", "network-firewall", "organizations", "payment-cryptography",
|
||||
@@ -123,7 +123,7 @@ NOT_COVERED = {
|
||||
"aps": _NO_ROUTES, "aws-marketplace": _NO_ROUTES, "backup": _NO_ROUTES,
|
||||
"batch": _NO_ROUTES, "bedrock": _NO_ROUTES, "bedrock-agentcore": _NO_ROUTES,
|
||||
"cloudfront": _NO_ROUTES, "codeguru-reviewer": _NO_ROUTES, "connect": _NO_ROUTES,
|
||||
"controltower": _NO_ROUTES, "detective": _NO_ROUTES, "dlm": _NO_ROUTES,
|
||||
"detective": _NO_ROUTES, "dlm": _NO_ROUTES,
|
||||
"elasticfilesystem": _NO_ROUTES, "emr-serverless": _NO_ROUTES, "fis": _NO_ROUTES,
|
||||
"guardduty": _NO_ROUTES, "inspector2": _NO_ROUTES, "iot": _NO_ROUTES, "kafka": _NO_ROUTES,
|
||||
"macie2": _NO_ROUTES, "mq": _NO_ROUTES, "oam": _NO_ROUTES,
|
||||
|
||||
@@ -12,7 +12,9 @@ request on each route and compares the action the registry gives with that one.
|
||||
The credential scopes in `HAND_ROUTED` are authorized by the registry's rules alone, each for its
|
||||
reason, and their routes are vendored for the coverage test only. Within any other scope, two
|
||||
operations on one route would leave a request matching it no single operation, so the generation
|
||||
fails on them.
|
||||
fails on them. Supported shared-controller alternatives are generated beside the modeled URI, with
|
||||
member-location overrides for the bare route. These alternatives describe existing Floci compatibility
|
||||
paths, not additional botocore operations.
|
||||
|
||||
The models are botocore's `<model>/<apiVersion>/service-2.json` (Apache-2.0,
|
||||
https://github.com/boto/botocore), the latest API version of each, located as
|
||||
@@ -52,6 +54,7 @@ MODELS: dict[str, str] = {
|
||||
"accessanalyzer": "access-analyzer",
|
||||
"apigateway": "apigateway",
|
||||
"apigatewayv2": "apigateway",
|
||||
"controltower": "controltower",
|
||||
"dsql": "dsql",
|
||||
"eks": "eks",
|
||||
"es": "es",
|
||||
@@ -89,6 +92,7 @@ INTERNAL_ROUTES: dict[str, tuple[str, bool]] = {
|
||||
# the service's route filter leaves that path alone; prefixing it here would advertise a route no
|
||||
# request ever arrives on, and the IAM check would find no rule for it.
|
||||
SHARED_ROUTES: dict[str, frozenset[str]] = {
|
||||
"controltower": frozenset({"TagResource", "UntagResource", "ListTagsForResource"}),
|
||||
"signer": frozenset({"TagResource", "UntagResource", "ListTagsForResource"}),
|
||||
}
|
||||
|
||||
@@ -134,7 +138,13 @@ def build(models: dict[str, dict], provenance: str) -> dict:
|
||||
# A label holding an ARN spans the slashes the ARN holds, which the rewritten path
|
||||
# holds as they are.
|
||||
request_uri = re.sub(r"\{([^}]+)\}", r"{\1+}", request_uri)
|
||||
operations[operation] = {"method": http["method"], "requestUri": request_uri}
|
||||
route = {"method": http["method"], "requestUri": request_uri}
|
||||
if operation in shared:
|
||||
# SharedTagsController also serves the bare path, reading POST's body and
|
||||
# GET/DELETE's query. Keep that compatibility route and its member source together.
|
||||
route["alternatives"] = [{"requestUri": "/tags", "located": {
|
||||
"resourceArn": "body" if http["method"] == "POST" else "?resourceArn"}}]
|
||||
operations[operation] = route
|
||||
routes[name] = {
|
||||
"credentialScope": MODELS[name],
|
||||
"apiVersion": model["metadata"]["apiVersion"],
|
||||
@@ -176,8 +186,9 @@ def shared_routes(routes: dict[str, dict]) -> list[str]:
|
||||
if model["credentialScope"] in HAND_ROUTED:
|
||||
continue
|
||||
for operation, route in model["operations"].items():
|
||||
key = (model["credentialScope"],) + route_key(route["method"], route["requestUri"])
|
||||
named.setdefault(key, set()).add(operation)
|
||||
for variant in [route, *route.get("alternatives", [])]:
|
||||
key = (model["credentialScope"],) + route_key(route["method"], variant["requestUri"])
|
||||
named.setdefault(key, set()).add(operation)
|
||||
return [f"{key[0]} {key[1]} {'/'.join(key[2])}: {', '.join(sorted(operations))}"
|
||||
for key, operations in sorted(named.items()) if len(operations) > 1]
|
||||
|
||||
|
||||
@@ -595,10 +595,12 @@ def test_every_correction_is_the_vendored_entry_of_an_operation_the_file_reads()
|
||||
assert r.CORRECTIONS
|
||||
for operation, (resources, reason) in r.CORRECTIONS.items():
|
||||
assert operation in operations and reason, operation
|
||||
# A resource's account and the ARNs its members may give are botocore's, and whether a create makes it the
|
||||
# rule's, on top of the correction.
|
||||
assert [{key: value for key, value in resource.items() if key not in ("account", "arnOf", "made")}
|
||||
for resource in operations[operation]["resources"]] == resources, operation
|
||||
# Derived metadata may extend a correction; metadata explicitly supplied by the correction must survive.
|
||||
actual = operations[operation]["resources"]
|
||||
assert len(actual) == len(resources), operation
|
||||
for resource, correction in zip(actual, resources, strict=True):
|
||||
assert {key: value for key, value in resource.items()
|
||||
if key not in ("account", "arnOf", "made") or key in correction} == correction, operation
|
||||
|
||||
|
||||
def test_a_correction_gives_the_operation_its_resources(corrections):
|
||||
@@ -902,3 +904,82 @@ def test_id_targets_reject_unknown_types_ambiguous_prefixes_and_malformed_member
|
||||
invalid = copy.deepcopy(document)
|
||||
invalid["operations"]["ec2:CreateTags"]["targets"][field] = value
|
||||
assert r.validate(invalid), (field, value)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("operation", [
|
||||
"GetLandingZone", "UpdateLandingZone", "DeleteLandingZone", "ResetLandingZone",
|
||||
"GetBaseline", "GetEnabledBaseline", "UpdateEnabledBaseline", "ResetEnabledBaseline", "DisableBaseline",
|
||||
"GetEnabledControl", "UpdateEnabledControl", "ResetEnabledControl", "DisableControl", "EnableControl",
|
||||
])
|
||||
def test_controltower_entries_are_derived_without_operation_corrections(operation):
|
||||
from regen_partitions import resolve_botocore_data
|
||||
|
||||
key = "controltower:" + operation
|
||||
assert key not in r.CORRECTIONS
|
||||
document = json.loads(r.OUTPUT.read_text())
|
||||
data, _ = resolve_botocore_data(None)
|
||||
model = r.load_models(data, {"controltower"})
|
||||
expected = document["operations"][key]
|
||||
assert r.entry_for(key, {"action": expected["action"], "types": expected["types"]},
|
||||
document["arnFormats"]["controltower"], model) == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize("pattern, expected", [
|
||||
(None, False), ("", False), ("arn:aws:service:.*", True),
|
||||
(r"^arn:(aws|aws-cn):service:[a-z0-9-]+:.*$", True),
|
||||
(r"arn:aws:service:[a|b]+", True), (r"arn:aws:service:foo\|bar", True),
|
||||
(r"^arn:aws:service:.*$|plain-name", False),
|
||||
(r"(arn:aws:service:.*)?plain-name", False),
|
||||
])
|
||||
def test_arn_only_patterns_distinguish_nested_and_top_level_alternatives(pattern, expected):
|
||||
assert r.only_arn(pattern) is expected
|
||||
|
||||
|
||||
def test_arn_only_identifier_never_fills_a_different_resource_id():
|
||||
formats = {"EnabledControl": "arn:${Partition}:svc:${Region}:${Account}:enabledcontrol/${EnabledControlId}"}
|
||||
result = r.resources_for("svc:EnableControl", ["EnabledControl"], formats,
|
||||
{"controlIdentifier": "controlIdentifier"}, {"controlIdentifier"})
|
||||
assert result == [{"types": ["EnabledControl"], "arn": "controlIdentifier"},
|
||||
{"type": "EnabledControl", "fill": {}}]
|
||||
|
||||
|
||||
def test_explicit_arn_member_set_is_respected_by_resource_mapping():
|
||||
formats = {"pool": "arn:${Partition}:svc:${Region}:${Account}:pool/${PoolId}"}
|
||||
assert r.resources_for("svc:ReadPool", ["pool"], formats,
|
||||
{"opaqueReference": "opaqueReference"}, {"opaqueReference"}) == [
|
||||
{"types": ["pool"], "arn": "opaqueReference"}]
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("member", ["opaqueReference", "targetApplicationArn", "applicationArn"])
|
||||
def test_arn_pattern_does_not_turn_unrelated_members_into_identifiers(member):
|
||||
model = {
|
||||
"metadata": {"protocol": "json", "endpointPrefix": "svc"},
|
||||
"operations": {"ReadPool": {"input": {"shape": "Input"}}},
|
||||
"shapes": {"Input": {"type": "structure", "members": {member: {"shape": "Value"}}},
|
||||
"Value": {"type": "string", "pattern": "arn:.*"}},
|
||||
}
|
||||
formats = {"pool": "arn:${Partition}:svc:${Region}:${Account}:pool/${PoolId}"}
|
||||
entry = r.entry_for("svc:ReadPool", {"action": "svc:ReadPool", "types": ["pool"]}, formats, {"svc": model})
|
||||
assert entry["resources"] == r.resources_for("svc:ReadPool", ["pool"], formats, {member: member})
|
||||
|
||||
|
||||
def test_no_inferred_identifier_metadata_or_withdrawn_redshift_rows():
|
||||
document = json.loads(r.OUTPUT.read_text())
|
||||
resource = document["operations"]["redshift:DescribeClusters"]["resources"][0]
|
||||
assert "arnOf" not in resource
|
||||
assert "redshift:CreateCluster" not in r.CORRECTIONS
|
||||
assert "redshift:AssociateDataShareConsumer" not in r.CORRECTIONS
|
||||
|
||||
|
||||
def test_sso_access_scope_does_not_authorize_target_applications():
|
||||
from regen_partitions import resolve_botocore_data
|
||||
|
||||
document = json.loads(r.OUTPUT.read_text())
|
||||
data, _ = resolve_botocore_data(None)
|
||||
operation = "sso:PutApplicationAccessScope"
|
||||
entry = document["operations"][operation]
|
||||
models = r.load_models(data, set(document["namespaces"]["sso"]))
|
||||
derived = r.entry_for(operation, {"action": entry["action"], "types": entry["types"]},
|
||||
document["arnFormats"]["sso"], models)
|
||||
assert derived["resources"] == [{"types": ["Application"], "arn": "ApplicationArn"}]
|
||||
@@ -125,3 +125,23 @@ def test_models_sharing_a_scope_must_agree_on_the_denial_status():
|
||||
service["shapes"] = {"AccessDeniedException": {"error": {"httpStatusCode": status}}}
|
||||
with pytest.raises(SystemExit, match="conflicting access-denied HTTP statuses"):
|
||||
r.build({"lambda": first, "lambda-microvms": second}, "botocore test")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name", ["controltower", "signer"])
|
||||
@pytest.mark.parametrize("operation,method,source", [
|
||||
("TagResource", "POST", "body"),
|
||||
("UntagResource", "DELETE", "?resourceArn"),
|
||||
("ListTagsForResource", "GET", "?resourceArn"),
|
||||
])
|
||||
def test_shared_tag_alternative_keeps_actual_member_source(name, operation, method, source):
|
||||
doc = r.build({name: model("rest-json", "2020-01-01", **{operation: (method, "/tags/{resourceArn}")})}, "test")
|
||||
route = doc["models"][name]["operations"][operation]
|
||||
assert route["requestUri"] == "/tags/{resourceArn+}"
|
||||
assert route["alternatives"] == [{"requestUri": "/tags", "located": {"resourceArn": source}}]
|
||||
assert json.loads(r.render(doc)) == doc
|
||||
|
||||
|
||||
def test_shared_tag_alternative_collision_is_rejected():
|
||||
with pytest.raises(SystemExit, match="one route names more than one operation"):
|
||||
r.build({"controltower": model("rest-json", "2020-01-01",
|
||||
TagResource=("POST", "/tags/{resourceArn}"), OtherOperation=("POST", "/tags"))}, "test")
|
||||
Reference in new issue
Block a user