17

How can I disable the Cloudformation in a spring boot app that using spring cloud AWS?

I keep getting this error when running my app on amazon:

...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.aws.core.env.stack.config.StackResourceRegistryFactoryBean]: Factory method 'stackResourceRegistryFactoryBean' threw exception; nested exception is com.amazonaws.AmazonServiceException: Stack for i-b5ce9e32 does not exist (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 75b3076a-176d-11e6-90cc-b55a643dc6d6)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
        ... 82 more
Caused by: com.amazonaws.AmazonServiceException: Stack for i-b5ce9e32 does not exist (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 75b3076a-176d-11e6-90cc-b55a643dc6d6)
        at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1389)
        at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:902)
        at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.ja
...

I doesn't want to use cloudformation. (At least for now.)

Lakatos Gyula
  • 3,949
  • 7
  • 35
  • 56

1 Answers1

35

I have the following line in my application.properties (spring boot) file

cloud.aws.stack.auto=false

Official documentation: 4.5. CloudFormation configuration in Spring Boot

9bO3av5fw5
  • 882
  • 5
  • 14
zapl
  • 63,179
  • 10
  • 123
  • 154
  • Thanks a lot! The second line is not required. – Lakatos Gyula May 11 '16 at 12:17
  • @LakatosGyula indeed, I just figured out it's for testing locally. Moved it to the local testing profile – zapl May 11 '16 at 12:23
  • Is this property valid in spring-cloud-aws 3? – riteshmaurya Aug 07 '23 at 21:19
  • 1
    @riteshmaurya https://github.com/awspring/spring-cloud-aws#supported-aws-integrations so far no CloudFormation support so it's not valid as far as I can tell. You can still set static regions etc: https://docs.awspring.io/spring-cloud-aws/docs/3.0.1/reference/html/index.html#region – zapl Aug 08 '23 at 00:09