awslabs / aws-saas-boost

AWS SaaS Boost is a ready-to-use toolset that removes the complexity of successfully running SaaS workloads in the AWS cloud.
Apache License 2.0
957 stars 188 forks source link

Migration to the latest version of SaaS #479

Open JaladJhamb opened 1 year ago

JaladJhamb commented 1 year ago

:question:

The Question

So we have been asked to migrate our exisitng running tenants from SaaS v1 version to the latest version.

Environment

Other information

brtrvn commented 1 year ago

@JaladJhamb please identify the fields you need from the SaaS Boost tenant service to operate your application.

JaladJhamb commented 1 year ago

@brtrvn, I have actually made a diff between the DynamoDB created by old and new SaaS. These were the attributes which were mentioned in the old but not in the new DynamoDB : computeSize, onboarding , overrideDefaults, planID, ALB, ECS_CLUSTER_LOG_GROUP, CODE_PIPELINE And I have even attached the excel file which I used fo documenting the difference between both the tables. DynamoDB_Schema.xlsx

brtrvn commented 1 year ago

I would not look at the DynamoDB table items. They are subject to change even more than the API. Here's a comparison of the tenant objects returned by the Tenant Service API in v1 vs. v2.

Data Type Tenant v1 Tenant v2
uuid id id
timestamp created created
timestamp modified modified
boolean active active
boolean provisioned provisioned
string onboardingStatus onboardingStatus
string name name
string subdomain subdomain
string planId billingPlan
boolean overrideDefaults ...replaced by tier, see below
string computeSize ...replaced by tier, see below
int memory ...replaced by tier, see below
int cpu ...replaced by tier, see below
int minCount ...replaced by tier, see below
int maxCount ...replaced by tier, see below
string tier
string hostname
map attributes
map resources resources
resources[CLOUDFORMATION] resources[CLOUDFORMATION][consoleUrl]
resources[VPC] resources[VPC][consoleUrl]
resources[ECS_CLUSTER] resources[ECS_CLUSTER][consoleUrl]
resources[ECS_CLUSTER_LOG_GROUP]
resources[LOAD_BALANCER_DNSNAME] ...replaced by hostname
resources[ALB] resources[LOAD_BALANCER][consoleUrl]
resources[CODE_PIPELINE] resources[SERVICE**?_**_CODE_PIPELINE][consoleUrl]
resources[RDS_INSTANCE] resources[SERVICE**?_**_DB_HOST][consoleUrl]

As you can see, much of the tenant object stayed the same between v1 and v2, but v2 adds more properties and renamed a couple of things to make it easier to understand and use. SaaS Boost v1 did not have a true concept of packaging your SaaS application by Tier. You could emulate some of what tiering represents by "overriding the default" compute settings when you onboarded a tenant. In v2, all of these compute settings (and more) are modeled as part of the app config for each service you define.

Code Pipelines and RDS resources are created per service in v2, so the naming has changed to include the service name you enter in app config. For example, if you named your service frontend, the CodePipeline resource would be called SERVICE_FRONTEND_CODE_PIPELINE.

Using Tiers v1 if overrideDefaults == false would be similar to onboarding a tenant in v2 to whichever tier you've marked as "default" v1 if overrideDefaults == true would mean onboarding a tenant into a tier that configures service settings and limits represented by the compute and scaling choices from v1

Also note that in the future billingPlan will move to be an attribute of the tier the tenant onboarded into.

And, just to be clear, because I know this is something your team is struggling with tenant.resources[LOAD_BALANCER_DNSNAME] == tenant.hostname

JaladJhamb commented 1 year ago

hello @brtrvn, sorry I wasn't able to respond back due to some personal reason I wasn't active, We were actually going through the code of SaaS and we wanted to know what is this file in s3 bucket which is actually in unreadable format actually coming from. image

brtrvn commented 1 year ago

It's hard to say for certain from your screenshot, but CodePipeline uses S3 as a source action. The files in the CodePipeline artifact bucket are ZIP files containing the source material expected by the pipeline's build action(s). In the case of a tenant workload pipeline, the file inside the ZIP archive will be an ECS image definitions JSON file used by ECS to perform a rolling deployment of a new Task Definition for the Services.