forked from aws-samples/retail-demo-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
894 lines (804 loc) · 35.9 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
---
AWSTemplateFormatVersion: 2010-09-09
# Do NOT remove the RETAIL_DS prefix in the template description below!
Description: >
RETAIL_DS: This template deploys the Retail Demo Store reference architecture and workshop notebooks.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "Retail Demo Store Deployment Configuration"
Parameters:
- ResourceBucket
- ResourceBucketRelativePath
- CreateElasticsearchServiceLinkedRole
- Label:
default: "Source Deployment Approach"
Parameters:
- SourceDeploymentType
- Label:
default: "GitHub Linked Deployment (only required for GitHub deployment approach)"
Parameters:
- GitHubRepo
- GitHubBranch
- GitHubToken
- GitHubUser
- Label:
default: "Auto-Build Resources"
Parameters:
- PreIndexElasticsearch
- PreCreatePersonalizeResources
- PreCreatePinpointWorkshop
- PinpointEmailFromAddress
- PinpointEmailFromName
- PinpointSMSLongCode
- Label:
default: "Use default IVS streams"
Parameters:
- UseDefaultIVSStreams
- Label:
default: "Create Location and Personalised Offers resources"
Parameters:
- DeployLocationServices
- DeployPersonalizedOffersCampaign
- Label:
default: "Amazon Pay (optional)"
Parameters:
- AmazonPayStoreId
- AmazonPayMerchantId
- AmazonPayPublicKeyId
- AmazonPayPrivateKey
- Label:
default: "Alexa Convenience Store Demo"
Parameters:
- AlexaSkillId
- AlexaAmazonPayDefaultSandboxEmail
- Label:
default: "Optional Integrations"
Parameters:
- AmplitudeApiKey
- OptimizelySdkKey
- IncludeSegmentDependencies
- SegmentWriteKey
- IncludemParticleDependencies
- mParticleOrgId
- mParticleApiKey
- mParticleSecretKey
- mParticleS2SApiKey
- mParticleS2SSecretKey
- GoogleAnalyticsMeasurementId
- Label:
default: "Fenix Commerce EDD Integration"
Parameters:
- FenixZipDetectUrl
- FenixTenantId
- FenixEddEndpoint
- FenixMonetaryValue
- FenixEnabledPdp
- FenixEnabledCart
- FenixEnabledCheckout
ParameterLabels:
ResourceBucket:
default: "Deployment Resources Staging Bucket Name"
ResourceBucketRelativePath:
default: "Deployment Resources Staging Bucket Relative Path (optional)"
CreateElasticsearchServiceLinkedRole:
default: "Create Elasticsearch Service Role?"
SourceDeploymentType:
default: "Deployment Type"
GitHubRepo:
default: "GitHub Repository Name"
GitHubBranch:
default: "GitHub Branch"
GitHubToken:
default: "GitHub Personal Access Token"
GitHubUser:
default: "GitHub Username"
PreIndexElasticsearch:
default: "Auto-Load Elasticsearch Index"
PreCreatePersonalizeResources:
default: "Auto-Build Personalize Resources"
PreCreatePinpointWorkshop:
default: "Auto-Configure Pinpoint"
PinpointEmailFromAddress:
default: "Reply-To email address"
PinpointEmailFromName:
default: "Reply-To name"
PinpointSMSLongCode:
default: "Pinpoint SMS long code"
UseDefaultIVSStreams:
default: "Use default IVS streams"
DeployLocationServices:
default: "Deploy Location Services resources"
DeployPersonalizedOffersCampaign:
default: "Deploy personalized offers and pickup notices using Location Services geofencing"
AmplitudeApiKey:
default: "Amplitude API Key"
OptimizelySdkKey:
default: "Optimizely SDK Key"
AmazonPayStoreId:
default: "Store ID of Amazon Pay sandbox account"
AmazonPayMerchantId:
default: "Merchant ID of Amazon Pay sandbox account"
AmazonPayPublicKeyId:
default: "Public key ID associated with Amazon Pay sandbox account"
AmazonPayPrivateKey:
default: "Private key associated with Amazon Pay sandbox account"
AlexaSkillId:
default: "ID of C-Store Demo Alexa skill to access Retail Demo Store"
AlexaAmazonPayDefaultSandboxEmail:
default: "An email to test Alexa integration in case you have not set up Cognito authorisation to link your Retail Demo Store account"
IncludeSegmentDependencies:
default: "Deploy Segment Resources"
SegmentWriteKey:
default: "Segment Write Key"
IncludemParticleDependencies:
default: "Deploy mParticle Resources"
mParticleOrgId:
default: "mParticle Org Id"
mParticleApiKey:
default: "mParticle event API Key"
mParticleSecretKey:
default: "mParticle event api Secret Key"
mParticleS2SApiKey:
default: "mParticle server to server API Key"
mParticleS2SSecretKey:
default: "mParticle server to server Secret Key"
GoogleAnalyticsMeasurementId:
default: "Google Analytics Measurement Id"
FenixZipDetectUrl:
default: "Fenix Zipcode Detect URL"
FenixTenantId:
default: "Fenix Commerce Tenant Id"
FenixEddEndpoint:
default: "Fenix Commerce API End Point"
FenixMonetaryValue:
default: "Fenix Commerce default monetary value"
FenixEnabledPdp:
default: "Fenix Commerce enable EDD on PDP"
FenixEnabledCart:
default: "Fenix Commerce enable EDD on CART"
FenixEnabledCheckout:
default: "Fenix Commerce enable EDD on Checkoutpage"
Parameters:
ResourceBucket:
Type: String
Description: >
S3 bucket name where the Retail Demo Store deployment resources are staged (product images, nested CloudFormation templates, source code snapshot,
notebooks, deployment Lambda code, etc).
ResourceBucketRelativePath:
Type: String
Description: >
Optional path in the Deployment Resources Staging bucket where the deployment resources are stored (e.g. path/path2/).
Leave blank if resources are at the root of the Staging Resource Bucket. If specified, MUST end with '/'.
CreateElasticsearchServiceLinkedRole:
Type: String
Description: >
If your account already has an IAM Role named 'AWSServiceRoleForAmazonElasticsearchService', select 'No'. Otherwise, select 'Yes' and one will be created automatically.
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
SourceDeploymentType:
Type: String
Description: >
The Retail Demo Store deployment includes a CodePipeline configuration that will build and deploy Retail Demo Store
microservices to ECS when a change is detected in the source repository. The source repository for CodePipeline
can be configured to use your personal GitHub repository or CodeCommit. Use GitHub if you're actively developing
against Retail Demo Store in your own fork. CodeCommit is useful when you just want to get up and going quickly for
a demo or evaluation or for workshop scenarios, such as Event Engine, where you want attendees to have their own
source repositories provisioned.
AllowedValues:
- "GitHub"
- "CodeCommit"
Default: "CodeCommit"
GitHubRepo:
Type: String
Description: Name of Retail Demo Store GitHub repository in your GitHub account.
Default: retail-demo-store
GitHubBranch:
Type: String
Description: Name of GitHub branch to link to this Retail Demo Store deployment.
Default: master
GitHubToken:
Type: String
Description: GitHub Personal Access Token for your GitHub account. Be sure that your token has the "repo", "repo:status", and "admin:repo_hook" permission scopes.
NoEcho: true
GitHubUser:
Type: String
Description: Your GitHub username.
Default: MichaelXCChens
PreIndexElasticsearch:
Type: String
Description: >
Automatically index the Retail Demo Store products in Elasticsearch. Otherwise, select 'No' if you would
prefer to complete this process yourself by stepping through the Search workshop included in this deployment
as a Jupyter notebook in SageMaker.
AllowedValues:
- "Yes"
- "No"
Default: "No"
PreCreatePersonalizeResources:
Type: String
Description: >
Automatically trigger the background creation of Amazon Personalize resources such as solutions, campaigns, and recommenders at
deployment time. Otherwise, select 'No' if you would prefer to complete this process yourself by stepping through the Personalization
workshops included in this deployment. Note that the background create process runs after deployment finishes and can take 2+ hours to complete.
AllowedValues:
- "Yes"
- "No"
Default: "No"
PreCreatePinpointWorkshop:
Type: String
Description: >
Automatically configure Pinpoint with messaging templates, segments, and campaigns. Otherwise, select 'No' if you would
prefer to complete this process yourself by stepping through the Messaging workshop included in your deployment as a Jupyter notebook
in SageMaker. Note that this option is dependent on Auto-Build Personalize Campaigns being enabled AND completed.
AllowedValues:
- "Yes"
- "No"
Default: "No"
PinpointEmailFromAddress:
Type: String
Description: >
Email address to use as Reply-To when sending emails from Pinpoint. This parameter is required when 'Auto-Configure Pinpoint'
is set to 'Yes'.
PinpointEmailFromName:
Type: String
Description: >
Name to use with Reply-To email address when sending emails from Pinpoint. This parameter only applies when 'Auto-Configure Pinpoint'
is set to 'Yes'.
Default: "AWS Retail Demo Store"
UseDefaultIVSStreams:
Type: String
Description: >
Whether to create and use the default Interactive Video Service (IVS) streams hosted by AWS. If 'No', then new IVS streams will be created and streams
created based on any videos placed in the CloudFormation resource bucket. IMPORTANT: IVS is currently only supported in the N. Virginia (us-east-1),
Oregon (us-west-2), and Ireland (eu-west-1) regions. If deploying to an unsupported region, be sure to select 'Yes' for this parameter.
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
PinpointSMSLongCode:
Type: String
Description: >
A dedicated long code (i.e. a phone number) obtained for Amazon Pinpoint to send and receive messages at. Be sure to enable two way SMS for this long code using Pinpoint. Follow steps 2 and 3 in the Messaging workshop(https://github.com/MichaelXCChens/retail-demo-store/blob/master/workshop/4-Messaging/4.1-Pinpoint.ipynb)
to get a long code. This parameter only applies when 'Auto-Configure Pinpoint' is set to 'Yes'. Enter the number along with the country code and without any spaces or brackets. For Example: enter "+1XXXXXXXXXX" for a long code based in the United States.
AmplitudeApiKey:
Type: String
Description: Amplitude API key for integrated product analytics and A/B testing results (optional).
NoEcho: true
OptimizelySdkKey:
Type: String
Description: Optimizely SDK key for experimentation (optional).
NoEcho: true
DeployLocationServices:
Type: String
Description: Deploy any Location Resources
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
DeployPersonalizedOffersCampaign:
Type: String
Description: Deploy personalized offers and pickup notices using Location Services geofencing
AllowedValues:
- "Yes"
- "No"
Default: "Yes"
AmazonPayPublicKeyId:
Type: String
Description: >
This demonstration store contains an example of signing Amazon Pay payloads for integration with an Amazon Pay sandbox.
This parameter is the Public Key ID for the Amazon Pay sandbox account being used.
For more information see "Amazon Pay Integration" under the README file in the amazon-pay-signing subfolder in the repository.
AmazonPayStoreId:
Type: String
Description: >
The Store ID of the Amazon Pay sandbox account being used.
For more information see "Amazon Pay Integration" under the README file in the amazon-pay-signing subfolder in the repository.
AmazonPayMerchantId:
Type: String
Description: >
Merchant ID of the Amazon Pay sandbox account being used.
For more information see "Amazon Pay Integration" under the README file in the amazon-pay-signing subfolder in the repository.
AmazonPayPrivateKey:
Type: String
Description: >
The private key to be used for signing Amazon Pay requests for a sandbox account.
You will need to copy the whole contents of the .pem file into this parameter.
For more information see "Amazon Pay Integration" under the README file in the amazon-pay-signing subfolder in the repository.
NoEcho: true
AlexaSkillId:
Type: String
Description: >
This Alexa skill with this SkillId will be allowed to invoke the back-end skill Lambda deployed as a part
of this CloudFormation stack. The back-end Lambda supports the C-Store demo allowing hands-free location
based searching with Location Service (if enabled), integration with the Retail Demo Store back-end, online recommendations,
and checkout with Amazon Pay (if enabled).
AlexaAmazonPayDefaultSandboxEmail:
Type: String
Description: >
If you follow the steps in the workshop to enable Alexa to authenticate with Cognito and pull back your
user details, you probably do not need to set this. However, the Alexa web testing
tool does not allow you to do this authentication either, so to test with the Alexa simulator on the web
and get emails and Amazon Pay integration, you need to set this value so that a default test user is set up -
for Amazon Pay integration, the email should be from one of the test accounts you created on SellerCentral.
IncludeSegmentDependencies:
Type: String
Description: >
Whether to deploy the resources required for the Segment workshops.
AllowedValues:
- "Yes"
- "No"
Default: "No"
SegmentWriteKey:
Type: String
Description: >
Segment write key for real-time data collection (optional). Be sure the Segment resources are deployed (above) if you specify a write key.
NoEcho: true
IncludemParticleDependencies:
Type: String
Description: >
Whether to deploy the resources required for the mParticle workshops.
AllowedValues:
- 'Yes'
- 'No'
Default: 'No'
mParticleOrgId:
Type: String
Description: >
mParticle organization ID from your workspace.
NoEcho: true
mParticleApiKey:
Type: String
Description: >
mParticle event API Key for your mParticle tenant.
NoEcho: true
mParticleSecretKey:
Type: String
Description: >
mParticle event API secret key coupled with your API key.
NoEcho: true
mParticleS2SApiKey:
Type: String
Description: >
mParticle server to server API Key for your mParticle tenant.
NoEcho: true
mParticleS2SSecretKey:
Type: String
Description: >
mParticle server to server secret key coupled with your API key.
NoEcho: true
GoogleAnalyticsMeasurementId:
Type: String
Description: >
Google Analytics Measurement Identifier (optional). If specified, the Google Analytics integration in the web application is activated and
events are sent to the data stream associated with the Measurement ID.
FenixZipDetectUrl:
Type: String
Description: Fenix Commerce Zipcode Detect URL
Default: 'https://ipapi.co/json?key=cKGC3jQbSIoXYmI2KtXObugsKfosD9Yr0HnkHhPUu1SM2wQhE0'
FenixTenantId:
Type: String
Description: Fenix Commerce Demo Env TenantID
Default: 'ec6ea3439489426ba09cf6c906ead8d5'
NoEcho: true
FenixEddEndpoint:
Type: String
Description: Fenix Commerce Estimated Delivery Date Endpoint URL
Default: 'https://awsretaildemo.delest.fenixcommerce.com/fenixdelest/api/v2/deliveryestimates'
FenixMonetaryValue:
Type: String
Description: Fenix Commerce Default monetary value to control free shipping above $100 default for demo
Default: 100
FenixEnabledPdp:
Type: String
Description: Fenix Commerce Flag to enable EDD on PDP
AllowedValues:
- 'TRUE'
- 'FALSE'
Default: 'FALSE'
FenixEnabledCart:
Type: String
Description: Fenix Commerce Flag to enable EDD on CART
AllowedValues:
- 'TRUE'
- 'FALSE'
Default: 'FALSE'
FenixEnabledCheckout:
Type: String
Description: Fenix Commerce Flag to enable EDD on checkout
AllowedValues:
- 'TRUE'
- 'FALSE'
Default: 'FALSE'
Conditions:
DeploySegmentResources: !Equals
- !Ref IncludeSegmentDependencies
- "Yes"
DeploymParticleResources: !Equals
- !Ref IncludemParticleDependencies
- 'Yes'
DeployLocationStack: !Equals
- !Ref DeployLocationServices
- "Yes"
CreateAmazonPayResources: !And
- !And
- !Not [!Equals [!Ref AmazonPayPrivateKey, ""]]
- !Not [!Equals [!Ref AmazonPayStoreId, ""]]
- !And
- !Not [!Equals [!Ref AmazonPayMerchantId, ""]]
- !Not [!Equals [!Ref AmazonPayPublicKeyId, ""]]
DeployAlexaEndpoint: !Not [!Equals [!Ref AlexaSkillId, ""]]
Resources:
# Base Resources
Base:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/base/_template.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
SourceDeploymentType: !Ref SourceDeploymentType
CreateElasticsearchServiceLinkedRole: !Ref CreateElasticsearchServiceLinkedRole
CleanupBucketLambdaArn: !GetAtt CleanupBucket.Outputs.LambdaFunctionArn
AmplitudeApiKey: !Ref AmplitudeApiKey
ParentStackName: !Ref AWS::StackName
OptimizelySdkKey: !Ref OptimizelySdkKey
SegmentWriteKey: !Ref SegmentWriteKey
mParticleOrgId: !Ref mParticleOrgId
mParticleApiKey: !Ref mParticleApiKey
mParticleSecretKey: !Ref mParticleSecretKey
mParticleS2SApiKey: !Ref mParticleS2SApiKey
mParticleS2SSecretKey: !Ref mParticleS2SSecretKey
PinpointSMSLongCode: !Ref PinpointSMSLongCode
GoogleAnalyticsMeasurementId: !Ref GoogleAnalyticsMeasurementId
LocationResourcePrefix: !Ref AWS::StackName
GitHubUser: !Ref GitHubUser
GitHubBranch: !Ref GitHubBranch
FenixZipDetectUrl: !Ref FenixZipDetectUrl
FenixTenantId: !Ref FenixTenantId
FenixEddEndpoint: !Ref FenixEddEndpoint
FenixMonetaryValue: !Ref FenixMonetaryValue
FenixEnabledPdp: !Ref FenixEnabledPdp
FenixEnabledCart: !Ref FenixEnabledCart
FenixEnabledCheckout: !Ref FenixEnabledCheckout
# Services Resources
Services:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/services/_template.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
SourceDeploymentType: !Ref SourceDeploymentType
GitHubRepo: !Ref GitHubRepo
GitHubBranch: !Ref GitHubBranch
GitHubToken: !Ref GitHubToken
GitHubUser: !Ref GitHubUser
UserPoolId: !GetAtt Base.Outputs.UserPoolId
UserPoolClientId: !GetAtt Base.Outputs.UserPoolClientId
IdentityPoolId: !GetAtt Base.Outputs.IdentityPoolId
StackBucketName: !GetAtt Base.Outputs.StackBucketName
Subnets: !GetAtt Base.Outputs.Subnets
VpcId: !GetAtt Base.Outputs.VpcId
ClusterName: !GetAtt Base.Outputs.ClusterName
ServiceDiscoveryNamespace: !GetAtt Base.Outputs.ServiceDiscoveryNamespace
EnvElasticsearchDomainEndpoint: !GetAtt Base.Outputs.ElasticsearchDomainEndpoint
PinpointAppId: !GetAtt Base.Outputs.PinpointAppId
ProductsTable: !GetAtt Base.Outputs.ProductsTable
CategoriesTable: !GetAtt Base.Outputs.CategoriesTable
ExperimentStrategyTable: !GetAtt Base.Outputs.ExperimentStrategyTable
ParameterPersonalizeEventTrackerId: !GetAtt Base.Outputs.ParameterPersonalizeEventTrackerId
ParameterAmplitudeApiKey: !GetAtt Base.Outputs.ParameterAmplitudeApiKey
ParameterOptimizelySdkKey: !GetAtt Base.Outputs.ParameterOptimizelySdkKey
CleanupBucketLambdaArn: !GetAtt CleanupBucket.Outputs.LambdaFunctionArn
ParameterIVSVideoChannelMap: !GetAtt Base.Outputs.ParameterIVSVideoChannelMap
WebRootUrl: !GetAtt Base.Outputs.WebUICDNURL
UseDefaultIVSStreams: !Ref UseDefaultIVSStreams
ImageRootUrl: !Sub
- "${RootURL}/images/"
- RootURL: !GetAtt Base.Outputs.WebUICDNURL
ParentStackName: !Ref AWS::StackName
EvidentlyProjectName: !GetAtt Base.Outputs.EvidentlyProjectName
# Web UI Pipeline
WebUIPipeline:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/web-ui-pipeline.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
SourceDeploymentType: !Ref SourceDeploymentType
GitHubRepo: !Ref GitHubRepo
GitHubBranch: !Ref GitHubBranch
GitHubToken: !Ref GitHubToken
GitHubUser: !Ref GitHubUser
AmazonPayMerchantId: !Ref AmazonPayMerchantId
AmazonPayPublicKeyId: !Ref AmazonPayPublicKeyId
AmazonPayStoreId: !Ref AmazonPayStoreId
UserPoolId: !GetAtt Base.Outputs.UserPoolId
UserPoolClientId: !GetAtt Base.Outputs.UserPoolClientId
IdentityPoolId: !GetAtt Base.Outputs.IdentityPoolId
ProductsServiceExternalUrl: !GetAtt Services.Outputs.ProductsServiceUrl
UsersServiceExternalUrl: !GetAtt Services.Outputs.UsersServiceUrl
CartsServiceExternalUrl: !GetAtt Services.Outputs.CartsServiceUrl
OrdersServiceExternalUrl: !GetAtt Services.Outputs.OrdersServiceUrl
RecommendationsServiceExternalUrl: !GetAtt Services.Outputs.RecommendationsServiceUrl
SearchServiceExternalUrl: !GetAtt Services.Outputs.SearchServiceUrl
VideosServiceExternalUrl: !GetAtt Services.Outputs.VideosServiceUrl
LocationServiceExternalUrl: !GetAtt Services.Outputs.LocationServiceUrl
OffersServiceExternalUrl: !GetAtt Services.Outputs.OffersServiceUrl
PinpointAppId: !GetAtt Base.Outputs.PinpointAppId
ParameterPersonalizeEventTrackerId: !GetAtt Base.Outputs.ParameterPersonalizeEventTrackerId
FenixZipDetectUrl: !Ref FenixZipDetectUrl
FenixTenantId: !Ref FenixTenantId
FenixEddEndpoint: !Ref FenixEddEndpoint
FenixMonetaryValue: !Ref FenixMonetaryValue
FenixEnabledPdp: !Ref FenixEnabledPdp
FenixEnabledCart: !Ref FenixEnabledCart
FenixEnabledCheckout: !Ref FenixEnabledCheckout
LocationResourceName:
!If [
DeployLocationStack,
!GetAtt Location.Outputs.LocationResourceName,
"NotDeployed",
]
LocationNotificationEndpoint:
!If [
DeployLocationStack,
!GetAtt Location.Outputs.LocationNotificationEndpoint,
"NotDeployed",
]
ParameterAmplitudeApiKey: !GetAtt Base.Outputs.ParameterAmplitudeApiKey
ParameterOptimizelySdkKey: !GetAtt Base.Outputs.ParameterOptimizelySdkKey
ParameterSegmentWriteKey: !GetAtt Base.Outputs.ParameterSegmentWriteKey
ParameterGoogleAnalyticsMeasurementId: !GetAtt Base.Outputs.ParameterGoogleAnalyticsMeasurementId
CleanupBucketLambdaArn: !GetAtt CleanupBucket.Outputs.LambdaFunctionArn
WebUICDN: !GetAtt Base.Outputs.WebUICDN
WebUIBucketName: !GetAtt Base.Outputs.WebUIBucketName
WebRootUrl: !GetAtt Base.Outputs.WebUICDNURL
ImageRootUrl: !Sub
- "${RootURL}/images/"
- RootURL: !GetAtt Base.Outputs.WebUICDNURL
# Swagger UI Pipeline
SwaggerUIPipeline:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/swagger-ui-pipeline.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
SwaggerUICDN: !GetAtt Base.Outputs.SwaggerUICDN
SwaggerUIBucketName: !GetAtt Base.Outputs.SwaggerUIBucketName
SwaggerUIRootUrl: !GetAtt Base.Outputs.SwaggerUICDNURL
SourceDeploymentType: !Ref SourceDeploymentType
GitHubRepo: !Ref GitHubRepo
GitHubBranch: !Ref GitHubBranch
GitHubToken: !Ref GitHubToken
GitHubUser: !Ref GitHubUser
ProductsServiceExternalUrl: !GetAtt Services.Outputs.ProductsServiceUrl
UsersServiceExternalUrl: !GetAtt Services.Outputs.UsersServiceUrl
CartsServiceExternalUrl: !GetAtt Services.Outputs.CartsServiceUrl
OrdersServiceExternalUrl: !GetAtt Services.Outputs.OrdersServiceUrl
RecommendationsServiceExternalUrl: !GetAtt Services.Outputs.RecommendationsServiceUrl
SearchServiceExternalUrl: !GetAtt Services.Outputs.SearchServiceUrl
VideosServiceExternalUrl: !GetAtt Services.Outputs.VideosServiceUrl
LocationServiceExternalUrl: !GetAtt Services.Outputs.LocationServiceUrl
OffersServiceExternalUrl: !GetAtt Services.Outputs.OffersServiceUrl
CleanupBucketLambdaArn: !GetAtt CleanupBucket.Outputs.LambdaFunctionArn
# Lex personalization function
ChatbotFunctions:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/lex.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
UsersServiceExternalUrl: !GetAtt Services.Outputs.UsersServiceUrl
RecommendationsServiceExternalUrl: !GetAtt Services.Outputs.RecommendationsServiceUrl
# Amazon Location Resources
Location:
Type: AWS::CloudFormation::Stack
Condition: DeployLocationStack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/location.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
UserPoolId: !GetAtt Base.Outputs.UserPoolId
DeployDefaultGeofence: !Ref DeployPersonalizedOffersCampaign
PinpointAppId: !GetAtt Base.Outputs.PinpointAppId
PinpointEmailFromAddress: !Ref PinpointEmailFromAddress
ProductsServiceExternalUrl: !GetAtt Services.Outputs.ProductsServiceUrl
CartsServiceExternalUrl: !GetAtt Services.Outputs.CartsServiceUrl
OrdersServiceExternalUrl: !GetAtt Services.Outputs.OrdersServiceUrl
OffersServiceExternalUrl: !GetAtt Services.Outputs.OffersServiceUrl
UsersServiceExternalUrl: !GetAtt Services.Outputs.UsersServiceUrl
WebURL: !GetAtt Base.Outputs.WebUICDNURL
AmazonPay:
Type: AWS::CloudFormation::Stack
Condition: CreateAmazonPayResources
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/amazonpay.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
AmazonPayPublicKeyId: !Ref AmazonPayPublicKeyId
AmazonPayStoreId: !Ref AmazonPayStoreId
AmazonPayPrivateKey: !Ref AmazonPayPrivateKey
WebURL: !GetAtt Base.Outputs.WebUICDNURL
Alexa:
Type: AWS::CloudFormation::Stack
Condition: DeployAlexaEndpoint
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/alexa.yaml
Parameters:
AlexaSkillId: !Ref AlexaSkillId
PinpointAppId: !GetAtt Base.Outputs.PinpointAppId
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
ProductsServiceExternalUrl: !GetAtt Services.Outputs.ProductsServiceUrl
LocationServiceExternalUrl: !GetAtt Services.Outputs.LocationServiceUrl
OrdersServiceExternalUrl: !GetAtt Services.Outputs.OrdersServiceUrl
CartsServiceExternalUrl: !GetAtt Services.Outputs.CartsServiceUrl
RecommendationsServiceExternalUrl: !GetAtt Services.Outputs.RecommendationsServiceUrl
LocationResourceName:
!If [
DeployLocationStack,
!GetAtt Location.Outputs.LocationResourceName,
"NotDeployed",
]
AmazonPayMerchantId: !Ref AmazonPayMerchantId
AlexaAmazonPayDefaultSandboxEmail: !Ref AlexaAmazonPayDefaultSandboxEmail
# Deployment support
DeploymentSupport:
DependsOn: [Services, Base] # Delay towards end of deployment so that ES domain and DNS changes become consistent
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/deployment-support.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
PreIndexElasticsearch: !Ref PreIndexElasticsearch
PreCreatePersonalizeResources: !Ref PreCreatePersonalizeResources
Subnet1: !GetAtt Base.Outputs.Subnet1
Subnet2: !GetAtt Base.Outputs.Subnet2
ElasticsearchSecurityGroupId: !GetAtt Base.Outputs.ElasticsearchSecurityGroupId
ElasticsearchDomainArn: !GetAtt Base.Outputs.ElasticsearchDomainArn
ElasticsearchDomainEndpoint: !GetAtt Base.Outputs.ElasticsearchDomainEndpoint
ParameterIVSVideoChannelMap: !GetAtt Base.Outputs.ParameterIVSVideoChannelMap
PreCreatePinpointWorkshop: !Ref PreCreatePinpointWorkshop
Uid: !Sub ${AWS::StackName}-${AWS::Region}
PinpointAppId: !GetAtt Base.Outputs.PinpointAppId
PinpointPersonalizeRoleArn: !GetAtt Services.Outputs.PinpointPersonalizeRoleArn
CustomizeRecommendationsFunctionArn: !GetAtt Services.Outputs.CustomizeRecommendationsFunctionArn
CustomizeOffersRecommendationsFunctionArn: !GetAtt Services.Outputs.CustomizeOffersRecommendationsFunctionArn
PinpointEmailFromAddress: !Ref PinpointEmailFromAddress
PinpointEmailFromName: !Ref PinpointEmailFromName
UseDefaultIVSStreams: !Ref UseDefaultIVSStreams
ProductsServiceExternalUrl: !GetAtt Services.Outputs.ProductsServiceUrl
DeployPersonalizedOffersCampaign: !Ref DeployPersonalizedOffersCampaign
PersonalizeRoleArn: !GetAtt Base.Outputs.PersonalizeRoleArn
# Cleanup bucket function
CleanupBucket:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/cleanup-bucket.yaml
# Segment Lambda Functions and Roles
SegmentPersonalize:
Condition: DeploySegmentResources
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/segment.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
# mParticle Lambda Functions Kinesis and Roles
mParticlePersonalize:
Condition: DeploymParticleResources
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/mparticle.yaml
Parameters:
ResourceBucket: !Ref ResourceBucket
ResourceBucketRelativePath: !Ref ResourceBucketRelativePath
mParticleOrgId: !Ref mParticleOrgId
Uid: !Sub ${AWS::StackName}-${AWS::Region}
Outputs:
UserPoolId:
Description: Authentication Cognito User Pool Id.
Value: !GetAtt Base.Outputs.UserPoolId
UserPoolClientId:
Description: Authentication Cognito User Pool Client Id.
Value: !GetAtt Base.Outputs.UserPoolClientId
IdentityPoolId:
Description: Authentication Cognito Identity Pool Id.
Value: !GetAtt Base.Outputs.IdentityPoolId
BucketStackBucketName:
Description: Stack Bucket Name
Value: !GetAtt Base.Outputs.StackBucketName
NotebookInstanceId:
Description: Notebook Instance Id.
Value: !GetAtt Base.Outputs.NotebookInstanceId
VpcId:
Description: VPC Id.
Value: !GetAtt Base.Outputs.VpcId
Subnets:
Description: Service Subnets.
Value: !GetAtt Base.Outputs.Subnets
ClusterName:
Description: ECS Cluster Name.
Value: !GetAtt Base.Outputs.ClusterName
WebURL:
Description: Retail Demo Store Web UI URL
Value: !GetAtt Base.Outputs.WebUICDNURL
ElasticsearchDomainEndpoint:
Description: Elasticsearch Endpoint
Value: !GetAtt Base.Outputs.ElasticsearchDomainEndpoint
ParameterIVSVideoChannelMap:
Description: Retail Demo Store video file to IVS channel mapping parameter
Value: !GetAtt Base.Outputs.ParameterIVSVideoChannelMap
PinpointAppId:
Description: Pinpoint App Id.
Value: !GetAtt Base.Outputs.PinpointAppId
AlexaSkillEndpointArn:
Description: Arn of AWS Lambda function that can be a back-end
Value: !If [DeployAlexaEndpoint, !GetAtt Alexa.Outputs.AlexaSkillEndpointArn, "NotDeployed"]
ProductsServiceUrl:
Description: Products load balancer URL.
Value: !GetAtt Services.Outputs.ProductsServiceUrl
UsersServiceUrl:
Description: Users load balancer URL.
Value: !GetAtt Services.Outputs.UsersServiceUrl
CartsServiceUrl:
Description: Carts load balancer URL.
Value: !GetAtt Services.Outputs.CartsServiceUrl
OrdersServiceUrl:
Description: Orders load balancer URL.
Value: !GetAtt Services.Outputs.OrdersServiceUrl
LocationServiceUrl:
Description: Location load balancer URL.
Value: !GetAtt Services.Outputs.LocationServiceUrl
RecommendationsServiceUrl:
Description: Recommendations load balancer URL.
Value: !GetAtt Services.Outputs.RecommendationsServiceUrl
VideosServiceUrl:
Description: Videos load balancer URL.
Value: !GetAtt Services.Outputs.VideosServiceUrl
SearchServiceUrl:
Description: Search load balancer URL.
Value: !GetAtt Services.Outputs.SearchServiceUrl
OffersServiceUrl:
Description: Offers service load balancer URL.
Value: !GetAtt Services.Outputs.OffersServiceUrl
EvidentlyProjectName:
Description: ARN for the CloudWatch Evidently project
Value: !GetAtt Base.Outputs.EvidentlyProjectName
ExportEnvVarScript:
Description: A script to export all required environment variable for running docker-compose locally, but connecting to Cloud resources. Replace the existing .env file with this output.
Value: !Sub |
# Products service
DDB_TABLE_PRODUCTS=${Base.Outputs.ProductsTable}
DDB_TABLE_CATEGORIES=${Base.Outputs.CategoriesTable}
IMAGE_ROOT_URL="${Base.Outputs.WebUICDNURL}/images/"
WEB_ROOT_URL="${Base.Outputs.WebUICDNURL}"
# Recommendations service
PRODUCT_SERVICE_HOST="${Services.Outputs.ProductsServiceUrl}"
PRODUCT_SERVICE_PORT=80
OFFERS_SERVICE_HOST="${Services.Outputs.OffersServiceUrl}"
OFFERS_SERVICE_PORT=80
AWS_XRAY_DAEMON_ADDRESS=xray:2000
# Search service
ES_SEARCH_DOMAIN_SCHEME=https
ES_SEARCH_DOMAIN_HOST="${Base.Outputs.ElasticsearchDomainEndpoint}"
ES_SEARCH_DOMAIN_PORT=9200
# Users service
AWS_REGION=${AWS::Region}
# Locations service
RESOURCE_BUCKET=${ResourceBucket}
AWS_DEFAULT_REGION=${AWS::Region}
# Videos service
PARAMETER_IVS_VIDEO_CHANNEL_MAP=${Base.Outputs.ParameterIVSVideoChannelMap}
USE_DEFAULT_IVS_STREAMS=true