I've a Spring Cloud Data Flow Server installed on my Local. while creating a stream from source(file) to AWS-S3 as sink, I get the following error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.aws.context.support.io.ResourceLoaderBeanPostProcessor#0': Cannot resolve reference to bean 'amazonS3' while setting constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'amazonS3' defined in
org.springframework.cloud.stream.app.s3.AmazonS3Configuration: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate
[com.amazonaws.services.s3.AmazonS3]: Factory method 'amazonS3' threw exception;
nested exception is java.lang.IllegalStateException: There is not EC2 meta data available, because the application is not running in the EC2 environment. Region detection is only possible if the application is running on a EC2 instance
Caused By:
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'amazonS3' defined in org.springframework.cloud.stream.app.s3.AmazonS3Configuration: Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.amazonaws.services.s3.AmazonS3]: Factory method 'amazonS3' threw exception;
nested exception is java.lang.IllegalStateException: There is not EC2 meta data available, because the application is not running in the EC2 environment. Region detection is only possible if the application is running on a EC2 instance
What I observe is, that S3 can only be used as a sink if Spring Cloud Dataflow server is installed on AWS EC2.
Is there, any way, by which a Spring Cloud Data Flow Server installed on Local machine can be used to connect to AWS S3 bucket and use the same as sink
Maybe is a configuration issue in your dev env, As for version of spring cloud Brixton.SR7, to configure manually the region you would set in your application.properties (or .xml, .yml whatever you're using). This parameter should be ONLY for your dev env, unless you truly need to specify it in production.
cloud.aws.region.static=us-east-1
I also had to set next property for dev, but maybe you dont need it.
cloud.aws.stack.auto=false