Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

276
Visualizações
Manage stage and prod environments in AWS SAM/Cloudformation template along with CI/CD support

I'm having an AWS SAM template file with some resources hosted on github, a codepipeline has been setted up to detect changes in the repo then create/update and execute changes on cloudformation stack. Everything is working fine. But now I need to configure stage and prod environments in the same template. I'm finding it difficult how to do it properly.

Different approaches are welcomed as well.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Are PROD and STAGE in the same account, or different accounts? I will assume same

Transform: AWS::Serverless-2016-10-31

Parameters:
  Environment:
    Type: String
    AllowedValues:
      - STAGE
      - PROD

Resources:
  MyLambda:
    Type: AWS::Serverless::Function
    Properties:
      Handler: lambda_function.lambda_handler
      FunctionName: !Sub ${Environment}_my_lambda
      CodeUri: my_lambda

This would give a unique name to your lambda, by environment

Then when you deploy your template, use --parameter-overrides=Environment=STAGE or --parameter-overrides=Environment=PROD

You can setup CloudWatch to listen to CodeCommit. If STAGE branch changes, call CodeBuild to use the STAGE branch, and call CloudFormation w the STAGE param. Same for PROD

over 4 years ago · Santiago Trujillo Relatório

0

Parameters would be best

You could also use Mappings or Conditions. But either of those could get messy

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda