Reputation: 146
I want to construct an SNS topic ARN dynamically inside the application where the topic name remains constant. I do not want to pass topic ARN as environment variables or I do not want to call createArn either.
Or is there any way to fetch accountId and region from snsClient?
I am using the following dependency:
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sns</artifactId>
<version>2.15.50</version>
</dependency>
Upvotes: 0
Views: 354
Reputation: 267
The STS Client's getCallerIdentity
method should help you get the information.
but there could be few other ways to get the information in the ECS container as well.
Upvotes: 1