Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

639
Vistas
AWS Secrets for application.properties with Springboot lambda functions

I have created a Spring boot application where I want to use AWS secrets for application.properties. I am using spring boot 2.2.6.RELEASE and as per the documentation I have added following dependencies in my pom:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-context</artifactId>
        <version>2.2.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-aws-secrets-manager-config</artifactId>
        <version>2.2.2.RELEASE</version>
    </dependency>

From AWS Secrets Manager service I created a new secret of type "Other types of secrets" and gave it a name /secret/myservice. For testing I added a secret key as environment and value as aws which I want to retrieve in my controller. The part which is not clear to me is the entry I need to make in my bootstrap.yml file as I am confused with the instructions in Spring Cloud AWS documentation. Could someone please provide some proper instructions as I am not able to use this feature properly. For reference I added this in my bootstrap.yml file:

aws:
    secretsmanager:
      name: myservice
      prefix: /secret
      enabled: true
      defaultContext: application
      failFast: true
cloud:
    aws:
      region:
        static: us-east-1

and trying to retrieve the environment value in the controller:

@RestController
@EnableWebMvc
public class PingController {

 @Value(value = "${environment}")
 private String environment;

 @RequestMapping(path = "/ping", method = RequestMethod.GET)
 public Map<String, String> ping() {
    Map<String, String> pong = new HashMap<>();
    pong.put("pong", "Hello, World!" + "This is " + environment + " environment...");
    return pong;
 }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Struggled with the same problem. Solved this by defining environment variables in the lambda function itself and then populating those with AWS Secrets Manager.

This way you can use a placeholder like ${property_1} in the application.properties file and this will be replaced by the Environment variable defined in the Lambda Function.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda