adding latest

This commit is contained in:
2020-04-28 20:41:17 +01:00
parent 3566f7ac98
commit 1338a6677b
5 changed files with 33 additions and 18 deletions

View File

@@ -1,5 +1,8 @@
AWSTemplateFormatVersion: 2010-09-09 AWSTemplateFormatVersion: 2010-09-09
Description: S3 bucket for static assets for Strapi deployment. Description: S3 bucket for static assets for Strapi deployment.
Parameters:
TestParameter:
Type: String
Resources: Resources:
ELBExampleBucket: ELBExampleBucket:
Type: "AWS::S3::Bucket" Type: "AWS::S3::Bucket"

File diff suppressed because one or more lines are too long

9
package-lock.json generated
View File

@@ -9882,13 +9882,12 @@
"integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==" "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug=="
}, },
"sqlite3": { "sqlite3": {
"version": "4.1.1", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.1.1.tgz", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-4.2.0.tgz",
"integrity": "sha512-CvT5XY+MWnn0HkbwVKJAyWEMfzpAPwnTiB3TobA5Mri44SrTovmmh499NPQP+gatkeOipqPlBLel7rn4E/PCQg==", "integrity": "sha512-roEOz41hxui2Q7uYnWsjMOTry6TcNUNmp8audCx18gF10P2NknwdpF+E+HKvz/F2NvPKGGBF4NGc+ZPQ+AABwg==",
"requires": { "requires": {
"nan": "^2.12.1", "nan": "^2.12.1",
"node-pre-gyp": "^0.11.0", "node-pre-gyp": "^0.11.0"
"request": "^2.87.0"
} }
}, },
"sshpk": { "sshpk": {

View File

@@ -1,20 +1,9 @@
# Running notes # Running notes
create an elb with --single and --database
redeploy with username option set, does it change?
Does strapi work with a databse set in production mode?
SSH into EC2 - check if its using sqlite
deocument that the db has to be done from cli arg, but the configs can be done via files. deocument that the db has to be done from cli arg, but the configs can be done via files.
SSL? https://levelup.gitconnected.com/beginners-guide-to-aws-beanstalk-using-node-js-d061bb4b8755 SSL? https://levelup.gitconnected.com/beginners-guide-to-aws-beanstalk-using-node-js-d061bb4b8755
Add postgres to strapi
Add the S3 bucket to strapi
If doesnt work, try installing yarn in the ELB instance If doesnt work, try installing yarn in the ELB instance
Create seperate sql database + VPC rules: Create seperate sql database + VPC rules:
@@ -174,6 +163,22 @@ An example is:
} }
``` ```
## Strapi in git
To have a strapi project in github you should remove the:
- `./build`
- `./node_modules`
folders.
When cloning from the repo you should then do a:
- `NODE_ENV=development npm install`
- `NODE_ENV=development npm run build`
You can then run Strapi with `npm run develop` or `NODE_ENV=production npm run start`.
## Cloudformation ## Cloudformation
<https://adamtheautomator.com/aws-cli-cloudformation/> (example of deploying an S3 bucket with static site `index.html`.) <https://adamtheautomator.com/aws-cli-cloudformation/> (example of deploying an S3 bucket with static site `index.html`.)
@@ -219,6 +224,10 @@ Using stacks means AWS will treat all resources as a single unit. They must all
`aws --profile admin cloudformation deploy --template-file ./01-stack-storage.yaml --stack-name strapi-s3` `aws --profile admin cloudformation deploy --template-file ./01-stack-storage.yaml --stack-name strapi-s3`
You can pass paramter values in with `--paramter-overrides KEY=VALUE`:
`--parameter-overrides TestParameter="some test string"`
#### Destroy a stack #### Destroy a stack
`aws --profile admin cloudformation delete-stack --stack-name strapi-s3` `aws --profile admin cloudformation delete-stack --stack-name strapi-s3`
@@ -236,7 +245,7 @@ Suggested tags for all AWS resources are:
| environment | environment resource belongs to | `dev`, `prod` | | environment | environment resource belongs to | `dev`, `prod` |
| deployment | AWS tool used for deployment | `cloudformation`, `elb` | | deployment | AWS tool used for deployment | `cloudformation`, `elb` |
### Cloudformation ### Cloudformation default tags
For Cloudformation resources the following tags get applied automatically: For Cloudformation resources the following tags get applied automatically:

View File

@@ -9,3 +9,7 @@ When creating an ELB instance with `--single` and `--database` the following is
- RDS database - RDS database
Is the security group created without a databse? (probably yes...) Is the security group created without a databse? (probably yes...)
## Creating Database + VPC + Subnets in Cloudformation
Template from AWS showing cross-stack referencing and creating and referencing a VPC: <https://s3.amazonaws.com/cloudformation-examples/user-guide/cross-stack/SampleNetworkCrossStack.template>.