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

Feat/devops #57

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/*
env/*
serverless.yml
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
dist
node_modules
node_modules
serverless.yml
20 changes: 20 additions & 0 deletions env/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
#-----------------------------------
# Lemon Basic Environment Variables.
#-----------------------------------
lemon:
name: lemon-app
runtime: nodejs16.x
region: ap-northeast-2
env: lemon.yml # environment file
bucketName: 'lemon-lemonade' # WARN! main bucket used (create before deploy).
identityPool: 'ap-northeast-2:71aca5df-260e-4c65-ab21-48bf1877ea13' # ade-user-pool-identity-pool
securityGroupIds:
subnetIds:
none:
name: none-app
runtime: nodejs16.x
region: ap-northeast-2
env: none.yml # environment file
securityGroupIds:
subnetIds:
89 changes: 10 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"express.adam": "ENV=adam STAGE=local npm run start",
"!deploy": "----- deploy to AWS by serverless -----",
"deploy.lemon": "npm run build && sls deploy --param='profile=lemon' --stage dev",
"deploy.devops": "npm run build && sls deploy --param='profile=devops' --stage dev",
"deploy.ian": "npm run build && sls deploy --param='profile=ian' --stage dev",
"deploy.lemon.prod": "npm run build && sls deploy --param='profile=lemon' --stage prod",
"deploy.jober": "npm run build && sls deploy --param='profile=jober' --stage prod",
"deploy.neuro": "npm run build && sls deploy --param='profile=neuro' --stage prod",
Expand Down Expand Up @@ -66,7 +68,7 @@
"plato": "plato -r -d complexity dist"
},
"dependencies": {
"lemon-core": "^3.2.5"
"lemon-core": "^3.2.7"
},
"devDependencies": {
"@cruglobal/serverless-merge-config": "^1.1.0",
Expand Down Expand Up @@ -95,10 +97,7 @@
"supertest": "^4.0.2",
"ts-jest": "^27.1.4",
"ts-node": "8.1.0",
"tsconfig-paths": "^4.1.2",
"ttypescript": "^1.5.15",
"typedoc": "^0.22.15",
"typescript": "^4.6.4"
"typedoc": "^0.22.15"
},
"private": false,
"author": "Steve Jung <steve@lemoncloud.io> (https://lemoncloud.io)",
Expand Down
18 changes: 11 additions & 7 deletions serverless.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serverless.yml 이파일을 직접수정한게 아닌데, 아래처럼 수정부분이 많이 나오는데
yml 파일의 lint 설정을 맞춰줘요.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ custom:
region: ${opt:region, 'ap-northeast-2'} # run option `--region` `-r`
stage: ${opt:stage, 'dev'} # run option `--stage` `-s`
env: ${param:env, './env/none.yml'} # run option `--env`
CONF: ${file(./env/config.js):CONF} # merge config from `config.js` by profile.
CONF: ${file(./env/config.yml):${self:custom.CORE.profile}} # merge config from `config.js` by profile.
#------------------------------------------------
# serverless-offline
#------------------------------------------------
Expand Down Expand Up @@ -110,9 +110,9 @@ provider:
region: ${self:custom.CONF.${self:custom.CORE.profile}.region, self:custom.CORE.region} # profile의 region를 먼저 사용하고, 없으면 실행 옵션값.

# VPC Configuration for Lambda.
vpc:
securityGroupIds: ${self:custom.CONF.${self:custom.CORE.profile}.securityGroupIds}
subnetIds: ${self:custom.CONF.${self:custom.CORE.profile}.subnetIds}
# vpc:
# securityGroupIds: ${self:custom.CONF.${self:custom.CORE.profile}.securityGroupIds}
# subnetIds: ${self:custom.CONF.${self:custom.CORE.profile}.subnetIds}

# Lambda function's IAM Role here
iamRoleStatements:
Expand Down Expand Up @@ -189,7 +189,7 @@ provider:
MY_S3_BUCKET: '${self:custom.bucketName.${self:custom.CORE.stage}}'
MY_SQS_ENDPOINT: 'https://sqs.${self:provider.region}.amazonaws.com/${aws:accountId}/${self:custom.queueName.${self:custom.CORE.stage}}' # see `sqs-service`
MY_SNS_ENDPOINT: 'arn:aws:sns:${self:provider.region}:${aws:accountId}:${self:custom.topicName.${self:custom.CORE.stage}}' # see `sns-service`
$<<: ${file(./env/${self:custom.CONF.${self:custom.CORE.profile}.env}):${self:custom.CORE.stage}}
$<<: ${file(./env/${self:custom.CONF.env}):${self:custom.CORE.stage}}

#------------------------------------------------
# Functions
Expand Down Expand Up @@ -391,7 +391,6 @@ resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
AccessControl: PublicRead
BucketName: ${self:custom.bucketName.${self:custom.CORE.stage}}
WebsiteConfiguration:
IndexDocument: index.html
Expand All @@ -406,6 +405,11 @@ resources:
- GET
- HEAD
MaxAge: 3000
PublicAccessBlockConfiguration:
BlockPublicAcls: false
OwnershipControls:
Rules:
- ObjectOwnership: ObjectWriter

# -------------------------------
# S3 Bucket
Expand All @@ -431,4 +435,4 @@ resources:
},
"/*"
]
]
]