From beac2ab111829e1ff2c87134ce4dfd441e672782 Mon Sep 17 00:00:00 2001 From: "raj.banerjee" Date: Wed, 16 Nov 2022 18:22:07 -0500 Subject: [PATCH 1/4] Improving docs for new users. DEPLOYMENT_ARTEFACT_S3_BUCKET should be created ahead of time. Other bucket gets created by the deployment. Fixed minor typos --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 972967b..69eb101 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ To build and deploy your application for the first time, run the following in yo ```bash #Replace all `` with their `actual values` (e.g. `` with `My Cool Project`). +#Create non-public bucket for before running this script sam build sam package --output-template-file packaged.yaml --s3-bucket @@ -207,21 +208,21 @@ aws s3 cp ./web/ s3:/// --recursive #add a CNAME record to your DNS to route the url you put on your offering to the cloudformation endpoint -#add the domain used for your maretplace URL to the CNAME on the cloudformation config +#add the domain used for your marketplace URL to the CNAME on the cloudformation config ``` ### List of parameters Parameter name | Description ------------ | ------------- -WebsiteS3BucketName | S3 bucket to store the HTML files; Mandatory if CreateRegistrationWebPage is set to true; -NewSubscribersTableName | Use custome name for the New Subscribers Table; Default value: AWSMarketplaceSubscribers -AWSMarketplaceMeteringRecordsTableName | Use custome name for the Metering Records Table; Default value: AWSMarketplaceMeteringRecords +WebsiteS3BucketName | S3 bucket to store the HTML files; Mandatory if CreateRegistrationWebPage is set to true; will be created +NewSubscribersTableName | Use customer name for the New Subscribers Table; Default value: AWSMarketplaceSubscribers +AWSMarketplaceMeteringRecordsTableName | Use customer name for the Metering Records Table; Default value: AWSMarketplaceMeteringRecords TypeOfSaaSListing | allowed values: contracts_with_subscription, contracts, subscriptions; Default value: contracts_with_subscription ProductCode | Product code provided from AWS Marketplace -EntitlementSNSTopic | SNS topic ARN provided from AWS Marketplace -SubscriptionSNSTopic | SNS topic ARN provided from AWS Marketplace +EntitlementSNSTopic | SNS topic ARN provided from AWS Marketplace. Must exist. +SubscriptionSNSTopic | SNS topic ARN provided from AWS Marketplace. Must exist. CreateRegistrationWebPage | true or false; Default value: true -MarketplaceTechAdminEmail | Email to be notified on changes requring action +MarketplaceTechAdminEmail | Email to be notified on changes requiring action MarketplaceSellerEmail | Seller SES verified email address From e66fd3be328fc0cac95737aacc37eeff0ac00658 Mon Sep 17 00:00:00 2001 From: "raj.banerjee" Date: Wed, 23 Nov 2022 17:43:54 -0500 Subject: [PATCH 2/4] Adding wording that SES email must be in production mode, not sandbox mode --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 69eb101..50bd5b9 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ EntitlementSNSTopic | SNS topic ARN provided from AWS Marketplace. Must exist. SubscriptionSNSTopic | SNS topic ARN provided from AWS Marketplace. Must exist. CreateRegistrationWebPage | true or false; Default value: true MarketplaceTechAdminEmail | Email to be notified on changes requiring action -MarketplaceSellerEmail | Seller SES verified email address +MarketplaceSellerEmail | Seller email address, verified in SES and in 'Production' mode ### Diagram of created resources From 3f2d951fa8527afbd47eb5cd2c6a68701c08e2ae Mon Sep 17 00:00:00 2001 From: cvishwes Date: Fri, 3 Mar 2023 09:23:28 -0600 Subject: [PATCH 3/4] subscription notification message changes --- src/grant-revoke-access-to-product.js | 6 +++--- src/subscription-sqs.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/grant-revoke-access-to-product.js b/src/grant-revoke-access-to-product.js index af108cc..5444938 100644 --- a/src/grant-revoke-access-to-product.js +++ b/src/grant-revoke-access-to-product.js @@ -57,13 +57,13 @@ exports.dynamodbStreamHandler = async (event, context) => { if (grantAccess) { subject = 'New AWS Marketplace Subscriber'; - message = `Grant access to new SaaS customer: ${JSON.stringify(newImage)}`; + message = `subscribe-success: ${JSON.stringify(newImage)}`; } else if (revokeAccess) { subject = 'AWS Marketplace customer end of subscription'; - message = `Revoke access to SaaS customer: ${JSON.stringify(newImage)}`; + message = `unsubscribe-success: ${JSON.stringify(newImage)}`; } else if (entitlementUpdated) { subject = 'AWS Marketplace customer change of subscription'; - message = `New entitlement for customer: ${JSON.stringify(newImage)}`; + message = `entitlement-updated: ${JSON.stringify(newImage)}`; } const SNSparams = { diff --git a/src/subscription-sqs.js b/src/subscription-sqs.js index 64d33ca..836dbee 100644 --- a/src/subscription-sqs.js +++ b/src/subscription-sqs.js @@ -51,8 +51,9 @@ exports.SQSHandler = async (event) => { Key: { customerIdentifier: { S: message['customer-identifier'] }, }, - UpdateExpression: 'set successfully_subscribed = :ss, subscription_expired = :se, is_free_trial_term_present = :ft', + UpdateExpression: 'set subscription_action = :ac, successfully_subscribed = :ss, subscription_expired = :se, is_free_trial_term_present = :ft', ExpressionAttributeValues: { + ':ac': { S: message['action'] }, ':ss': { BOOL: successfullySubscribed }, ':se': { BOOL: subscriptionExpired }, ':ft': { BOOL: isFreeTrialTermPresent} From 3b5d98e8af74db2a0edafdc1afc08b6db1c5d18d Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Wed, 26 Apr 2023 17:39:02 +0000 Subject: [PATCH 4/4] fix the s3 bucket ownershipissue rever to previous version fix the issue associated with s3 block ownership --- template.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template.yaml b/template.yaml index d8b018f..969a324 100644 --- a/template.yaml +++ b/template.yaml @@ -137,6 +137,9 @@ Resources: Condition: CreateWeb Properties: BucketName: !Join ["-", [!Ref WebsiteS3BucketName, "log"]] + OwnershipControls: + Rules: + - ObjectOwnership: BucketOwnerPreferred IntelligentTieringConfigurations: - Id: !Join ["-", [!Ref WebsiteS3BucketName, "log"]] Status: Enabled @@ -436,4 +439,4 @@ Outputs: CreateWeb, !Sub "https://${CloudfrontDistribution.DomainName}/index.html", "N/A", - ] + ] \ No newline at end of file