CI/CD Pipelines with AWS SAM

I’ve been building and deploying my stack manually during development using sam build and sam deploy, and understand how that and the samconfig.toml work. But now I’m trying to get a CI/CD pipeline in place since we’re ready to go to the other environments and ultimately deploy to prod. I feel like I understand most of what I need, but am falling a little short when putting some parts together.

My previous team had a pipeline in place, but it was made years ago and didn’t leverage SAM commands. DevOps had created a similar pipeline for me using Terraform, but I’m running into some issues with it. The other teams didn’t use images for Lambdas, which my current team is doing now, so I think some things need to be done slightly different so that the ECR repo is created and associated properly. I have some freedom to create my own pipeline if needed, so I’m taking a stab at it.

Here is some information about my use case:

  1. We have three AWS accounts for each environment. (dev, staging, prod)
  2. My template.yaml is built to work in all environments through the use of parameters and pseudo parameters.
  3. An existing CodeStar connection exists already in each account, so I figure I can reuse that ARN.
  4. We have branches for dev, staging, and master. I would like a process where we merge a branch into dev, and the dev AWS account runs the pipeline to deploy everything. And then the same for staging/staging and master/prod.
  5. I’m using CodePipeline and GitHub.

I’ve been following the docs and articles on how to get a pipeline set up, but some things aren’t 100% clear to me. I’m following the process of sam pipeline bootstrap and sam pipeline init. Here is what I understand so far (please correct me if I’m wrong):

  1. sam pipeline bootstrap creates the necessary resources in the AWS account for the pipeline. The generated ARNs are stored in a config file so that they can be referenced later when creating the template for the pipeline resources and deploying the pipeline. I have to do this for each stage, and each stage in my case would be dev, staging, and prod, which are all separate AWS accounts.
  2. I used the built-in two-stage template when running sam pipeline init, but I need three stages. Looking over the generated template, I think I should be able to alter it to support all three stages that I need.

I haven’t deployed the pipeline template yet, as this is where I start to get confused. This built-in template is mainly referencing a feature branch vs a main branch (their 2-stages). In my case, I don’t necessarily care about various feature branches out there, but rather only care about the three specific branches for each environment. Has anyone used this template and run into a similar use case to me?

And then the other thing I’m wondering about is when it comes to version control. There are several files generated for this pipeline. Am I meant to check-in all of these files (aside from files in .aws-sam) into the repo? It seems like if I wanted to modify or redeploy the pipeline, I would want this codepipeline.yaml and pipeline folder. But the template has many of the ARNs hardcoded. Is that seen as an issue? Or should I move all that into something like a secret in Secrets Manager? That’s where we usually keep our parameters for these SAM templates.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật