A developer is deploying a Go-based daemon to an on-premises server. The daemon must interact with Amazon DynamoDB and AWS Secrets Manager. To comply with strict security policies, no long-term AWS credentials can be stored on the server's local disk. The enterprise has an existing internal authentication service running at `http://internal-auth.local` that generates temporary AWS credentials upon successful authentication. Which two actions should the developer take to configure the AWS SDK in the Go application to automatically retrieve and use these credentials?
- Configure a profile in the shared AWS config file on the server, specifying the credential_process parameter pointing to a script that queries the internal service and outputs the credentials in the required JSON format.Cevap
- BSet the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables on the server to the URL of the internal authentication service.
- CDefine a custom IAM trust policy for the target IAM role that allows the public IP address of the on-premises server to assume the role without providing credentials.
- Set the AWS_PROFILE environment variable on the server to the name of the profile containing the credential_process configuration.Cevap
- EInitialize the SDK client in the Go application code by setting the CredentialProviderEndpoint parameter to point to the URL of the internal authentication service.
Cevap
Configure a profile in the shared AWS config file on the server, specifying the credential_process parameter pointing to a script that queries the internal service and outputs the credentials in the required JSON format, and set the AWS_PROFILE environment variable on the server to the name of the profile containing the credential_process configuration.
The correct combination of steps involves configuring the credential_process parameter in the shared AWS config file and setting the AWS_PROFILE environment variable. The credential_process config option allows the AWS SDK to execute an external tool or script, retrieve temporary AWS credentials in a standard JSON format, and automatically handle credential caching and expiration. Setting the AWS_PROFILE environment variable points the SDK to the custom profile that specifies the external process configuration.
Adım Adım Çözüm
Anahtar Kavram
AWS SDK Credential Resolution via External Process