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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ต.ค. 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

ความคิดเห็น • 88

  • @PhilipsMonsters
    @PhilipsMonsters 3 ปีที่แล้ว +3

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

  • @nguyenquan4836
    @nguyenquan4836 ปีที่แล้ว +2

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

  • @KrishnaVlogs898
    @KrishnaVlogs898 9 หลายเดือนก่อน +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?

  • @jpssasadara3624
    @jpssasadara3624 2 ปีที่แล้ว +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)

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      Thanks buddy 😊

  • @SunnySingh080593
    @SunnySingh080593 2 ปีที่แล้ว +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  2 ปีที่แล้ว +1

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

  • @pranavmahajan4190
    @pranavmahajan4190 ปีที่แล้ว +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  ปีที่แล้ว +1

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

    • @pranavmahajan4190
      @pranavmahajan4190 ปีที่แล้ว +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  ปีที่แล้ว +1

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

    • @pranavmahajan4190
      @pranavmahajan4190 ปีที่แล้ว

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

  • @YogeshKumar-ye8nd
    @YogeshKumar-ye8nd 2 ปีที่แล้ว +2

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

  • @jeevanragula
    @jeevanragula 3 ปีที่แล้ว +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.

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว +4

      Yes agreed ,also same we can configure in secrets manager

    • @nikinshanfaizal915
      @nikinshanfaizal915 2 ปีที่แล้ว

      Can you please explain

  • @vickeychoudhary4230
    @vickeychoudhary4230 ปีที่แล้ว +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

  • @Isranaks
    @Isranaks ปีที่แล้ว +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  ปีที่แล้ว

      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 ปีที่แล้ว

      @@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)

  • @csebreach8565
    @csebreach8565 ปีที่แล้ว +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.

  • @thajmulhussain4842
    @thajmulhussain4842 3 ปีที่แล้ว +4

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

  • @jasper5016
    @jasper5016 2 ปีที่แล้ว +3

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

  • @tarunreddy7
    @tarunreddy7 2 ปีที่แล้ว +3

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

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว +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 .

  • @Sateesh.rayapati
    @Sateesh.rayapati 2 ปีที่แล้ว

    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?

  • @kevinjia1984
    @kevinjia1984 2 ปีที่แล้ว +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  2 ปีที่แล้ว

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

  • @girishpant7653
    @girishpant7653 ปีที่แล้ว

    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?

  • @surajJr24
    @surajJr24 2 ปีที่แล้ว +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  2 ปีที่แล้ว +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

  • @sravanthik6320
    @sravanthik6320 2 ปีที่แล้ว +2

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

  • @srinath710
    @srinath710 3 ปีที่แล้ว +3

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

  • @itsnarahari
    @itsnarahari 3 ปีที่แล้ว

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

  • @tanujagrawal7805
    @tanujagrawal7805 3 ปีที่แล้ว +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  3 ปีที่แล้ว +2

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

  • @mohakgupta5614
    @mohakgupta5614 2 ปีที่แล้ว +2

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

  • @ganeshkalje9347
    @ganeshkalje9347 2 หลายเดือนก่อน

    Very well explained. Thanks

  • @davidacosta5151
    @davidacosta5151 2 ปีที่แล้ว +2

    Thank you Sir.

  • @phanimc11211
    @phanimc11211 7 หลายเดือนก่อน +1

    thx! as always your videos are always usefull

  • @kamleshbca0290
    @kamleshbca0290 ปีที่แล้ว

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

  • @aadiraj6126
    @aadiraj6126 3 ปีที่แล้ว +2

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

  • @itsnarahari
    @itsnarahari 3 ปีที่แล้ว +2

    Really helpful topic

  • @rimuru2483
    @rimuru2483 2 ปีที่แล้ว +2

    Excellently explained, thanks man!

  • @michelchaghoury9629
    @michelchaghoury9629 2 ปีที่แล้ว +1

    is AWS Secrets Manager an always free service from AWS?

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว +1

      No it's paid one

  • @ansariamin3865
    @ansariamin3865 ปีที่แล้ว +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  ปีที่แล้ว

      Haven't tried buddy. Will check and update

    • @ansariamin3865
      @ansariamin3865 ปีที่แล้ว +1

      @@Javatechie thank you that will be a great help

    • @ansariamin3865
      @ansariamin3865 ปีที่แล้ว

      @@Javatechie brother any breakthrough on this?

  • @narendragupta6114
    @narendragupta6114 8 หลายเดือนก่อน +1

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

    • @Javatechie
      @Javatechie  8 หลายเดือนก่อน

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

  • @సంతొష్కుమర్రుత్తల

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

  • @tree2rhym
    @tree2rhym 2 ปีที่แล้ว +2

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

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      You should keep this in secret

  • @HemantKumar_rocks
    @HemantKumar_rocks 3 ปีที่แล้ว +2

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

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      Yes

    • @kambalavijay6800
      @kambalavijay6800 2 ปีที่แล้ว

      @@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?

  • @rakeshuppala4342
    @rakeshuppala4342 2 ปีที่แล้ว +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

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      Okay i will check

  • @LoveShaminiGovind
    @LoveShaminiGovind 3 ปีที่แล้ว +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  3 ปีที่แล้ว

      Not sure need to check

    • @LoveShaminiGovind
      @LoveShaminiGovind 3 ปีที่แล้ว

      @@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.

    • @LoveShaminiGovind
      @LoveShaminiGovind 3 ปีที่แล้ว +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  3 ปีที่แล้ว

      Did you configure valid username and password while creating secret manager

    • @LoveShaminiGovind
      @LoveShaminiGovind 3 ปีที่แล้ว +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.
      🙏

  • @mysavingclub
    @mysavingclub 3 ปีที่แล้ว

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

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

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

    • @mysavingclub
      @mysavingclub 3 ปีที่แล้ว +1

      @@Javatechie I emailed you. pls reply

  • @pratishrutipanda6461
    @pratishrutipanda6461 3 ปีที่แล้ว +2

    Nice content

  • @ravikumarprajapati3950
    @ravikumarprajapati3950 ปีที่แล้ว

    Hi sir I have to configured but why used gson

  • @PixelLoafLatte
    @PixelLoafLatte 2 ปีที่แล้ว

    can you make tutorial about AWS Parameter Store too?

  • @sunnylohana2229
    @sunnylohana2229 3 ปีที่แล้ว +1

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

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      It's same as secret manager man

  • @selvapandymoorthy4173
    @selvapandymoorthy4173 3 ปีที่แล้ว +1

    Good work 😊

  • @avinashkv4913
    @avinashkv4913 2 ปีที่แล้ว +1

    Sir aws secret manager is an open source platform

    • @Javatechie
      @Javatechie  2 ปีที่แล้ว

      Yes but it's chargeable as per AWS policy

  • @SandeepAS-ov3fk
    @SandeepAS-ov3fk 8 หลายเดือนก่อน +1

    thank you

  • @codewithraj9517
    @codewithraj9517 4 หลายเดือนก่อน

    How to retrieve the secret key

  • @srikanthv9641
    @srikanthv9641 3 ปีที่แล้ว +1

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

    • @Javatechie
      @Javatechie  3 ปีที่แล้ว

      I never tried this but definitely I will check

  • @Antonio-tv8gi
    @Antonio-tv8gi 3 ปีที่แล้ว

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

  • @narendragupta6114
    @narendragupta6114 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน

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