Ephemeral environments in AWS / E2E tests / Best practice

0

Hi, My scenario - I have AWS account A, here I have my EKS cluster, DB, and so on...

What is the best approach to perform E2E tests?

Should I create account B for that and replicate EKS cluster, DB, and so on...And perform E2E tests against account B. What if I want it to be ephemeral, like creating EKS cluster/DB and after tests deleting everything.

What are the best approaches?

Thank you

1개 답변
1
수락된 답변

Hi,

For this use case, you want to use Infrastructure-as-Code via AWS Cloudformation (or AWS CDK if you need more flexibility in programming your infra resources: ifs, loops)

I would suggest to start with CloudFormation: that's what I use to develop templates encompassing all the resources I need. I prefer yaml to json because it is more concise.

Recreating your full infra boils down to starting the same cloudformation stack in another account based on same yaml.

Note: it is very important for full portability across accounts that you include all resources incl. vpc, subnets, sec groups in addition EKS cluster and db in your yaml.

The AWS reference architecture as a CFN template is here: https://github.com/aws-samples/amazon-eks-refarch-cloudformation That should definitely be your starting point.

This article gives you the most salient benefits of Infra as Code: https://duplocloud.com/blog/infrastructure-as-code-benefits/ Best,

Didier

profile pictureAWS
전문가
답변함 9달 전
  • I am using Terraform. I was thinking about Step Function that will create CodePipeline, in a pipeline create EKS cluster and apply helm manifest. Once the app is ready, perform E2E tests. Then Step Function will delete all infra created.

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

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

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

관련 콘텐츠