You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+58-11Lines changed: 58 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,6 @@ The application allows users to create ads with a picture. Ads are stored in a R
6
6
7
7
## Prerequisites
8
8
9
-
Some configurations are required in your AWS account for this sample to work. Basically, an _S3 bucket_ (by default `spring-cloud-aws-sample` is used, but it can be changed using `cloud.aws.s3.bucket` property), and an _RDS MySQL instance_ open to the world. Additionally, we need an _IAM user_ with access key and programmatic access to AWS API so that we can access AWS resources from our development machine.
10
-
11
-
### Create an IAM User
12
-
13
-
* Enable programmatic access
14
-
* Generate an access key for the user
15
-
* Give the user the following permissions:
16
-
** AmazonS3FullAccess
17
-
** AmazonRDSFullAccess
18
-
19
9
### Create an RDS Instance
20
10
21
11
**WARNING**: These instructions allow you to run and test the application from within your development environment (i.e., without deploying it to AWS) using an RDS instance open to the world, which is something you should avoid in production.
@@ -58,15 +48,72 @@ Finally, create an S3 bucket, name it `spring-cloud-aws-sample` and give read pe
58
48
]
59
49
}
60
50
51
+
### To run locally
52
+
53
+
**Note**: I was unable to run new versions of spring-cloud-aws locally. It seems it tries always to perform some autoconfiguration assuming it is deployed on AWS, and as long as it doesn't find a valid instance id, it raises an exception and stops. What follows here is the approach that worked for version 0.0.1 of the tutorial, useless in version 0.1.0. If you have an idea of how this can be solved, please fill in an issue and I'll look into it.
54
+
55
+
Some configurations are required in your AWS account for this sample to work. Basically, an _S3 bucket_ (by default `spring-cloud-aws-sample` is used, but it can be changed using `cloud.aws.s3.bucket` property), and an _RDS MySQL instance_ open to the world. Additionally, we need an _IAM user_ with access key and programmatic access to AWS API so that we can access AWS resources from our development machine.
56
+
57
+
#### Create an IAM User
58
+
59
+
* Enable programmatic access
60
+
* Generate an access key for the user
61
+
* Give the user the following permissions:
62
+
** AmazonS3FullAccess
63
+
** AmazonRDSFullAccess
64
+
65
+
### To run on EC2
66
+
67
+
#### Create an IAM role
68
+
69
+
Create an IAM role with the following properties:
70
+
71
+
* EC2 role (i.e., a role to be attached to EC2 instances)
72
+
* Policies:
73
+
** AmazonS3FullAccess
74
+
** AmazonRDSFullAccess
75
+
76
+
#### Create an EC2 instance
77
+
78
+
It has been tested with an instance with the following properties:
79
+
80
+
* AMI: Ubuntu 18.04
81
+
* Type: t2.micro
82
+
* Storage: 20Gb
83
+
* Security group: choose or create one with ports 22 and 8080 opened
84
+
* Attach the IAM role created previously
85
+
86
+
Once the instance has been started, ssh'd into the machine and issue the following commands:
87
+
88
+
```
89
+
sudo apt-get update
90
+
sudo apt-get install openjdk-8-jre-headless
91
+
```
92
+
93
+
Then from your own machine, build the jar file and upload it to your EC2 instance:
0 commit comments