| name | add-aws-integration |
| description | Add a new AWS service integration to odin-scout-ent. Covers adding SDK dependencies, creating client methods in AwsDiscoveryAdapter, and wiring through ports and services. Use when the user wants to integrate a new AWS service, add AWS API calls, or extend cloud discovery. |
Add AWS Integration
Add a new AWS service to AwsDiscoveryAdapter.
Workflow
Step 1: Add SDK Dependency
Add to pom.xml under the existing AWS SDK BOM:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>new-service</artifactId>
</dependency>
The version is managed by software.amazon.awssdk:bom.
Step 2: Define Domain Port
In com.odin.scout.domain.port, add methods to an existing port or create a new *Port interface:
public interface NewServicePort {
List<NewResource> listResources(String roleArn, String region);
}
Step 3: Implement in AwsDiscoveryAdapter
Add the port to the implements list of AwsDiscoveryAdapter. Follow the existing pattern:
@Override
public List<NewResource> listResources(String roleArn, String region) {
var credentials = credentialProviderFactory.create(roleArn);
try (var client = newServiceClient(credentials, Region.of(region))) {
var response = client.listResources(ListResourcesRequest.builder().build());
return response.resources().stream()
.map(r -> new NewResource(r.id(), r.name()))
.toList();
} catch (SdkException e) {
throw new AwsConnectionException("Failed to list resources", e);
}
}
private NewServiceClient newServiceClient(AwsCredentialsProvider creds, Region region) {
return NewServiceClient.builder()
.credentialsProvider(creds)
.region(region)
.build();
}
Step 4: Handle Mock Mutations
For write operations, gate behind mockMutations:
if (mockMutations) {
return new ActionResult(true, "Mock mode: skipped mutation");
}
Step 5: Handle Skip AssumeRole
Read operations use credentialProviderFactory.create(roleArn) which already handles skipAssumeRole. No extra work needed for read-only calls.
Step 6: Wire Through Service and Controller
Follow the add-api-endpoint skill for remaining layers.
Checklist