Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter Store cannot be disabled in profile-specific config file #1110

Open
dominik-kovacs opened this issue Mar 20, 2024 · 3 comments
Open
Assignees
Labels
component: parameter-store Parameter Store integration related issue component: secrets-manager Secrets Manager integration related issue
Milestone

Comments

@dominik-kovacs
Copy link

dominik-kovacs commented Mar 20, 2024

Type: Bug

Component:
Parameter Store (v3.1.1)

Describe the bug
Parameter Store cannot be disabled in a profile-specific config file

Sample
working example

application.yml

spring:
  config:
    import:
      - aws-parameterstore:/ecs-config/application/

  cloud:
    aws:
      parameterstore:
        enabled: false  

not working example

application.yml

spring:
  config:
    import:
      - aws-parameterstore:/ecs-config/application/

together with
application-dev.yml

spring:
  cloud:
    aws:
      parameterstore:
        enabled: false  

the application does not start with dev profile

err:

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data resource '[ParameterStoreConfigDataResource@306851c7 context = '/ecs-config/application/', optional = false]' via location 'aws-parameterstore:/ecs-config/application/' does not exist

Action:

Check that the value 'aws-parameterstore:/ecs-config/application/' at class path resource [application.yml] - 4:9 is correct, or prefix it with 'optional:'

Minimal non-working example project
https://github.com/dominik-kovacs/spring-cloud-aws-parameter-store-demo

@tinah-1973
Copy link

You can set the import to optional:

optional:aws-parameterstore:/ecs-config/application/

@dominik-kovacs
Copy link
Author

@tinah-1973 thank you but I don't want to have it optional. I need it to fail when there is a missing config in prod env for example

@maciejwalkowiak maciejwalkowiak self-assigned this Mar 30, 2024
@maciejwalkowiak maciejwalkowiak added this to the 3.2.0 M2 milestone Mar 30, 2024
@maciejwalkowiak maciejwalkowiak added component: parameter-store Parameter Store integration related issue component: secrets-manager Secrets Manager integration related issue labels Mar 30, 2024
@dominik-kovacs
Copy link
Author

I am playing with it a bit more, looks like no spring.cloud.aws.parameterstore.* property can be overridden by a profile-specific config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: parameter-store Parameter Store integration related issue component: secrets-manager Secrets Manager integration related issue
Projects
None yet
Development

No branches or pull requests

3 participants