For Java applications that run on AWS Fargate, implement the function to access AWS resources using the SDK.
Although IAM user credential information was used for access privileges, I am planning to shift to control by the task role set in the Fargate task.
After reading the official documentation, it was about using the ContainerCredentialsProvider class. Can you tell me how to use it?
Applicable source codeAmazonSimpleEmailService sesClient = AmazonSimpleEmailServiceClientBuilder.standard ()
.withCredentials (new ContainerCredentialsProvider ())
.withRegion (Regions.US_EAST_1)
.build ();
As mentioned above, an instance of ContainerCredentialsProvider was specified in the withCredentials method, but according to the documentation, it is desirable to specify CredentailsEndpointProvider as an argument for the constructor of this class.
I am asking how to write CredentailsEndpointProvider.
-SDK version "1.11.479" is used.
・ We coded with reference to the official document.
I would like to point out if there is an error in the best description method or implementation method.
Sorry for the rudimentary question, thank you.
-
Answer # 1
Related articles
- java - questions about the output result of the simple program
- [java] about variable initialization
- about java calculation formula
- java - about char → long type conversion
- about android application development in java
- about java overrides
- java - about sql: (colon)
- [java] about equals method (reason why nullpointerexception does not occur even if null is passed/override)
- about java version
- about java calculation formula
- java - about screen display in struts2
- i have a question about a simple problem with [java] files
- about the argument of zipentry (java: jdk16)
- java - about the minus of the method
- java - about nullpointerexception
- java - about localhost
- java - about the two arguments of onclick
- about java calculation formula
- java print method? about
- beginners about the development of java spring tool suite
Where is it written in the document?
I don't know if it's an answer, but if you don't specify
.withCredentials
, it will behave like going to get authentication information according to the default CredentialsProviderChain, so specify anything Would n’t it be better if you did n’t?Please refer to the official documentation for the credential provider chain
Quote below