...
코드 블럭 |
---|
language | yml |
---|
theme | RDark |
---|
title | DeleteNews Template |
---|
linenumbers | true |
---|
|
DeleteNews:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: DeleteNews
Description: Delete news item in DynamoDB Table and mp3 file in S3 bucket.
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 'logs:PutLogEvents'
- 'logs:CreateLogStream'
- 'dynamodb:DeleteItem'
- 's3:DeleteObject'
Resource: '*'
Events:
DeleteNewsApi:
Type: Api
Properties:
Path: /news
Method: DELETE |
코드 블럭 |
---|
language | yml |
---|
theme | RDark |
---|
title | Template_Outpuit |
---|
linenumbers | true |
---|
|
Outputs:
WebsiteURL:
Description: Name of S3 bucket to hold website content
Value:
'Fn::Join':
- ''
- - 'https://'
- 'Fn::GetAtt':
- StaticWebBucket
- DomainName
APIEndpointURL:
Description: URL of your API endpoint
Value:
'Fn::Sub': >-
https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/news/ |
코드 블럭 |
---|
language | yml |
---|
theme | RDark |
---|
title | Template_API_CORS |
---|
linenumbers | true |
---|
|
Api:
# enable CORS; to make more specific, change the origin wildcard
# to a particular domain name, e.g. "'www.example.com'"
Cors:
AllowMethods: "'*'"
AllowHeaders: "'*'"
AllowOrigin: "'*'" |
SAM(template.yml)에 DynamoDB, SNS, S3(Web, Mp3) 리소스 추가하기
...