How to set up parameterized components automatically in a declarative way?

0

Hello everyone,

we need to set up some AWS resources automatically for some users of our system. The current approach is to have the user authenticate and redirect his request to a Lambda endpoint. The Lambda checks if the user already has the resources and if not creates the desired resources in an imperative way. The resources are always the same (S3 Bucket, Encryption Key, Role, ELB Listener Rule, Target Group).

This has several disadvantages. Tagging of resources is tedious and also resource creation is not an atomic operation and thus the process is error prone. Therefore we would like to change to a declarative approach.

Our current idea is to create a CfnTemplate with the desired resources and proper parameters to create the individual resources. The Lambda back end would than deploy the CfnTemplate up on user authentication.

While this looks like a step in the right direction we would like to confirm if this is the best approach or if there are other/better options.

Specifically many resources created in our project already use the TypeScript CDK and if there is a way to define something like a "component factory" in CDK, that would be nice as well!

Any guidance or link to useful resources is highly appreciated. Thanks in advance!

1개 답변
0

Your plan to use a CloudFormation (CFn) template to define the AWS resources for your users is a good approach. Using CFn templates will help you to define your infrastructure in a declarative way, which is more scalable and maintainable than an imperative approach. In addition to using CFn templates, you can also consider using AWS Cloud Development Kit (CDK) to define your infrastructure as code in TypeScript. CDK is a higher-level abstraction over CFn templates, allowing you to define your infrastructure in a more programmatic way. With CDK, you can define reusable components, called constructs, which can be used to create infrastructure resources. You can also define your own constructs and reuse them across your projects. Using CDK can help you to reduce the amount of boilerplate code needed to create and manage your AWS resources.

답변함 일 년 전
  • Can you be more specific about how the CDK can be used to deploy the resources on demand?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠