Skip to content

Commit

Permalink
Address Workflow failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhlogin committed Jun 25, 2024
1 parent b812c52 commit 7c60579
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies {
testLibrary("com.amazonaws:aws-java-sdk-kinesis:1.11.391")
testLibrary("com.amazonaws:aws-java-sdk-dynamodb:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-sns:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.410")
testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
testLibrary("com.amazonaws:aws-java-sdk-iam:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-lambda:1.11.678")
Expand Down Expand Up @@ -88,10 +88,7 @@ testing {
implementation("com.amazonaws:aws-java-sdk-kinesis:1.11.0")
implementation("com.amazonaws:aws-java-sdk-dynamodb:1.11.0")
implementation("com.amazonaws:aws-java-sdk-sns:1.11.0")
implementation("com.amazonaws:aws-java-sdk-secretsmanager:1.11.0")
implementation("com.amazonaws:aws-java-sdk-stepfunctions:1.11.0")
implementation("com.amazonaws:aws-java-sdk-lambda:1.11.0")
implementation("com.amazonaws:aws-java-sdk-iam:1.11.0")


// needed by S3
implementation("javax.xml.bind:jaxb-api:2.3.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.amazonaws.services.kinesis.AmazonKinesisClient
import com.amazonaws.services.kinesis.model.CreateStreamRequest
import com.amazonaws.services.kinesis.model.RegisterStreamConsumerRequest
import com.amazonaws.services.kinesis.model.RegisterStreamConsumerResult
import com.amazonaws.services.kinesis.model.DescribeStreamConsumerRequest
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.model.BucketNotificationConfiguration
import com.amazonaws.services.s3.model.ObjectListing
Expand Down Expand Up @@ -62,9 +61,8 @@ import org.testcontainers.utility.DockerImageName

import java.time.Duration
import java.nio.ByteBuffer
import java.io.ByteArrayOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream

class AwsConnector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LambdaTracingTest extends AgentInstrumentationSpecification {
def "Lambda operations and tracing"() {
setup:
String roleName = "lambda-execution-role"
String role_policy = """
String rolePolicy = """
{
"Version": "2012-10-17",
"Statement": [
Expand Down Expand Up @@ -56,7 +56,7 @@ class LambdaTracingTest extends AgentInstrumentationSpecification {
String handler = "lambda_function.lambda_handler"

// Create a role
String roleARN = awsConnector.createRole(roleName, role_policy)
String roleARN = awsConnector.createRole(roleName, rolePolicy)
awsConnector.attachRolePolicy(roleName, lambdaPolicyArn)
awsConnector.putRolePolicy(roleName, policyName, lammbdaPolicyDocument)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ dependencies {
testLibrary("com.amazonaws:aws-java-sdk-s3:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-rds:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-ec2:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-kinesis:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-kinesis:1.11.391")
testLibrary("com.amazonaws:aws-java-sdk-dynamodb:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-sns:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-sqs:1.11.106")
testLibrary("com.amazonaws:aws-java-sdk-secretsmanager:1.11.309")
testLibrary("com.amazonaws:aws-java-sdk-stepfunctions:1.11.230")
testLibrary("com.amazonaws:aws-java-sdk-lambda:1.11.678")

// last version that does not use json protocol
latestDepTestLibrary("com.amazonaws:aws-java-sdk-sqs:1.12.583")
Expand Down
5 changes: 5 additions & 0 deletions instrumentation/aws-sdk/aws-sdk-1.11/library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ plugins {

dependencies {
implementation("io.opentelemetry.contrib:opentelemetry-aws-xray-propagator")
implementation("org.json:json") {
version {
strictly("[20210307,)")
}
}

library("com.amazonaws:aws-java-sdk-core:1.11.0")
library("com.amazonaws:aws-java-sdk-sqs:1.11.106")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,27 @@ private static String invokeOrNull(@Nullable MethodHandle method, Object obj) {
@Nullable private final MethodHandle getResourceEventMappingId;

private RequestAccess(Class<?> clz) {
getBucketName = findAccessorOrNull(clz, "getBucketName");
getQueueUrl = findAccessorOrNull(clz, "getQueueUrl");
getQueueName = findAccessorOrNull(clz, "getQueueName");
getStreamName = findAccessorOrNull(clz, "getStreamName");
getStreamConsumerName = findAccessorOrNull(clz, "getConsumerName");
getTableName = findAccessorOrNull(clz, "getTableName");
getTopicArn = findAccessorOrNull(clz, "getTopicArn");
getTargetArn = findAccessorOrNull(clz, "getTargetArn");
getSecretArn = findAccessorOrNull(clz, "getARN");
getStateMachineArn = findAccessorOrNull(clz, "getStateMachineArn");
getActivityArn = findAccessorOrNull(clz, "getActivityArn");
getFunctionName = findAccessorOrNull(clz, "getFunctionName");
getResourceEventMappingId = findAccessorOrNull(clz, "getUUID");
getBucketName = findAccessorOrNull(clz, "getBucketName", String.class);
getQueueUrl = findAccessorOrNull(clz, "getQueueUrl", String.class);
getQueueName = findAccessorOrNull(clz, "getQueueName", String.class);
getStreamName = findAccessorOrNull(clz, "getStreamName", String.class);
getTableName = findAccessorOrNull(clz, "getTableName", String.class);
getStreamConsumerName = findAccessorOrNull(clz, "getConsumerName", String.class);
getTopicArn = findAccessorOrNull(clz, "getTopicArn", String.class);
getTargetArn = findAccessorOrNull(clz, "getTargetArn", String.class);
getSecretArn = findAccessorOrNull(clz, "getARN", String.class);
getStateMachineArn = findAccessorOrNull(clz, "getStateMachineArn", String.class);
getActivityArn = findAccessorOrNull(clz, "getActivityArn", String.class);
getFunctionName = findAccessorOrNull(clz, "getFunctionName", String.class);
getResourceEventMappingId = findAccessorOrNull(clz, "getUUID", String.class);
}

@Nullable
private static MethodHandle findAccessorOrNull(Class<?> clz, String methodName) {
private static MethodHandle findAccessorOrNull(
Class<?> clz, String methodName, Class<?> returnType) {
try {
return MethodHandles.publicLookup()
.findVirtual(clz, methodName, MethodType.methodType(String.class));
.findVirtual(clz, methodName, MethodType.methodType(returnType));
} catch (Throwable t) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ import com.amazonaws.services.dynamodbv2.model.CreateTableRequest
import com.amazonaws.services.ec2.AmazonEC2ClientBuilder
import com.amazonaws.services.kinesis.AmazonKinesisClientBuilder
import com.amazonaws.services.kinesis.model.DeleteStreamRequest
import com.amazonaws.services.kinesis.model.DescribeStreamConsumerRequest
import com.amazonaws.services.kinesis.model.RegisterStreamConsumerRequest
import com.amazonaws.services.rds.AmazonRDSClientBuilder
import com.amazonaws.services.rds.model.DeleteOptionGroupRequest
import com.amazonaws.services.s3.AmazonS3Client
import com.amazonaws.services.s3.AmazonS3ClientBuilder
import com.amazonaws.services.sns.AmazonSNSClientBuilder
import com.amazonaws.services.sns.model.CreateTopicRequest
import com.amazonaws.services.sns.model.PublishRequest
import com.amazonaws.services.sns.model.SubscribeRequest
import com.amazonaws.services.secretsmanager.AWSSecretsManagerClientBuilder
import com.amazonaws.services.secretsmanager.model.CreateSecretRequest
import com.amazonaws.services.stepfunctions.model.DescribeStateMachineRequest
Expand Down

0 comments on commit 7c60579

Please sign in to comment.