Skip to content

Commit 7415952

Browse files
committed
cleaning up the example
1 parent c4d1c83 commit 7415952

File tree

4 files changed

+14
-86
lines changed

4 files changed

+14
-86
lines changed

cloudformation/template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Resources:
1111
- python3.7
1212
Description: S3 Deployment Layer
1313
LicenseInfo: MIT
14-
ContentUri: ../build/python
14+
ContentUri: ../build
1515
RetentionPolicy: Retain
1616

1717
DeploymentPermission:
@@ -37,5 +37,5 @@ Metadata:
3737
ReadmeUrl: README-SAR.md
3838
Labels: ['deploy', 's3', 'lambda', 'layer', 'frontend']
3939
HomePageUrl: https://serverless.pub/deploy-frontend-to-s3-and-sar/
40-
SemanticVersion: 2.3.0
40+
SemanticVersion: 2.4.0
4141
SourceCodeUrl: https://github.com/serverlesspub/cloudformation-deploy-to-s3

example/Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
BUCKET_NAME ?= desole-packaging
21
STACK_NAME ?= s3-deployment-example
3-
REGION := us-east-1
42

53
clean:
6-
rm output-*.yml
4+
rm output.yml
75

8-
output-%.yml: template-%.yml web-site/*
9-
aws cloudformation package --template-file $< --output-template-file $@ --s3-bucket=$(BUCKET_NAME) --region $(REGION)
6+
output.yml: template.yml web-site/*
7+
aws cloudformation package --template-file $< --output-template-file $@ --s3-bucket=$(DEPLOYMENT_BUCKET_NAME)
108

11-
deploy-%: output-%.yml
12-
aws cloudformation deploy --template-file $< --stack-name $(STACK_NAME) --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND --region $(REGION)
13-
aws cloudformation describe-stacks --stack-name $(STACK_NAME) --query Stacks[].Outputs[].OutputValue --output text --region $(REGION)
9+
deploy: output.yml
10+
aws cloudformation deploy --template-file $< --stack-name $(STACK_NAME) --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND
11+
aws cloudformation describe-stacks --stack-name $(STACK_NAME) --query Stacks[].Outputs[].OutputValue --output text

example/template-layer.yml

Lines changed: 0 additions & 75 deletions
This file was deleted.

example/template-app-repo.yml renamed to example/template.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ Description: Frontend Deploy Example
55
Resources:
66
TargetBucket:
77
Type: AWS::S3::Bucket
8+
Properties:
9+
WebsiteConfiguration:
10+
IndexDocument: index.html
811

912
DeploymentLayer:
1013
Type: AWS::Serverless::Application
1114
Properties:
1215
Location:
1316
ApplicationId: arn:aws:serverlessrepo:us-east-1:375983427419:applications/deploy-to-s3
14-
SemanticVersion: 1.0.0
17+
SemanticVersion: 2.4.0
1518

1619

1720
# this function is used only during deployment,
@@ -81,3 +84,5 @@ Resources:
8184
Outputs:
8285
DestinationBucket:
8386
Value: !Ref TargetBucket
87+
DestinationUrl:
88+
Value: !GetAtt TargetBucket.WebsiteURL

0 commit comments

Comments
 (0)