umccr / orcabus

 🐋 UMCCR Pipeline & Workflow Orchestration
4 stars 0 forks source link

Implement externalise config for CDK constructs #15

Closed victorskl closed 1 year ago

victorskl commented 1 year ago

Context:

Design Guide:

Actions:

andrewpatto commented 1 year ago

Can you define what config items you mean here? vpc ids? subnets? or app config?

victorskl commented 1 year ago

Sure. At the mo, this scopes to -- how to refer/reconstruct/import what has created in long-running infrastructure (stateful) stack into short-live (self-mutating in CodePipeline) application (stateless) stack.

Currently is tightly coupled.

https://github.com/umccr/orcabus/blob/3cae7ada7a3d2f0c7907df2dadbd7894c809b59d/lib/workload/orcabus-stateless-stack.ts#L19-L28

andrewpatto commented 1 year ago

Whilst I totally agree with trying to avoid SSM parameters - it seems like the consensus of the internet is that the only practical way to share from disconnected 'stateful' stacks to 'stateless' stacks in SSM. (I tried multiple other ways that all failed - in particular they fail in not being able to be handled in the synthesis phase - which is where the CDK lookup() stuff comes in)

victorskl commented 1 year ago

Sure. Understood. Trust me, currently Portal use lot SSM for this between disconnected (stateful) terraform to (stateless) (self-mutating) serverless/local-dev, yes.

Historically in early Portal days inception -- it was environment variables .env -- that get out-of-hand as its has grown.

Here is the retrospect; changes from .env to SSM.

Back then, thought was SSM is natural fit. Because elsewhere tech stack; in more generally, we do this using some key-value store for decoupling config; like Consul, etcd, redis... Or, some sort of service discovery...

I saw you have used Service Discovery in AWS... or Cloud Map or the like?? I will read/dig up and, probably need help/pick your brain -- probably in devops catchup...

victorskl commented 1 year ago

This is now Trello-ed -- https://trello.com/c/4hmvdUDX/1422-orcabus-v1-implement-externalise-config-for-cdk-constructs

And, will be continue tracked there.

Part of Trello migration.

victorskl commented 8 months ago

Use as follows in order of preference.

  1. Use constants (TypeScript source file)
  2. Use SSM parameter store
  3. Use Secret Manager

Closing.