Spring Boot | Manage your credentials using AWS Secrets Manager | RDS | JavaTechie

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • In this tutorial I’m going to show you How to use AWS secrets-manager for storing and retrieving Datasource properties of RDS and make connection from spring boot application
    #javatechie #SpringBoot #AWS #SecretsManager
    GitHub:
    github.com/Jav...
    Blogs:
    / javatechie4u
    Facebook:
    / 919464521471923
    guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
    Disclaimer/Policy:
    --------------------------------
    Note : All uploaded content in this channel is mine and its not copied from any community , you are free to use source code from above mentioned GitHub account

Komentáře • 88

  • @PhilipsMonsters
    @PhilipsMonsters Před 3 lety +3

    Java Techie, you helped me a lot this week at my job, thanks your video. Thanks very much!

  • @nguyenquan4836
    @nguyenquan4836 Před rokem +2

    Thank you so much!! My enjoy is watching your video.

  • @jpssasadara3624
    @jpssasadara3624 Před rokem +2

    thanks so much. well explained video series which was really helpful to get a deep idea about the deployment process of AWS very quickly. thanks again. keep it up !!! (From Sri lanka)

  • @ganeshkalje9347
    @ganeshkalje9347 Před měsícem

    Very well explained. Thanks

  • @jasper5016
    @jasper5016 Před 2 lety +3

    Thanks so much, brother. It's an amazing video.

  • @tanujagrawal7805
    @tanujagrawal7805 Před 3 lety +2

    Very Good work Sir, Please Keep It Up, It take Lot of of effort to provide such point to point content in very easy way , Thanks sir

    • @Javatechie
      @Javatechie  Před 3 lety +2

      Thanks Tanuj . Yeah it really required a big effort to prepare and edit each video

  • @KrishnaVlogs898
    @KrishnaVlogs898 Před 8 měsíci +2

    @Basant , could you please create a video for storing JKS and Truststore files in secret manager and use them in spring boot class while making call to a third party client using rest api with sending request body?

  • @itsnarahari
    @itsnarahari Před 3 lety +2

    Really helpful topic

  • @thajmulhussain4842
    @thajmulhussain4842 Před 3 lety +4

    Please provide a video for .. how transactions happen in micro services by using Sega design pattern

  • @mohakgupta5614
    @mohakgupta5614 Před 2 lety +2

    Great video, realy helped me to get this working quickly. keep up the good work !!!

  • @jeevanragula
    @jeevanragula Před 3 lety +5

    Instead of providing client id and secret in yml, we can make use of aws roles if application is deployed in EC2 and get the secret using that role.

  • @srinath710
    @srinath710 Před 3 lety +3

    Please post a video A synchronous communication between micro services using apache Kafka

  • @davidacosta5151
    @davidacosta5151 Před 2 lety +2

    Thank you Sir.

  • @YogeshKumar-ye8nd
    @YogeshKumar-ye8nd Před 2 lety +2

    you have hard coded the secret key and secret ID
    but it changes frequency
    this is not right way to retrieve the credential

  • @rimuru2483
    @rimuru2483 Před 2 lety +2

    Excellently explained, thanks man!

  • @pratishrutipanda6461
    @pratishrutipanda6461 Před 3 lety +2

    Nice content

  • @sravanthik6320
    @sravanthik6320 Před 2 lety +2

    could you also explain other way to integrate with secret manager in spring boot using secret manager config dependency

  • @aadiraj6126
    @aadiraj6126 Před 3 lety +2

    Sir, a complete tutorial video on "Keycloak"...pls!🙏

  • @pranavmahajan4190
    @pranavmahajan4190 Před rokem +2

    Thanks for the video Basant. I have a question, we cannot deploy application to production with our access keys and secret keys. How do you deploy without using access key or secret key?

    • @Javatechie
      @Javatechie  Před rokem +1

      No it's required instead of keep them in project keep it external either in vault or secret manager

    • @pranavmahajan4190
      @pranavmahajan4190 Před rokem +1

      @@Javatechie - Thanks Basant, my question is, here we are using "our personal" Access key and secret key. Every developer cannot use his own personal keys. In this case, how do you deploy on production? Which keys will be used?

    • @Javatechie
      @Javatechie  Před rokem +1

      In real-time we should use organisation provided AWS account not personal one buddy 🤗

    • @pranavmahajan4190
      @pranavmahajan4190 Před rokem

      @@Javatechie - Ohh I was expecting more of using some type of IAM role and provide the configuration for that. Thanks for the help!

  • @phanimc11211
    @phanimc11211 Před 6 měsíci +1

    thx! as always your videos are always usefull

  • @SunnySingh080593
    @SunnySingh080593 Před 2 lety +4

    Excellent Demo, But don't you think accessKey and SecretKey in itself credentials and we should not be storing them in properties?

    • @Javatechie
      @Javatechie  Před 2 lety +1

      Yes agreed it should be kept either in vault or AWS secret manager

  • @csebreach8565
    @csebreach8565 Před rokem +1

    Great explanation, I have doubt, is it not important to store the acess key and secret key like database passwords. If we have to not use access and secret key directly how can we do @javatechie. Here we are using directly by declaring in yml file.

  • @SandeepAS-ov3fk
    @SandeepAS-ov3fk Před 7 měsíci +1

    thank you

  • @kevinjia1984
    @kevinjia1984 Před 2 lety +2

    Thanks for the nice video. What if for the secret I fetching I need to inject the it into a property define in the property file for example application.secretkey = {{key placeholder}}. How can we achieve that ?

    • @Javatechie
      @Javatechie  Před 2 lety

      No we can't do that you need to get it from AWS secret object

  • @tarunreddy7
    @tarunreddy7 Před 2 lety +3

    What's the point of concealing DB credentials when you hardcode the main account's access key and secret key?

    • @Javatechie
      @Javatechie  Před 2 lety +2

      No it's Just demo which will explain how to work with AWS secret manager . Infact you can configure AWS secret and access key in secrets .

  • @surajJr24
    @surajJr24 Před 2 lety +2

    is it safe to store access key id and security key id in the application.properties if not where we should keep it?

    • @Javatechie
      @Javatechie  Před 2 lety +1

      It's always risky to store in application.prioerties you should always choose one of below vault , consul , config server or cloud secret manager

  • @vickeychoudhary4230
    @vickeychoudhary4230 Před rokem +2

    Thanks Basant sir , it is really good that you are explaining live. I have a question on this how we can do configuration for multiple database is it possible with same or we should use parameter store

  • @selvapandymoorthy4173
    @selvapandymoorthy4173 Před 3 lety +1

    Good work 😊

  • @rakeshuppala4342
    @rakeshuppala4342 Před rokem +1

    Can you please create a video to call third party api from aws lambda function and handle file downloads and processing inside aws lambda function

  • @ansariamin3865
    @ansariamin3865 Před rokem +2

    Guyz I am trying to integrate the secret Manager on on premise web server…. We have jboss eap which is connecting to cloud database now I want to mask the id and password using secret manager on the on prem server… have tried multiple method online but nothing seems to work ……does anyone have document for this will by much help

    • @Javatechie
      @Javatechie  Před rokem

      Haven't tried buddy. Will check and update

    • @ansariamin3865
      @ansariamin3865 Před rokem +1

      @@Javatechie thank you that will be a great help

    • @ansariamin3865
      @ansariamin3865 Před rokem

      @@Javatechie brother any breakthrough on this?

  • @girishpant7653
    @girishpant7653 Před rokem

    My point is this support the password rotation? If not then any idea how that can be supported directly or we have to use cache?

  • @narendragupta6114
    @narendragupta6114 Před 7 měsíci +1

    I have tried same approach but i am not able to make mysql db connection

    • @Javatechie
      @Javatechie  Před 7 měsíci

      Please add log statements and validate whether value is loading to your application or not?

  • @kamleshbca0290
    @kamleshbca0290 Před rokem

    What will happen when someone gain the access of access token and secret key from .yml file. Can't it be then exploited???

  • @Isranaks
    @Isranaks Před rokem +1

    Good video. One more question, how to remove hardcoded secret key and access key from YAML and fetch it from secrets manager?

    • @Javatechie
      @Javatechie  Před rokem

      The way i have configured other fields in the similar way is to configure these 2 values and load them using the secret manager

    • @Isranaks
      @Isranaks Před rokem

      @@Javatechie I don't think we can able to retrieve them in the above manner. Because accessing secret manager first we need to access AWS by using credentials(access key/secret key). My only question here is, how we can securely maintain these values(without exposing publicly)

  • @tree2rhym
    @tree2rhym Před 2 lety +2

    but how to secure the access key ? which we already put in yaml file

  • @Sateesh.rayapati
    @Sateesh.rayapati Před 2 lety

    Nice. One question how app will get when there is change credentials without restart? is there any inbuilt code to handle this like spring cloud bus with config?

  • @ravikumarprajapati3950

    Hi sir I have to configured but why used gson

  • @user-qo5fm1ow9v
    @user-qo5fm1ow9v Před rokem +1

    Can we store jks and other certs in secrets manager and load them in spring boot?

    • @Javatechie
      @Javatechie  Před rokem

      Yes we can

    • @user-qo5fm1ow9v
      @user-qo5fm1ow9v Před rokem

      @@Javatechie how can we store jks certs, as it is file there is no option use file as value in secrets manager?

  • @sunnylohana2229
    @sunnylohana2229 Před 2 lety +1

    Can you please create a video on AWS parameter store with springboot?

  • @itsnarahari
    @itsnarahari Před 3 lety

    What is the best place to host our microservices bro azure or AWS or cloudfoundry ?

  • @PixelLoafLatte
    @PixelLoafLatte Před 2 lety

    can you make tutorial about AWS Parameter Store too?

  • @Animalcrossing-v3i
    @Animalcrossing-v3i Před 3 lety +1

    very good hands-on tutorial.
    My database is rds- postgresql, tried all the settings and steps to establish connection but getting error.
    org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception
    I am able to connect to RDS with my account (accessKey, secretKey, region).. but with the above video, am getting exception.
    any help with postgresql is appreciated.
    GK.

    • @Javatechie
      @Javatechie  Před 3 lety

      Not sure need to check

    • @Animalcrossing-v3i
      @Animalcrossing-v3i Před 3 lety

      @@Javatechie
      Unable to build Hibernate SessionFactory; nested exception is java.lang.RuntimeException:
      Driver org.postgresql.Driver claims to not accept
      jdbcUrl, jdbc:postgres://xxxxx.xxxxx.ap-southeast-1.rds.amazonaws.com:5432/xxxxx
      this is the latest error. I have specified the driverClassName, but something wrong not able to detect.

    • @Animalcrossing-v3i
      @Animalcrossing-v3i Před 3 lety +1

      @Java Techie,
      The rds secrets manager returns the engine as "postgres", while the latest driver supports "postgresql".
      I have append "ql" to the engine (data source property). you get the url
      jdbc:postgresql://xxxxx.xxxxx.ap-southeast-1.rds.amazonaws.com:5432/xxxxx
      no complaints.. but different error now -- unable to open JDBC connection for DDL execution.. Atleast the main error is gone.
      Thanks

    • @Javatechie
      @Javatechie  Před 3 lety

      Did you configure valid username and password while creating secret manager

    • @Animalcrossing-v3i
      @Animalcrossing-v3i Před 3 lety +1

      @@Javatechie
      Yes, the configuration is all good. The reason for the connection timeout is that my RDS is in a private subnet. This is not accessible from my local machine (windows), only accessible when the code is shipped into AWS infra (EC2) and executed.
      Do you know how to create separate configuration for local environment (picking up from application-properties) and when shipped into AWS the datasource to be loaded from AWS secrets manager.
      Thank you for all your help.
      🙏

  • @codewithraj9517
    @codewithraj9517 Před 3 měsíci

    How to retrieve the secret key

  • @HemantKumar_rocks
    @HemantKumar_rocks Před 3 lety +2

    is it safe to add client id and secret key of aws in application.properties?

    • @Javatechie
      @Javatechie  Před 3 lety

      Yes

    • @kambalavijay6800
      @kambalavijay6800 Před 2 lety

      @@Javatechie If one can manage to get hold of client id and secret key, they can easily manage to break into credentials manager right? One simply write this client program with the given client id and secret key and can access the rds right?

  • @avinashkv4913
    @avinashkv4913 Před rokem +1

    Sir aws secret manager is an open source platform

    • @Javatechie
      @Javatechie  Před rokem

      Yes but it's chargeable as per AWS policy

  • @michelchaghoury9629
    @michelchaghoury9629 Před 2 lety +1

    is AWS Secrets Manager an always free service from AWS?

  • @mysavingclub
    @mysavingclub Před 3 lety

    Which s/w you use for video recording and editing? Pls reply

    • @Javatechie
      @Javatechie  Před 3 lety

      I am using paid one . Please mail me javatechie4u@gmail.com

    • @mysavingclub
      @mysavingclub Před 3 lety +1

      @@Javatechie I emailed you. pls reply

  • @Antonio-tv8gi
    @Antonio-tv8gi Před 3 lety

    Puta de um trampo, o que antes era resumido em duas linhas do properties

  • @srikanthv9641
    @srikanthv9641 Před 3 lety +1

    Bro why don’t you don’t video on quarkus Technology on reactive

    • @Javatechie
      @Javatechie  Před 3 lety

      I never tried this but definitely I will check

  • @narendragupta6114
    @narendragupta6114 Před 7 měsíci +1

    Getting below error i have tried many solution but still have same issue com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
    The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

    • @Javatechie
      @Javatechie  Před 7 měsíci

      Seems value is not loading for you . Please debug and check also cross verify with my code you might be missing something