alphagov / consent-api

Service for sharing user consent to cookies across multiple domains
https://consent-api-bgzqvpmbyq-nw.a.run.app
MIT License
8 stars 0 forks source link

refactor(infra): refactor deploy_service from procedural to OOP resources #212

Closed guilhem-fry closed 9 months ago

guilhem-fry commented 10 months ago

Abstracts out the infra into main "components":

Each of these components have underlying GCP resources

Each component implements the class AbstractResource Each of them implements the _create method, which is where pulumi is called to create underlying resources

_create will be called automatically when the class is instanciated

e.g

@dataclass
class NewGCPComponent(AbstractResource):
     def _create():
          pulumi.createNewResource()
          pulumi.anotherResource()

NewGCPComponent()
guilhem-fry commented 10 months ago
image