So currently I downloaded the jar and added it into the class path.
Jar is from: https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk
I also ran the groovy script i have made on its own which is just a secretsmanager and it works fine separately outside of jmeter
However in the JSSR223 preprocessor I tried a simple import of import com.amazonaws.AmazonClientException
and it says class not resolved meaning library wasn't there? Is there something I'm missing?
I don't think single .jar would be sufficient, my expectation is that you will need to have some dependencies as well so I would recommend considering using AWS SDK For Java Bundle instead, it includes all the AWS SDK services bindings and dependencies so it will be sufficient to drop the .jar to "lib" folder of your JMeter installation (or any other folder which is on JMeter Classpath) and that would be it.
You may also find How to Reuse Your JMeter Code with JAR Files and Save Time article for more details
Harder way (however you might find it useful in the future)
Create a minimal POM project having a single dependency of the AWS Java SDK, something like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>aws-sdk</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.12.163</version>
</dependency>
</dependencies>
</project>
Open the folder where the pom.xml lives in your terminal application and execute mvn dependency:copy-dependencies
command
Copy all the files from target/dependency
folder of the project to "lib" folder of your JMeter installation
Restart JMeter
You should be able to use your code now