-
Notifications
You must be signed in to change notification settings - Fork 22
/
cloudformation-aws-marketplace-saas.template.yaml
124 lines (120 loc) · 5.2 KB
/
cloudformation-aws-marketplace-saas.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
AWSTemplateFormatVersion: '2010-09-09'
Description: "AWS Marketplace SaaS entitlement and subscription portal (qs-1s3j136e1)"
Metadata:
QuickStartDocumentation:
EntrypointName: "Deploy AWS Marketplace SaaS entitlement and subscription portal"
AWS::CloudFormation::Interface:
ParameterLabels:
AWSMarketplaceMeteringRecordsTableName:
default: "Metering records Amazon DynamoDB table name"
CreateRegistrationWebPage:
default: "Registration page"
EntitlementSNSTopic:
default: "Entitlements SNS topic ARN"
MarketplaceTechAdminEmail:
default: "Admin email address"
NewSubscribersTableName:
default: "New subscribers DynamoDB table name"
ProductCode:
default: "Product code"
SubscriptionSNSTopic:
default: "Subscriptions SNS topic ARN"
TypeOfSaaSListing:
default: "SaaS pricing model"
WebsiteS3BucketName:
default: "S3 bucket name"
# AWS IA configuration
ArtifactBucketName:
default: Artifact S3 bucket name
ParameterGroups:
- Label:
default: AWS Integration and Automation configuration
Parameters:
- TypeOfSaaSListing
- CreateRegistrationWebPage
- WebsiteS3BucketName
- ProductCode
- SubscriptionSNSTopic
- EntitlementSNSTopic
- NewSubscribersTableName
- AWSMarketplaceMeteringRecordsTableName
- MarketplaceTechAdminEmail
- Label:
default: Quick Starts Parameters (Do not change)
Parameters:
- ArtifactBucketName
Parameters:
AWSMarketplaceMeteringRecordsTableName:
Default: AWSMarketplaceMeteringRecords
Description: "Custom value for the metering records table. Value must be unique per product."
Type: String
CreateRegistrationWebPage:
AllowedValues:
- "true"
- "false"
Default: "true"
Description: "Choose 'true' to create a new registration page hosted by Amazon CloudFront. If you already have a custom registration page, choose 'false'."
Type: String
EntitlementSNSTopic:
Description: "If your product is a SaaS contract, use the entitelement SNS topic provided by AWS Marketplace at the time the limited listing was published."
Type: String
MarketplaceTechAdminEmail:
Type: String
Description: "The email address that receives SNS notifications for new customer registrations, entitlement changes, and subscription events."
NewSubscribersTableName:
Default: AWSMarketplaceSubscribers
Description: "The custom value for the New Subscribers table. Value must be unique per product."
Type: String
ProductCode:
Description: "The product code provided by AWS Marketplace at the time the limited listing was published."
Type: String
SubscriptionSNSTopic:
Description: "If your product is a SaaS subscription or Saas contract with subscription, use the entitlement SNS topic provided by AWS Marketplace at the time the limited listing was published."
Type: String
TypeOfSaaSListing:
AllowedValues:
- contracts_with_subscription
- contracts
- subscriptions
Default: contracts_with_subscription
Description: "The SaaS pricing model of your product."
Type: String
WebsiteS3BucketName:
Type: String
Description: "The S3 bucket that holds the static HTML registration page files. If this bucket doesn't exist, it is created."
# Integration and Automation location parameters
ArtifactBucketName:
AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$
ConstraintDescription: Staging bucket name can include numbers, lowercase
letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen
(-).
Default: aws-quickstart
# TODO: nitpick the name and wording here
Description: Name of the S3 bucket name that contains the SAM artifacts. This parameter should not be changed if using the Quick Start solution. Doing so will cause the deployment to fail.
Type: String
Conditions:
CreateRegistrationWebPageCond: !Equals
- !Ref CreateRegistrationWebPage
- true
Resources:
SampleApp:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !Sub "https://${ArtifactBucketName}.s3.amazonaws.com/cloudformation-aws-marketplace-saas/submodules/sam/packaged.yaml"
Parameters:
AWSMarketplaceMeteringRecordsTableName: !Ref AWSMarketplaceMeteringRecordsTableName
CreateRegistrationWebPage: !Ref CreateRegistrationWebPage
EntitlementSNSTopic: !Ref EntitlementSNSTopic
MarketplaceTechAdminEmail: !Ref MarketplaceTechAdminEmail
NewSubscribersTableName: !Ref NewSubscribersTableName
ProductCode: !Ref ProductCode
SubscriptionSNSTopic: !Ref SubscriptionSNSTopic
TypeOfSaaSListing: !Ref TypeOfSaaSListing
WebsiteS3BucketName: !If [CreateRegistrationWebPageCond, !Ref WebsiteS3BucketName, !Ref AWS::NoValue]
Outputs:
APIUrl:
Description: API gateway URL to replace baseUrl value in web/script.js
Value: !GetAtt SampleApp.Outputs.APIUrl
LandingPageUrl:
Description: URL to access your landing page and update SaaS URL field in your listing.
Value: !GetAtt SampleApp.Outputs.LandingPageUrl