This project is a console application built using .NET 8.0, demonstrating how to securely retrieve secrets from AWS Secrets Manager and read the caller's identity from AWS Security Token Service (STS). The application is designed to help developers integrate AWS SDK into their .NET applications for managing secrets and accessing AWS resources securely.
- AWS Secrets Manager Integration: Securely retrieve secrets stored in AWS Secrets Manager.
- AWS Security Token Service (STS) Integration: Retrieve and display the caller's identity ARN.
- Configuration Management: Utilize
appsettings.jsonand environment variables for configuration.
- .NET 8.0
- AWS SDK for .NET
AWSSDK.SecretsManagerAWSSDK.SecurityToken
- Microsoft.Extensions.Configuration
Microsoft.Extensions.Configuration.JsonMicrosoft.Extensions.Configuration.EnvironmentVariables
- .NET 8.0 SDK
- AWS account with appropriate permissions
- AWS CLI configured with the necessary credentials
-
Clone the Repository:
git clone https://github.com/yourusername/AwsRdsKmsConsoleApp.git cd AwsRdsKmsConsoleApp -
Configure the Application: Update the
appsettings.jsonfile with your AWS region and secret name:{ "AWS": { "Region": "your-region" }, "SecretsManager": { "SecretName": "your-secret-name" } } -
Build and Run the Application:
dotnet build dotnet run
Upon running the application, it will retrieve a secret from AWS Secrets Manager and print it to the console. Additionally, it includes a utility method to get the caller's identity ARN from AWS STS.
AwsRdsKmsConsoleApp/
├── AwsRdsKmsConsoleApp.csproj
├── Program.cs
├── Extensions.cs
├── appsettings.json
└── README.md
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have any suggestions or improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please contact Hriday Sheth.