mirror of
https://github.com/floci-io/floci.git
synced 2026-11-28 16:11:48 -05:00
test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41 remaining entries all pinned commercial values: ARNs built as arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones, hosts and filter strings, and clients or signers created for us-east-1 next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests signed their tokens for us-east-1, OrganizationsTest built its invited account's client for us-east-1, Route53Test associated VPCs as us-east-1 that live in the fixture region, and SesEventPublishingTest failed in setup on a us-east-1 event bus ARN. All 33 classes now derive those values from TestFixtures, so the allowlist is empty: any failure in the China nightly fails the run.
This commit is contained in:
1 parent
7ff3363899
commit
fde5170335
34 files changed
+99
-142
No files matched your search
@@ -106,7 +106,7 @@ class AcmTest {
|
||||
arnsToCleanup.add(requestedCertArn);
|
||||
|
||||
assertThat(requestedCertArn).isNotNull();
|
||||
assertThat(requestedCertArn).matches("arn:aws:acm:.*:.*:certificate/.*");
|
||||
assertThat(requestedCertArn).matches("arn:" + TestFixtures.partition() + ":acm:.*:.*:certificate/.*");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -216,7 +216,7 @@ class AcmTest {
|
||||
arnsToCleanup.add(importedCertArn);
|
||||
|
||||
assertThat(importedCertArn).isNotNull();
|
||||
assertThat(importedCertArn).matches("arn:aws:acm:.*:.*:certificate/.*");
|
||||
assertThat(importedCertArn).matches("arn:" + TestFixtures.partition() + ":acm:.*:.*:certificate/.*");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -344,7 +344,7 @@ class AcmTest {
|
||||
@Order(40)
|
||||
@DisplayName("Describe a non-existent certificate throws exception")
|
||||
void testDescribeNonExistentCertificate() {
|
||||
String fakeArn = "arn:aws:acm:us-east-1:000000000000:certificate/00000000-0000-0000-0000-000000000000";
|
||||
String fakeArn = TestFixtures.arn("acm", "000000000000", "certificate/00000000-0000-0000-0000-000000000000");
|
||||
|
||||
assertThatThrownBy(() -> acm.describeCertificate(b -> b
|
||||
.certificateArn(fakeArn)))
|
||||
|
||||
+4
-3
@@ -29,6 +29,7 @@ class ApiGatewayOpenApiImportCompatibilityTest {
|
||||
@DisplayName("ImportRestApi and PutRestApi resolve AWS variables through the SDK")
|
||||
void sdkImportAndPutResolveAwsVariables() {
|
||||
String title = TestFixtures.uniqueName("apigw-variable-import");
|
||||
String region = TestFixtures.region().id();
|
||||
try (ApiGatewayClient apiGateway = TestFixtures.apiGatewayClient()) {
|
||||
ImportRestApiResponse imported = apiGateway.importRestApi(request -> request
|
||||
.body(SdkBytes.fromUtf8String(variableSpec(title, "${AWS::Region}"))));
|
||||
@@ -37,11 +38,11 @@ class ApiGatewayOpenApiImportCompatibilityTest {
|
||||
GetIntegrationResponse integration = apiGateway.getIntegration(request -> request
|
||||
.restApiId(imported.id()).resourceId(initialId).httpMethod("POST"));
|
||||
assertThat(integration.uri())
|
||||
.isEqualTo("arn:aws:apigateway:us-east-1:states:action/StartExecution");
|
||||
.isEqualTo(TestFixtures.arn("apigateway", "states", "action/StartExecution"));
|
||||
assertThat(integration.requestTemplates())
|
||||
.containsEntry("application/json", "{\"value\":\"us-east-1\"}");
|
||||
.containsEntry("application/json", "{\"value\":\"" + region + "\"}");
|
||||
assertThat(integration.requestParameters())
|
||||
.containsEntry("integration.request.header.X-Region", "'us-east-1'");
|
||||
.containsEntry("integration.request.header.X-Region", "'" + region + "'");
|
||||
assertThat(apiGateway.getGatewayResponse(request -> request
|
||||
.restApiId(imported.id()).responseType(GatewayResponseType.UNAUTHORIZED))
|
||||
.responseTemplates())
|
||||
|
||||
+8
-3
@@ -8,6 +8,7 @@ import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
import software.amazon.awssdk.regions.RegionMetadata;
|
||||
import software.amazon.awssdk.services.apigatewayv2.ApiGatewayV2Client;
|
||||
import software.amazon.awssdk.services.apigatewayv2.model.ApiGatewayV2Exception;
|
||||
import software.amazon.awssdk.services.apigatewayv2.model.AuthorizerType;
|
||||
@@ -74,6 +75,7 @@ class ApiGatewayV2ManagementTest {
|
||||
private static String routeId;
|
||||
private static String deploymentId;
|
||||
private static final String stageName = "test";
|
||||
private static final String HANDLER_ARN = TestFixtures.arn("lambda", "000000000000", "function:phase2-handler");
|
||||
private static boolean stageCreated;
|
||||
|
||||
@BeforeAll
|
||||
@@ -126,7 +128,10 @@ class ApiGatewayV2ManagementTest {
|
||||
assertThat(apiId).isNotBlank();
|
||||
assertThat(response.name()).startsWith("http-api-");
|
||||
assertThat(response.protocolType()).isEqualTo(ProtocolType.HTTP);
|
||||
assertThat(response.apiEndpoint()).contains(apiId + ".execute-api.us-east-1.amazonaws.com");
|
||||
RegionMetadata metadata = TestFixtures.region().metadata();
|
||||
String dnsSuffix = metadata == null ? "amazonaws.com" : metadata.partition().dnsSuffix();
|
||||
assertThat(response.apiEndpoint())
|
||||
.contains(apiId + ".execute-api." + TestFixtures.region().id() + "." + dnsSuffix);
|
||||
assertThat(response.createdDate()).isNotNull();
|
||||
}
|
||||
|
||||
@@ -204,7 +209,7 @@ class ApiGatewayV2ManagementTest {
|
||||
CreateIntegrationResponse response = apigwv2.createIntegration(CreateIntegrationRequest.builder()
|
||||
.apiId(apiId)
|
||||
.integrationType(IntegrationType.AWS_PROXY)
|
||||
.integrationUri("arn:aws:lambda:us-east-1:000000000000:function:phase2-handler")
|
||||
.integrationUri(HANDLER_ARN)
|
||||
.payloadFormatVersion("2.0")
|
||||
.build());
|
||||
|
||||
@@ -212,7 +217,7 @@ class ApiGatewayV2ManagementTest {
|
||||
|
||||
assertThat(integrationId).isNotBlank();
|
||||
assertThat(response.integrationType()).isEqualTo(IntegrationType.AWS_PROXY);
|
||||
assertThat(response.integrationUri()).isEqualTo("arn:aws:lambda:us-east-1:000000000000:function:phase2-handler");
|
||||
assertThat(response.integrationUri()).isEqualTo(HANDLER_ARN);
|
||||
assertThat(response.payloadFormatVersion()).isEqualTo("2.0");
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -437,7 +437,7 @@ class ApiGatewayV2WebSocketAndExtendedOpsTest {
|
||||
.tags(Map.of("initial", "tag"))
|
||||
.build());
|
||||
String tagApiId = createRes.apiId();
|
||||
String arn = "arn:aws:apigateway:us-east-1::/apis/" + tagApiId;
|
||||
String arn = TestFixtures.arn("apigateway", "", "/apis/" + tagApiId);
|
||||
|
||||
try {
|
||||
// Verify tags on create
|
||||
@@ -478,7 +478,7 @@ class ApiGatewayV2WebSocketAndExtendedOpsTest {
|
||||
.protocolType(ProtocolType.HTTP)
|
||||
.build());
|
||||
String noTagApiId = createRes.apiId();
|
||||
String arn = "arn:aws:apigateway:us-east-1::/apis/" + noTagApiId;
|
||||
String arn = TestFixtures.arn("apigateway", "", "/apis/" + noTagApiId);
|
||||
|
||||
try {
|
||||
Map<String, String> tags = gw.getTags(GetTagsRequest.builder().resourceArn(arn).build()).tags();
|
||||
@@ -492,7 +492,7 @@ class ApiGatewayV2WebSocketAndExtendedOpsTest {
|
||||
@DisplayName("TagResource on non-existent API returns 404")
|
||||
void tagResourceNotFound() {
|
||||
assertThatThrownBy(() -> gw.tagResource(TagResourceRequest.builder()
|
||||
.resourceArn("arn:aws:apigateway:us-east-1::/apis/nonexistent999")
|
||||
.resourceArn(TestFixtures.arn("apigateway", "", "/apis/nonexistent999"))
|
||||
.tags(Map.of("k", "v"))
|
||||
.build()))
|
||||
.isInstanceOf(NotFoundException.class);
|
||||
|
||||
@@ -345,7 +345,7 @@ class AthenaTest {
|
||||
|
||||
ListTagsForResourceResponse response = athena.listTagsForResource(
|
||||
ListTagsForResourceRequest.builder()
|
||||
.resourceARN("arn:aws:athena:us-east-1:000000000000:workgroup/" + groupName)
|
||||
.resourceARN(TestFixtures.arn("athena", "000000000000", "workgroup/" + groupName))
|
||||
.build());
|
||||
|
||||
assertThat(response.tags()).hasSize(1);
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class CloudFormationAcmCertificateTest {
|
||||
assertThat(waitForTerminal(stackName, 60)).isEqualTo("CREATE_COMPLETE");
|
||||
|
||||
String arn = output("CertArn");
|
||||
assertThat(arn).startsWith("arn:aws:acm:us-east-1:");
|
||||
assertThat(arn).startsWith("arn:" + TestFixtures.partition() + ":acm:" + TestFixtures.region().id() + ":");
|
||||
CertificateDetail created = describe(arn);
|
||||
assertThat(created.domainName()).isEqualTo(domainName);
|
||||
assertThat(created.status()).isEqualTo(CertificateStatus.ISSUED);
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ class CloudFormationEventBusTest {
|
||||
.stacks().get(0);
|
||||
Map<String, String> outputs = createdStack.outputs().stream()
|
||||
.collect(Collectors.toMap(Output::outputKey, Output::outputValue));
|
||||
String busArn = "arn:aws:events:us-east-1:000000000000:event-bus/" + busName;
|
||||
String busArn = TestFixtures.arn("events", "000000000000", "event-bus/" + busName);
|
||||
assertThat(outputs)
|
||||
.containsEntry("BusRef", busName)
|
||||
.containsEntry("BusName", busName)
|
||||
|
||||
+2
-3
@@ -25,9 +25,8 @@ class CloudFormationEventSourceMappingTest {
|
||||
private static final String STACK_NAME = "compat-cfn-esm-stack";
|
||||
private static final String FUNC_NAME = "compat-cfn-esm-func";
|
||||
private static final String QUEUE_NAME = "compat-cfn-esm-queue";
|
||||
private static final String ROLE = "arn:aws:iam::000000000000:role/cfn-lambda-role";
|
||||
private static final String ROLE = TestFixtures.globalArn("iam", "000000000000", "role/cfn-lambda-role");
|
||||
private static final String ACCOUNT = "000000000000";
|
||||
private static final String REGION = "us-east-1";
|
||||
|
||||
private static final String DDB_STACK_NAME = "compat-cfn-esm-ddb-stack";
|
||||
private static final String DDB_FUNC_NAME = "compat-cfn-esm-ddb-func";
|
||||
@@ -186,7 +185,7 @@ class CloudFormationEventSourceMappingTest {
|
||||
assertThat(esm.bisectBatchOnFunctionError()).isTrue();
|
||||
assertThat(esm.destinationConfig()).isNotNull();
|
||||
assertThat(esm.destinationConfig().onFailure().destination())
|
||||
.isEqualTo("arn:aws:sqs:" + REGION + ":" + ACCOUNT + ":" + DLQ_NAME);
|
||||
.isEqualTo(TestFixtures.arn("sqs", ACCOUNT, DLQ_NAME));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+2
-1
@@ -84,7 +84,8 @@ class CloudFormationIamUserTest {
|
||||
|
||||
assertThat(outputs).containsEntry("UserRef", userName);
|
||||
String userArn = outputs.get("UserArn");
|
||||
assertThat(userArn).startsWith("arn:aws:iam::").endsWith(":user/initial/" + userName);
|
||||
assertThat(userArn).startsWith("arn:" + TestFixtures.partition() + ":iam::")
|
||||
.endsWith(":user/initial/" + userName);
|
||||
|
||||
GetUserResponse userResponse = iam.getUser(GetUserRequest.builder().userName(userName).build());
|
||||
User user = userResponse.user();
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ class CloudFormationRedshiftClusterTest {
|
||||
assertThat(portStr).isNotBlank();
|
||||
int port = Integer.parseInt(portStr);
|
||||
assertThat(port).isPositive();
|
||||
assertThat(ns).startsWith("arn:aws:redshift:");
|
||||
assertThat(ns).startsWith("arn:" + TestFixtures.partition() + ":redshift:");
|
||||
|
||||
String connectHost = "host.docker.internal".equalsIgnoreCase(addr)
|
||||
? TestFixtures.proxyHost()
|
||||
|
||||
@@ -67,7 +67,7 @@ public class CloudHsmV2Test {
|
||||
// 3. Create HSM
|
||||
CreateHsmResponse hsmResp = client.createHsm(r -> r
|
||||
.clusterId(clusterId)
|
||||
.availabilityZone("us-east-1a")
|
||||
.availabilityZone(TestFixtures.region().id() + "a")
|
||||
.ipAddress("10.0.1.5")
|
||||
);
|
||||
|
||||
@@ -128,7 +128,8 @@ public class CloudHsmV2Test {
|
||||
|
||||
client.initializeCluster(r -> r.clusterId(clusterId).signedCert(signedCert).trustAnchor(trustAnchor));
|
||||
|
||||
Hsm hsm = client.createHsm(r -> r.clusterId(clusterId).availabilityZone("us-east-1b")).hsm();
|
||||
Hsm hsm = client.createHsm(r -> r.clusterId(clusterId)
|
||||
.availabilityZone(TestFixtures.region().id() + "b")).hsm();
|
||||
|
||||
// Test exactly one selector rule
|
||||
assertThatThrownBy(() -> client.deleteHsm(r -> r
|
||||
|
||||
@@ -63,7 +63,7 @@ class CloudTrailTest {
|
||||
assertThat(response.trailList()).hasSize(1);
|
||||
Trail trail = response.trailList().get(0);
|
||||
assertThat(trail.name()).isEqualTo(trailName);
|
||||
assertThat(trail.homeRegion()).isEqualTo("us-east-1");
|
||||
assertThat(trail.homeRegion()).isEqualTo(TestFixtures.region().id());
|
||||
assertThat(trail.s3BucketName()).isEqualTo(bucketName);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -26,12 +26,12 @@ class CloudWatchLogsCrossAccountPolicyTest {
|
||||
try (CloudWatchLogsClient logs = TestFixtures.cloudWatchLogsClient()) {
|
||||
PutDestinationResponse putDestination = logs.putDestination(request -> request
|
||||
.destinationName(DESTINATION_NAME)
|
||||
.targetArn("arn:aws:kinesis:us-east-1:000000000000:stream/floci-sdk-logs")
|
||||
.roleArn("arn:aws:iam::000000000000:role/floci-sdk-logs"));
|
||||
.targetArn(TestFixtures.arn("kinesis", "000000000000", "stream/floci-sdk-logs"))
|
||||
.roleArn(TestFixtures.globalArn("iam", "000000000000", "role/floci-sdk-logs")));
|
||||
|
||||
assertThat(putDestination.destination()).isNotNull();
|
||||
assertThat(putDestination.destination().destinationName()).isEqualTo(DESTINATION_NAME);
|
||||
assertThat(putDestination.destination().arn()).contains(":logs:us-east-1:");
|
||||
assertThat(putDestination.destination().arn()).contains(":logs:" + TestFixtures.region().id() + ":");
|
||||
|
||||
logs.putDestinationPolicy(request -> request
|
||||
.destinationName(DESTINATION_NAME)
|
||||
|
||||
+2
-2
@@ -22,9 +22,9 @@ class CloudWatchLogsDescribeLogGroupsTest {
|
||||
LogGroup group = findGroup(logs, groupName);
|
||||
|
||||
assertThat(group.arn())
|
||||
.isEqualTo("arn:aws:logs:us-east-1:000000000000:log-group:" + groupName + ":*");
|
||||
.isEqualTo(TestFixtures.arn("logs", "000000000000", "log-group:" + groupName + ":*"));
|
||||
assertThat(group.logGroupArn())
|
||||
.isEqualTo("arn:aws:logs:us-east-1:000000000000:log-group:" + groupName);
|
||||
.isEqualTo(TestFixtures.arn("logs", "000000000000", "log-group:" + groupName));
|
||||
assertThat(group.logGroupArn()).doesNotEndWith(":*");
|
||||
} finally {
|
||||
deleteIfPresent(logs, groupName);
|
||||
|
||||
@@ -63,7 +63,7 @@ class CodeDeployTest {
|
||||
|
||||
static final String DEPLOY_FUNCTION = "cd-deploy-fn";
|
||||
static final String DEPLOY_ALIAS = "live";
|
||||
static final String ROLE = "arn:aws:iam::000000000000:role/lambda-role";
|
||||
static final String ROLE = TestFixtures.globalArn("iam", "000000000000", "role/lambda-role");
|
||||
static String deploymentId;
|
||||
static String v1;
|
||||
static String v2;
|
||||
@@ -163,7 +163,7 @@ class CodeDeployTest {
|
||||
.applicationName("sdk-lambda-app")
|
||||
.deploymentGroupName("sdk-lambda-dg")
|
||||
.deploymentConfigName("CodeDeployDefault.LambdaAllAtOnce")
|
||||
.serviceRoleArn("arn:aws:iam::000000000000:role/codedeploy-role")
|
||||
.serviceRoleArn(TestFixtures.globalArn("iam", "000000000000", "role/codedeploy-role"))
|
||||
.deploymentStyle(DeploymentStyle.builder()
|
||||
.deploymentType(DeploymentType.BLUE_GREEN)
|
||||
.deploymentOption(DeploymentOption.WITH_TRAFFIC_CONTROL)
|
||||
@@ -236,7 +236,7 @@ class CodeDeployTest {
|
||||
@Test
|
||||
@Order(14)
|
||||
void tagAndListTags() {
|
||||
String arn = "arn:aws:codedeploy:us-east-1:000000000000:application:sdk-lambda-app";
|
||||
String arn = TestFixtures.arn("codedeploy", "000000000000", "application:sdk-lambda-app");
|
||||
codedeploy.tagResource(r -> r
|
||||
.resourceArn(arn)
|
||||
.tags(Tag.builder().key("team").value("platform").build(),
|
||||
@@ -250,7 +250,7 @@ class CodeDeployTest {
|
||||
@Test
|
||||
@Order(15)
|
||||
void untagResource() {
|
||||
String arn = "arn:aws:codedeploy:us-east-1:000000000000:application:sdk-lambda-app";
|
||||
String arn = TestFixtures.arn("codedeploy", "000000000000", "application:sdk-lambda-app");
|
||||
codedeploy.untagResource(r -> r.resourceArn(arn).tagKeys("project"));
|
||||
|
||||
ListTagsForResourceResponse resp = codedeploy.listTagsForResource(r -> r.resourceArn(arn));
|
||||
@@ -331,7 +331,7 @@ class CodeDeployTest {
|
||||
.applicationName("cd-lambda-app")
|
||||
.deploymentGroupName("cd-lambda-dg")
|
||||
.deploymentConfigName("CodeDeployDefault.LambdaAllAtOnce")
|
||||
.serviceRoleArn("arn:aws:iam::000000000000:role/codedeploy-role"));
|
||||
.serviceRoleArn(TestFixtures.globalArn("iam", "000000000000", "role/codedeploy-role")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -51,7 +51,7 @@ class DmsTest {
|
||||
assertFalse(group.subnets().isEmpty());
|
||||
assertTrue(group.subnets().stream()
|
||||
.allMatch(subnet -> "Active".equals(subnet.subnetStatus())));
|
||||
String arn = "arn:aws:dms:us-east-1:" + callerAccountId() + ":subgrp:" + GROUP_ID;
|
||||
String arn = TestFixtures.arn("dms", callerAccountId(), "subgrp:" + GROUP_ID);
|
||||
assertEquals(Map.of("env", "test"), tagsOf(dms, arn));
|
||||
|
||||
dms.addTagsToResource(request -> request.resourceArn(arn)
|
||||
|
||||
@@ -52,7 +52,7 @@ class EcrTest {
|
||||
|
||||
Repository repo = resp.repository();
|
||||
assertThat(repo.repositoryName()).isEqualTo(REPO_NAME);
|
||||
assertThat(repo.repositoryArn()).startsWith("arn:aws:ecr:");
|
||||
assertThat(repo.repositoryArn()).startsWith("arn:" + TestFixtures.partition() + ":ecr:");
|
||||
assertThat(repo.repositoryArn()).contains(":repository/" + REPO_NAME);
|
||||
assertThat(repo.repositoryUri()).contains("/" + REPO_NAME);
|
||||
// Hostname must resolve to loopback so docker auto-trusts it as insecure.
|
||||
@@ -209,7 +209,7 @@ class EcrTest {
|
||||
.containsExactly(firstPrefix);
|
||||
|
||||
String credentialArn =
|
||||
"arn:aws:secretsmanager:us-east-1:000000000000:secret:ecr-pullthroughcache/sdk";
|
||||
TestFixtures.arn("secretsmanager", "000000000000", "secret:ecr-pullthroughcache/sdk");
|
||||
UpdatePullThroughCacheRuleResponse updated = ecr.updatePullThroughCacheRule(builder -> builder
|
||||
.ecrRepositoryPrefix(firstPrefix)
|
||||
.credentialArn(credentialArn));
|
||||
|
||||
@@ -60,7 +60,7 @@ class EksTest {
|
||||
void createCluster() {
|
||||
CreateClusterResponse response = eks.createCluster(CreateClusterRequest.builder()
|
||||
.name(clusterName)
|
||||
.roleArn("arn:aws:iam::000000000000:role/eks-role")
|
||||
.roleArn(TestFixtures.globalArn("iam", "000000000000", "role/eks-role"))
|
||||
.resourcesVpcConfig(VpcConfigRequest.builder()
|
||||
.subnetIds(List.of())
|
||||
.securityGroupIds(List.of())
|
||||
@@ -153,7 +153,7 @@ class EksTest {
|
||||
void createDuplicateClusterFails() {
|
||||
assertThatThrownBy(() -> eks.createCluster(CreateClusterRequest.builder()
|
||||
.name(clusterName)
|
||||
.roleArn("arn:aws:iam::000000000000:role/eks-role")
|
||||
.roleArn(TestFixtures.globalArn("iam", "000000000000", "role/eks-role"))
|
||||
.resourcesVpcConfig(VpcConfigRequest.builder().build())
|
||||
.build()))
|
||||
.isInstanceOf(ResourceInUseException.class);
|
||||
@@ -170,7 +170,7 @@ class EksTest {
|
||||
.clusterName(clusterName)
|
||||
.nodegroupName(NODEGROUP)
|
||||
.subnets("subnet-abc")
|
||||
.nodeRole("arn:aws:iam::000000000000:role/eks-node-role")
|
||||
.nodeRole(TestFixtures.globalArn("iam", "000000000000", "role/eks-node-role"))
|
||||
.scalingConfig(NodegroupScalingConfig.builder()
|
||||
.minSize(1).maxSize(3).desiredSize(2).build())
|
||||
.build());
|
||||
@@ -225,7 +225,7 @@ class EksTest {
|
||||
CreateNodegroupResponse createResponse = eks.createNodegroup(CreateNodegroupRequest.builder()
|
||||
.clusterName(clusterName)
|
||||
.nodegroupName(nodegroupName)
|
||||
.nodeRole("arn:aws:iam::000000000000:role/eks-node-role")
|
||||
.nodeRole(TestFixtures.globalArn("iam", "000000000000", "role/eks-node-role"))
|
||||
.subnets("subnet-12345678", "subnet-87654321")
|
||||
.scalingConfig(NodegroupScalingConfig.builder()
|
||||
.minSize(1)
|
||||
@@ -279,7 +279,7 @@ class EksTest {
|
||||
CreateFargateProfileResponse createResponse = eks.createFargateProfile(CreateFargateProfileRequest.builder()
|
||||
.clusterName(clusterName)
|
||||
.fargateProfileName(fargateProfileName)
|
||||
.podExecutionRoleArn("arn:aws:iam::000000000000:role/eks-fargate-role")
|
||||
.podExecutionRoleArn(TestFixtures.globalArn("iam", "000000000000", "role/eks-fargate-role"))
|
||||
.subnets("subnet-12345678", "subnet-87654321")
|
||||
.selectors(FargateProfileSelector.builder()
|
||||
.namespace("default")
|
||||
@@ -292,7 +292,8 @@ class EksTest {
|
||||
assertThat(createResponse.fargateProfile().clusterName()).isEqualTo(clusterName);
|
||||
assertThat(createResponse.fargateProfile().fargateProfileName()).isEqualTo(fargateProfileName);
|
||||
assertThat(createResponse.fargateProfile().fargateProfileArn())
|
||||
.matches("arn:aws:eks:[^:]+:[0-9]+:fargateprofile/" + clusterName + "/" + fargateProfileName + "/.+");
|
||||
.matches("arn:" + TestFixtures.partition() + ":eks:[^:]+:[0-9]+:fargateprofile/"
|
||||
+ clusterName + "/" + fargateProfileName + "/.+");
|
||||
assertThat(createResponse.fargateProfile().status()).isEqualTo(FargateProfileStatus.ACTIVE);
|
||||
assertThat(createResponse.fargateProfile().selectors()).hasSize(1);
|
||||
assertThat(createResponse.fargateProfile().selectors().get(0).labels()).containsEntry("app", "api");
|
||||
|
||||
@@ -559,7 +559,7 @@ class GlueCatalogTest {
|
||||
.tags(Map.of("Environment", "dev", "Project", "project1"))
|
||||
.build());
|
||||
|
||||
String databaseArn = "arn:aws:glue:us-east-1:000000000000:database/" + DATABASE_TAGGED_NAME;
|
||||
String databaseArn = TestFixtures.arn("glue", "000000000000", "database/" + DATABASE_TAGGED_NAME);
|
||||
GetResourcesResponse response = tagging.getResources(b -> b.resourceARNList(databaseArn));
|
||||
|
||||
assertThat(response.resourceTagMappingList()).singleElement().satisfies(mapping -> {
|
||||
@@ -586,7 +586,7 @@ class GlueCatalogTest {
|
||||
.physicalConnectionRequirements(PhysicalConnectionRequirements.builder()
|
||||
.subnetId("subnet-0123456789abcdef0")
|
||||
.securityGroupIdList("sg-0123456789abcdef0")
|
||||
.availabilityZone("us-east-1a")
|
||||
.availabilityZone(TestFixtures.region().id() + "a")
|
||||
.build())
|
||||
.build())
|
||||
.tags(Map.of("env", "dev"))
|
||||
@@ -660,7 +660,8 @@ class GlueCatalogTest {
|
||||
@DisplayName("The catalog resource policy follows the create, update and delete conditions Terraform sends")
|
||||
void catalogResourcePolicyLifecycle() {
|
||||
String policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\","
|
||||
+ "\"Principal\":{\"AWS\":\"arn:aws:iam::111122223333:root\"},\"Action\":\"glue:GetTable\",\"Resource\":\"*\"}]}";
|
||||
+ "\"Principal\":{\"AWS\":\"" + TestFixtures.globalArn("iam", "111122223333", "root") + "\"},"
|
||||
+ "\"Action\":\"glue:GetTable\",\"Resource\":\"*\"}]}";
|
||||
String policyV2 = policy.replace("glue:GetTable", "glue:GetTables");
|
||||
// Start from no policy; the catalog is shared with other tests.
|
||||
try {
|
||||
|
||||
@@ -99,7 +99,7 @@ class GuardDutyTest {
|
||||
.isEqualTo(FindingPublishingFrequency.ONE_HOUR);
|
||||
|
||||
String detectorArn =
|
||||
"arn:aws:guardduty:us-east-1:000000000000:detector/" + detectorId;
|
||||
TestFixtures.arn("guardduty", "000000000000", "detector/" + detectorId);
|
||||
guardduty.tagResource(request -> request
|
||||
.resourceArn(detectorArn)
|
||||
.tags(Map.of("team", "security")));
|
||||
|
||||
@@ -154,7 +154,8 @@ class IotTest {
|
||||
@Test
|
||||
void domainConfigurationLifecycle() {
|
||||
String name = "java-iot-domain";
|
||||
String certificateArn = "arn:aws:acm:us-east-1:000000000000:certificate/11111111-1111-1111-1111-111111111111";
|
||||
String certificateArn = TestFixtures.arn("acm", "000000000000",
|
||||
"certificate/11111111-1111-1111-1111-111111111111");
|
||||
boolean leftOver = iot.listDomainConfigurations(ListDomainConfigurationsRequest.builder().build())
|
||||
.domainConfigurations().stream()
|
||||
.anyMatch(summary -> name.equals(summary.domainConfigurationName()));
|
||||
@@ -191,7 +192,7 @@ class IotTest {
|
||||
.build());
|
||||
assertThat(created.domainConfigurationName()).isEqualTo(name);
|
||||
assertThat(created.domainConfigurationArn())
|
||||
.startsWith("arn:aws:iot:us-east-1:000000000000:domainconfiguration/" + name + "/");
|
||||
.startsWith(TestFixtures.arn("iot", "000000000000", "domainconfiguration/" + name + "/"));
|
||||
|
||||
assertThatThrownBy(() -> iot.createDomainConfiguration(CreateDomainConfigurationRequest.builder()
|
||||
.domainConfigurationName(name)
|
||||
@@ -376,7 +377,7 @@ class IotTest {
|
||||
assertThat(remainingTags.tags()).extracting(Tag::key).containsExactly("owner");
|
||||
|
||||
assertThatThrownBy(() -> iot.listTagsForResource(ListTagsForResourceRequest.builder()
|
||||
.resourceArn("arn:aws:iot:us-east-1:000000000000:thing/missing-tagged-thing")
|
||||
.resourceArn(TestFixtures.arn("iot", "000000000000", "thing/missing-tagged-thing"))
|
||||
.build()))
|
||||
.isInstanceOf(ResourceNotFoundException.class);
|
||||
}
|
||||
@@ -506,7 +507,8 @@ class IotTest {
|
||||
.ruleDisabled(false)
|
||||
.actions(Action.builder()
|
||||
.sqs(SqsAction.builder()
|
||||
.roleArn("arn:aws:iam::000000000000:role/iot-rule-role")
|
||||
.roleArn(TestFixtures.globalArn(
|
||||
"iam", "000000000000", "role/iot-rule-role"))
|
||||
.queueUrl(queueUrl)
|
||||
.useBase64(false)
|
||||
.build())
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ class MacieOrganizationAdministrationTest {
|
||||
.account(account -> account.accountId(MEMBER_ACCOUNT).email("member@example.com"))
|
||||
.tags(java.util.Map.of("team", "security")));
|
||||
assertThat(member.arn())
|
||||
.isEqualTo("arn:aws:macie2:us-east-1:" + ADMIN_ACCOUNT + ":member/" + MEMBER_ACCOUNT);
|
||||
.isEqualTo(TestFixtures.arn("macie2", ADMIN_ACCOUNT, "member/" + MEMBER_ACCOUNT));
|
||||
assertThat(administrator.listMembers(request -> request.onlyAssociated("true")).members())
|
||||
.anySatisfy(account -> {
|
||||
assertThat(account.accountId()).isEqualTo(MEMBER_ACCOUNT);
|
||||
|
||||
@@ -83,7 +83,7 @@ class NeptuneTest {
|
||||
assertThat(cluster.dbClusterIdentifier()).isEqualTo(CLUSTER_ID);
|
||||
assertThat(cluster.engine()).isEqualTo("neptune");
|
||||
assertThat(cluster.status()).isEqualTo("available");
|
||||
assertThat(cluster.dbClusterArn()).startsWith("arn:aws:neptune:");
|
||||
assertThat(cluster.dbClusterArn()).startsWith("arn:" + TestFixtures.partition() + ":neptune:");
|
||||
assertThat(cluster.port()).isGreaterThan(0);
|
||||
assertThat(cluster.storageEncrypted()).isFalse();
|
||||
assertThat(cluster.backupRetentionPeriod()).isEqualTo(1);
|
||||
@@ -158,7 +158,7 @@ class NeptuneTest {
|
||||
@Order(6)
|
||||
@DisplayName("AddRoleToDBCluster and RemoveRoleFromDBCluster maintain AssociatedRoles")
|
||||
void rolesRoundTrip() {
|
||||
String roleArn = "arn:aws:iam::000000000000:role/" + CLUSTER_ID;
|
||||
String roleArn = TestFixtures.globalArn("iam", "000000000000", "role/" + CLUSTER_ID);
|
||||
|
||||
neptune.addRoleToDBCluster(AddRoleToDbClusterRequest.builder()
|
||||
.dbClusterIdentifier(CLUSTER_ID).roleArn(roleArn).build());
|
||||
@@ -221,7 +221,7 @@ class NeptuneTest {
|
||||
assertThat(instance.dbInstanceIdentifier()).isEqualTo(INSTANCE_ID);
|
||||
assertThat(instance.dbClusterIdentifier()).isEqualTo(CLUSTER_ID);
|
||||
assertThat(instance.dbInstanceStatus()).isEqualTo("available");
|
||||
assertThat(instance.dbInstanceArn()).startsWith("arn:aws:neptune:");
|
||||
assertThat(instance.dbInstanceArn()).startsWith("arn:" + TestFixtures.partition() + ":neptune:");
|
||||
assertThat(instance.autoMinorVersionUpgrade()).isTrue();
|
||||
assertThat(instance.promotionTier()).isZero();
|
||||
assertThat(instance.publiclyAccessible()).isFalse();
|
||||
|
||||
+2
-15
@@ -1,9 +1,6 @@
|
||||
package com.floci.test;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
|
||||
import software.amazon.awssdk.regions.Region;
|
||||
import software.amazon.awssdk.services.organizations.OrganizationsClient;
|
||||
import software.amazon.awssdk.services.organizations.model.Account;
|
||||
import software.amazon.awssdk.services.organizations.model.AccessDeniedException;
|
||||
@@ -46,16 +43,6 @@ public class OrganizationsTest {
|
||||
|
||||
private final OrganizationsClient client = TestFixtures.organizationsClient();
|
||||
|
||||
/** A client whose 12-digit access key id makes Floci treat the caller as that account. */
|
||||
private static OrganizationsClient clientFor(String accountId) {
|
||||
return OrganizationsClient.builder()
|
||||
.endpointOverride(TestFixtures.endpoint())
|
||||
.region(Region.US_EAST_1)
|
||||
.credentialsProvider(StaticCredentialsProvider.create(
|
||||
AwsBasicCredentials.create(accountId, "test")))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFullLifecycle() {
|
||||
// 1. Create the organization.
|
||||
@@ -68,7 +55,7 @@ public class OrganizationsTest {
|
||||
try {
|
||||
assertThat(organization.id()).matches("o-[a-z0-9]{10}");
|
||||
assertThat(organization.featureSet()).isEqualTo(OrganizationFeatureSet.ALL);
|
||||
assertThat(organization.arn()).startsWith("arn:aws:organizations::");
|
||||
assertThat(organization.arn()).startsWith("arn:" + TestFixtures.partition() + ":organizations::");
|
||||
assertThat(managementAccountId).isNotBlank();
|
||||
|
||||
assertThat(client.describeOrganization().organization().id()).isEqualTo(organization.id());
|
||||
@@ -223,7 +210,7 @@ public class OrganizationsTest {
|
||||
client.deleteResourcePolicy(r -> { });
|
||||
|
||||
// 10. The invitation handshake, driven from both sides.
|
||||
try (OrganizationsClient invitedClient = clientFor(INVITED_ACCOUNT)) {
|
||||
try (OrganizationsClient invitedClient = TestFixtures.organizationsClient(INVITED_ACCOUNT)) {
|
||||
assertThatThrownBy(invitedClient::describeOrganization)
|
||||
.isInstanceOf(AwsOrganizationsNotInUseException.class);
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class RdsIamTokenCompatTest {
|
||||
|
||||
private static final StaticCredentialsProvider CREDENTIALS =
|
||||
StaticCredentialsProvider.create(AwsBasicCredentials.create("test", "test"));
|
||||
private static final Region REGION = Region.US_EAST_1;
|
||||
private static final Region REGION = TestFixtures.region();
|
||||
private static final String USERNAME = "admin";
|
||||
private static final String PASSWORD = "secret-pass-123";
|
||||
private static final String DATABASE = "appdb";
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class RdsJdbcCompatTest {
|
||||
|
||||
private static final StaticCredentialsProvider CREDENTIALS =
|
||||
StaticCredentialsProvider.create(AwsBasicCredentials.create("test", "test"));
|
||||
private static final Region REGION = Region.US_EAST_1;
|
||||
private static final Region REGION = TestFixtures.region();
|
||||
private static final String USERNAME = "admin";
|
||||
private static final String PASSWORD = "secret123";
|
||||
private static final String DATABASE = "app";
|
||||
|
||||
+11
-8
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
class ResourceExplorer2Test {
|
||||
|
||||
private static ResourceExplorer2Client client;
|
||||
// The emulator auto-provisions an index only in the default region (us-east-1). CreateIndex
|
||||
// The emulator auto-provisions an index only in the default region (the fixture region). CreateIndex
|
||||
// there is a no-op/conflict, so index create+delete is exercised against a second region
|
||||
// that starts with no index, matching AWS's one-index-per-region rule.
|
||||
private static ResourceExplorer2Client altRegionClient;
|
||||
@@ -273,7 +273,8 @@ class ResourceExplorer2Test {
|
||||
@Order(22)
|
||||
void batchGetViewReturnsViewsAndErrorsForMissing() {
|
||||
assumeFalse(TestFixtures.isRealAws(), "Depends on created view");
|
||||
String bogusArn = "arn:aws:resource-explorer-2:us-east-1:000000000000:view/does-not-exist/00000000-0000-0000-0000-000000000000";
|
||||
String bogusArn = TestFixtures.arn("resource-explorer-2", "000000000000",
|
||||
"view/does-not-exist/00000000-0000-0000-0000-000000000000");
|
||||
|
||||
BatchGetViewResponse response = client.batchGetView(BatchGetViewRequest.builder()
|
||||
.viewArns(createdViewArn, bogusArn)
|
||||
@@ -408,7 +409,8 @@ class ResourceExplorer2Test {
|
||||
// Real AWS: 401 UnauthorizedException (auth checked before existence for wrong-account ARN)
|
||||
// Floci: 404 ResourceNotFoundException
|
||||
assertThatThrownBy(() -> client.getView(GetViewRequest.builder()
|
||||
.viewArn("arn:aws:resource-explorer-2:us-east-1:000000000000:view/nope/00000000-0000-0000-0000-000000000000")
|
||||
.viewArn(TestFixtures.arn("resource-explorer-2", "000000000000",
|
||||
"view/nope/00000000-0000-0000-0000-000000000000"))
|
||||
.build()))
|
||||
.isInstanceOf(ResourceExplorer2Exception.class);
|
||||
}
|
||||
@@ -419,7 +421,7 @@ class ResourceExplorer2Test {
|
||||
// Real AWS: 403 AccessDeniedException (auth checked before existence for wrong-account ARN)
|
||||
// Floci: 404 ResourceNotFoundException
|
||||
assertThatThrownBy(() -> client.deleteIndex(DeleteIndexRequest.builder()
|
||||
.arn("arn:aws:resource-explorer-2:us-east-1:000000000000:index/nonexistent")
|
||||
.arn(TestFixtures.arn("resource-explorer-2", "000000000000", "index/nonexistent"))
|
||||
.build()))
|
||||
.isInstanceOf(ResourceExplorer2Exception.class);
|
||||
}
|
||||
@@ -456,7 +458,7 @@ class ResourceExplorer2Test {
|
||||
.as("IncludedProperty.Name").isEqualTo("tags");
|
||||
|
||||
// Drill into scope
|
||||
assertThat(view.scope()).as("View.Scope").contains("arn:aws:iam:");
|
||||
assertThat(view.scope()).as("View.Scope").contains("arn:" + TestFixtures.partition() + ":iam:");
|
||||
|
||||
// Cleanup
|
||||
client.deleteView(DeleteViewRequest.builder().viewArn(arn).build());
|
||||
@@ -528,7 +530,8 @@ class ResourceExplorer2Test {
|
||||
@Order(55)
|
||||
void batchGetViewErrorFieldsDeserialize() {
|
||||
assumeFalse(TestFixtures.isRealAws(), "Uses floci-specific bogus ARN format");
|
||||
String bogus = "arn:aws:resource-explorer-2:us-east-1:000000000000:view/x/00000000-0000-0000-0000-000000000000";
|
||||
String bogus = TestFixtures.arn("resource-explorer-2", "000000000000",
|
||||
"view/x/00000000-0000-0000-0000-000000000000");
|
||||
|
||||
BatchGetViewResponse response = client.batchGetView(BatchGetViewRequest.builder()
|
||||
.viewArns(bogus)
|
||||
@@ -576,7 +579,7 @@ class ResourceExplorer2Test {
|
||||
|
||||
UpdateViewResponse updated = client.updateView(UpdateViewRequest.builder()
|
||||
.viewArn(arn)
|
||||
.filters(SearchFilter.builder().filterString("region:us-east-1").build())
|
||||
.filters(SearchFilter.builder().filterString("region:" + TestFixtures.region().id()).build())
|
||||
.includedProperties(IncludedProperty.builder().name("tags").build())
|
||||
.build());
|
||||
|
||||
@@ -584,7 +587,7 @@ class ResourceExplorer2Test {
|
||||
assertThat(view.viewArn()).isEqualTo(arn);
|
||||
assertThat(view.filters()).as("Updated Filters").isNotNull();
|
||||
assertThat(view.filters().filterString())
|
||||
.as("Updated FilterString").isEqualTo("region:us-east-1");
|
||||
.as("Updated FilterString").isEqualTo("region:" + TestFixtures.region().id());
|
||||
assertThat(view.includedProperties()).hasSize(1);
|
||||
assertThat(view.includedProperties().get(0).name()).isEqualTo("tags");
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
||||
@DisplayName("Route 53")
|
||||
class Route53Test {
|
||||
|
||||
private static final VPCRegion VPC_REGION = VPCRegion.fromValue(TestFixtures.region().id());
|
||||
|
||||
private static Route53Client route53;
|
||||
|
||||
@BeforeAll
|
||||
@@ -84,11 +86,11 @@ class Route53Test {
|
||||
try {
|
||||
VPC zoneVpc = VPC.builder()
|
||||
.vpcId(zoneVpcId)
|
||||
.vpcRegion(VPCRegion.US_EAST_1)
|
||||
.vpcRegion(VPC_REGION)
|
||||
.build();
|
||||
VPC spokeVpc = VPC.builder()
|
||||
.vpcId(spokeVpcId)
|
||||
.vpcRegion(VPCRegion.US_EAST_1)
|
||||
.vpcRegion(VPC_REGION)
|
||||
.build();
|
||||
|
||||
zoneId = zoneRoute53.createHostedZone(CreateHostedZoneRequest.builder()
|
||||
@@ -123,7 +125,7 @@ class Route53Test {
|
||||
.singleElement()
|
||||
.satisfies(vpc -> {
|
||||
assertThat(vpc.vpcId()).isEqualTo(spokeVpcId);
|
||||
assertThat(vpc.vpcRegion()).isEqualTo(VPCRegion.US_EAST_1);
|
||||
assertThat(vpc.vpcRegion()).isEqualTo(VPC_REGION);
|
||||
});
|
||||
|
||||
vpcRoute53.associateVPCWithHostedZone(
|
||||
@@ -135,7 +137,7 @@ class Route53Test {
|
||||
assertThat(vpcRoute53.listHostedZonesByVPC(
|
||||
ListHostedZonesByVpcRequest.builder()
|
||||
.vpcId(spokeVpcId)
|
||||
.vpcRegion(VPCRegion.US_EAST_1)
|
||||
.vpcRegion(VPC_REGION)
|
||||
.build()).hostedZoneSummaries())
|
||||
.singleElement()
|
||||
.satisfies(summary -> {
|
||||
@@ -157,7 +159,7 @@ class Route53Test {
|
||||
assertThat(vpcRoute53.listHostedZonesByVPC(
|
||||
ListHostedZonesByVpcRequest.builder()
|
||||
.vpcId(spokeVpcId)
|
||||
.vpcRegion(VPCRegion.US_EAST_1)
|
||||
.vpcRegion(VPC_REGION)
|
||||
.build()).hostedZoneSummaries())
|
||||
.singleElement();
|
||||
|
||||
|
||||
@@ -65,7 +65,8 @@ class S3TablesTest {
|
||||
.storageClassConfiguration(StorageClassConfiguration.builder().storageClass(StorageClass.STANDARD).build())
|
||||
.build());
|
||||
bucketArn = created.arn();
|
||||
assertThat(bucketArn).contains("arn:aws:s3tables:").endsWith("bucket/" + bucketName);
|
||||
assertThat(bucketArn).contains("arn:" + TestFixtures.partition() + ":s3tables:")
|
||||
.endsWith("bucket/" + bucketName);
|
||||
|
||||
GetTableBucketResponse fetched = client.getTableBucket(
|
||||
GetTableBucketRequest.builder().tableBucketARN(bucketArn).build());
|
||||
|
||||
@@ -51,7 +51,7 @@ class S3VectorsTest {
|
||||
.vectorBucketName(bucketName)
|
||||
.build()
|
||||
);
|
||||
assertThat(response.vectorBucketArn()).isNotBlank().contains("arn:aws:s3vectors:");
|
||||
assertThat(response.vectorBucketArn()).isNotBlank().contains("arn:" + TestFixtures.partition() + ":s3vectors:");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -88,7 +88,7 @@ class S3VectorsTest {
|
||||
.dataType("float32")
|
||||
.build()
|
||||
);
|
||||
assertThat(response.indexArn()).isNotBlank().contains("arn:aws:s3vectors:");
|
||||
assertThat(response.indexArn()).isNotBlank().contains("arn:" + TestFixtures.partition() + ":s3vectors:");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+3
-3
@@ -251,14 +251,14 @@ class SecretsManagerTest {
|
||||
lambda.createFunction(CreateFunctionRequest.builder()
|
||||
.functionName(lambdaName)
|
||||
.runtime(Runtime.fromValue("nodejs20.x"))
|
||||
.role("arn:aws:iam::000000000000:role/dummy-role")
|
||||
.role(TestFixtures.globalArn("iam", "000000000000", "role/dummy-role"))
|
||||
.handler("index.handler")
|
||||
.code(FunctionCode.builder().zipFile(SdkBytes.fromByteArray(baos.toByteArray())).build())
|
||||
.build());
|
||||
|
||||
RotateSecretResponse rotateResponse = sm.rotateSecret(RotateSecretRequest.builder()
|
||||
.secretId(secretName)
|
||||
.rotationLambdaARN("arn:aws:lambda:us-east-1:000000000000:function:" + lambdaName)
|
||||
.rotationLambdaARN(TestFixtures.arn("lambda", "000000000000", "function:" + lambdaName))
|
||||
.rotationRules(RotationRulesType.builder().automaticallyAfterDays(30L).build())
|
||||
.build());
|
||||
|
||||
@@ -320,7 +320,7 @@ class SecretsManagerTest {
|
||||
assertThatThrownBy(() -> sm.createSecret(CreateSecretRequest.builder()
|
||||
.name(kmsSecretName)
|
||||
.secretString("kms-value")
|
||||
.kmsKeyId("arn:aws:kms:us-east-1:000000000000:key/does-not-exist")
|
||||
.kmsKeyId(TestFixtures.arn("kms", "000000000000", "key/does-not-exist"))
|
||||
.build()))
|
||||
.isInstanceOf(InvalidParameterException.class)
|
||||
.hasMessageContaining("You can't access the KMS key");
|
||||
|
||||
+4
-4
@@ -197,8 +197,8 @@ class SesEventPublishingTest {
|
||||
firehoseStreamArn = firehose.createDeliveryStream(CreateDeliveryStreamRequest.builder()
|
||||
.deliveryStreamName(firehoseStreamName)
|
||||
.s3DestinationConfiguration(S3DestinationConfiguration.builder()
|
||||
.bucketARN("arn:aws:s3:::" + firehoseBucket)
|
||||
.roleARN("arn:aws:iam::000000000000:role/sdk-evt-fh-role")
|
||||
.bucketARN(TestFixtures.globalArn("s3", "", firehoseBucket))
|
||||
.roleARN(TestFixtures.globalArn("iam", "000000000000", "role/sdk-evt-fh-role"))
|
||||
.prefix(firehoseStreamName + "/")
|
||||
// Floci does not enforce AWS's 60s minimum interval, which keeps
|
||||
// the delivery wait short (would need 60+ against real AWS).
|
||||
@@ -219,7 +219,7 @@ class SesEventPublishingTest {
|
||||
.enabled(true)
|
||||
.matchingEventTypes(EventType.SEND)
|
||||
.kinesisFirehoseDestination(KinesisFirehoseDestination.builder()
|
||||
.iamRoleArn("arn:aws:iam::000000000000:role/sdk-evt-fh-role")
|
||||
.iamRoleArn(TestFixtures.globalArn("iam", "000000000000", "role/sdk-evt-fh-role"))
|
||||
.deliveryStreamArn(firehoseStreamArn)
|
||||
.build())
|
||||
.build())
|
||||
@@ -244,7 +244,7 @@ class SesEventPublishingTest {
|
||||
.rule(ebRuleName)
|
||||
.targets(Target.builder().id("1").arn(ebQueueArn).build())
|
||||
.build());
|
||||
ebBusArn = "arn:aws:events:us-east-1:000000000000:event-bus/default";
|
||||
ebBusArn = TestFixtures.arn("events", "000000000000", "event-bus/default");
|
||||
ses.createConfigurationSet(CreateConfigurationSetRequest.builder()
|
||||
.configurationSetName(csNameEB)
|
||||
.build());
|
||||
|
||||
@@ -108,7 +108,7 @@ class SsoOidcTest {
|
||||
String instanceArn = sso.listInstances(request -> {}).instances().get(0).instanceArn();
|
||||
String applicationArn = sso.createApplication(request -> request
|
||||
.instanceArn(instanceArn)
|
||||
.applicationProviderArn("arn:aws:sso::aws:applicationProvider/custom")
|
||||
.applicationProviderArn(TestFixtures.globalArn("sso", "aws", "applicationProvider/custom"))
|
||||
.name("Floci IAM OIDC SDK"))
|
||||
.applicationArn();
|
||||
|
||||
|
||||
Reference in new issue
Block a user