--- AWSTemplateFormatVersion: 2010-09-09 Description: > This template deploys a Retail Demo Store Service. Parameters: ServiceName: Type: String ServicePath: Type: String ResourceBucket: Type: String Description: S3Bucket Bucket where the Resources are stored (cloudformation, images, lambda code) ResourceBucketRelativePath: Type: String Description: S3Bucket Path where the Resources are stored (cloudformation, images, lambda code) (i.e. path/path2), can be empty if resources are at the root of the bucket. MUST contain trailing / WebRootUrl: Type: String Description: Public facing root URL where the Retail Demo Store web user interface is served. Used when building fully qualified URLs for the web user interface. AllowedPattern: "^https?://[^\\s/$.?#].[^\\s]*$" ConstraintDescription: Must be a valid URL referring to the root domain where web assets are located ImageRootUrl: Type: String Description: URL where Retail Demo Store images such as product images are located AllowedPattern: "^https?://[^\\s/$.?#].[^\\s]*$" ConstraintDescription: Must be a valid URL referring to the root path where images are located SourceDeploymentType: Type: String Description: Retail Demo Store source deployment type AllowedValues: - 'GitHub' - 'CodeCommit' Default: 'CodeCommit' GitHubRepo: Type: String Default: retaildemostore GitHubBranch: Type: String Default: master GitHubToken: Type: String NoEcho: true GitHubUser: Type: String UserPoolId: Type: String UserPoolClientId: Type: String IdentityPoolId: Type: String StackBucketName: Type: String Subnets: Type: String VpcId: Type: String VpcCidr: Type: String Description: CIDR of the VPC (used for security groups) ClusterName: Type: String ContainerCpu: Type: String Default: 256 ContainerMemory: Type: String Default: 512 ServiceDiscoveryNamespace: Type: String ProductsServiceExternalUrl: Type: String Default: none UsersServiceExternalUrl: Type: String Default: none CartsServiceExternalUrl: Type: String Default: none VideosServiceExternalUrl: Type: String Default: none OrdersServiceExternalUrl: Type: String Default: none RecommendationsServiceExternalUrl: Type: String Default: none SearchServiceExternalUrl: Type: String Default: none PinpointAppId: Type: String Default: none EnvPersonalizeCampaignArn: Type: String Default: none EnvPersonalizeSearchCampaignArn: Type: String Default: none EnvProductsServiceInternalUrl: Type: String Default: products.retaildemostore.local EnvProductsServiceInternalPort: Type: String Default: 80 EnvUsersServiceInternalUrl: Type: String Default: users.retaildemostore.local EnvUsersServiceInternalPort: Type: String Default: 80 EnvSearchServiceInternalUrl: Type: String Default: search.retaildemostore.local EnvSerchServiceInternalPort: Type: String Default: 80 EnvOffersServiceInternalUrl: Type: String Default: offers.retaildemostore.local EnvOffersServiceInternalPort: Type: String Default: 80 EnvOpenSearchDomainEndpoint: Type: String Default: none ProductsTable: Type: String Default: none CategoriesTable: Type: String Default: none ExperimentStrategyTable: Type: String Default: none ParameterPersonalizeEventTrackerId: Type: String Description: SSM parameter name for the Personalize event tracking ID Default: none ParameterAmplitudeApiKey: Type: String Description: SSM parameter name for the Amplitude API key Default: none ParameterOptimizelySdkKey: Type: String Description: SSM parameter name for the Optimizely SDK key Default: none ParameterIVSVideoChannelMap: Type: String Description: SSM parameter name for video to IVS stream map Default: none CleanupBucketLambdaArn: Type: String Description: Lambda Arn for cleanup function DeleteRepositoryLambdaArn: Type: String Description: Lambda Arn for deleting ECR repository UseDefaultIVSStreams: Type: String Default: false Uid: Type: String EvidentlyProjectName: Type: String Description: Evidently project name LoggingBucketName: Type: String Description: S3 Bucket For logging Resources: Loadbalancer: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/services/service/loadbalancer.yaml Parameters: ServiceName: !Ref ServiceName Subnets: !Ref Subnets VpcId: !Ref VpcId VpcCidr: !Ref VpcCidr Pipeline: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/services/service/pipeline.yaml Parameters: ClusterName: !Ref ClusterName ServiceName: !Ref ServiceName ServicePath: !Ref ServicePath SourceDeploymentType: !Ref SourceDeploymentType GitHubRepo: !Ref GitHubRepo GitHubBranch: !Ref GitHubBranch GitHubToken: !Ref GitHubToken GitHubUser: !Ref GitHubUser UserPoolId: !Ref UserPoolId UserPoolClientId: !Ref UserPoolClientId IdentityPoolId: !Ref IdentityPoolId StackBucketName: !Ref StackBucketName FargateServiceName: !GetAtt Service.Outputs.FargateServiceName ProductsServiceExternalUrl: !Ref ProductsServiceExternalUrl UsersServiceExternalUrl: !Ref UsersServiceExternalUrl CartsServiceExternalUrl: !Ref CartsServiceExternalUrl VideosServiceExternalUrl: !Ref VideosServiceExternalUrl OrdersServiceExternalUrl: !Ref OrdersServiceExternalUrl RecommendationsServiceExternalUrl: !Ref RecommendationsServiceExternalUrl SearchServiceExternalUrl: !Ref SearchServiceExternalUrl PinpointAppId: !Ref PinpointAppId ParameterPersonalizeEventTrackerId: !Ref ParameterPersonalizeEventTrackerId ParameterAmplitudeApiKey: !Ref ParameterAmplitudeApiKey ParameterOptimizelySdkKey: !Ref ParameterOptimizelySdkKey CleanupBucketLambdaArn: !Ref CleanupBucketLambdaArn DeleteRepositoryLambdaArn: !Ref DeleteRepositoryLambdaArn WebRootUrl: !Ref WebRootUrl ImageRootUrl: !Ref ImageRootUrl TaskRoleArn: !GetAtt Service.Outputs.TaskRoleArn TaskExecutionRoleArn: !GetAtt Service.Outputs.TaskExecutionRoleArn LoggingBucketName: !Ref LoggingBucketName Service: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://s3.amazonaws.com/${ResourceBucket}/${ResourceBucketRelativePath}cloudformation-templates/services/service/service.yaml Parameters: ServiceName: !Ref ServiceName ClusterName: !Ref ClusterName DesiredCount: '1' ContainerMemory: !Ref ContainerMemory ContainerCpu: !Ref ContainerCpu TargetGroup: !GetAtt Loadbalancer.Outputs.TargetGroup SourceSecurityGroup: !GetAtt Loadbalancer.Outputs.SecurityGroup Subnets: !Ref Subnets ServiceDiscoveryNamespace: !Ref ServiceDiscoveryNamespace ContainerPort: '80' ContainerImage: amazon/amazon-ecs-sample EnvPersonalizeCampaignArn: !Ref EnvPersonalizeCampaignArn EnvPersonalizeSearchCampaignArn: !Ref EnvPersonalizeSearchCampaignArn EnvProductsServiceInternalUrl: !Ref EnvProductsServiceInternalUrl EnvProductsServiceInternalPort: !Ref EnvProductsServiceInternalPort EnvUsersServiceInternalUrl: !Ref EnvUsersServiceInternalUrl EnvUsersServiceInternalPort: !Ref EnvUsersServiceInternalPort EnvSearchServiceInternalUrl: !Ref EnvSearchServiceInternalUrl EnvSerchServiceInternalPort: !Ref EnvSerchServiceInternalPort EnvOffersServiceInternalUrl: !Ref EnvOffersServiceInternalUrl EnvOffersServiceInternalPort: !Ref EnvOffersServiceInternalPort EnvOpenSearchDomainEndpoint: !Ref EnvOpenSearchDomainEndpoint ResourceBucket: !Ref ResourceBucket ParameterIVSVideoChannelMap: !Ref ParameterIVSVideoChannelMap UseDefaultIVSStreams: !Ref UseDefaultIVSStreams ProductsTable: !Ref ProductsTable CategoriesTable: !Ref CategoriesTable ExperimentStrategyTable: !Ref ExperimentStrategyTable PinpointAppId: !Ref PinpointAppId WebRootUrl: !Ref WebRootUrl ImageRootUrl: !Ref ImageRootUrl Uid: !Ref Uid EvidentlyProjectName: !Ref EvidentlyProjectName Outputs: ServiceDNSName: Description: DNS name of the load balancer for this service Value: !GetAtt Loadbalancer.Outputs.ServiceDNSName ServiceUrl: Description: URL of the load balancer for this service. Value: !GetAtt Loadbalancer.Outputs.ServiceUrl ServiceELBListener: Value: !GetAtt Loadbalancer.Outputs.LoadBalancerListener