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

92
Visualizações
Is to possible to create SNS topic with multiple email Recipients in cloudformation template?

V1: I am trying to set up a cloudwatch alarms to send email notification to the multiple team members. it looks like we can only set one email in the topic endpoint. is there any way to add list of subscribers in the endpoint in the cloudformation template? or is there any better approach to do this?

V2: when I created SNS::Subscription resource and provide 2 emails, it gave me error: ##[error]Error: Stack failed to reach update completion status, error: 'Resource is not in the state stackUpdateComplete' I am not sure if I have provided property in a right format or what could be the mistake.

Resources:
  Topic:
    Type: "AWS::SNS::Topic"
    Properties:
      DisplayName: !Sub "Connect InstanceId ${InstanceId}"

  EmailSubscription:
    Type: AWS::SNS::Subscription
    Properties:
      Endpoint: abc@abc.com
      Protocol: email
      Endpoint: xyz@xyz.com
      Protocol: email
      TopicArn: !Ref Topic

Question: even though if it works, My question regarding to this is, what would be ideal approach when you have set up multiple CloudWatch Alarms and want to send email notification to the multiple people when certain threshold is breach? The way I see it, it is kind of defeating the purpose of re usability of cloudformation template when you hard-code every email address of users like this. and even if we parameterize email address of every users, it would take a lot of time to add email address in the parameter file when you have 50 subscribers/users. I could be wrong or is there any better approach to do this!

Thanks!

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

0

The CloudFormation provides a AWS::SNS::Subscription resource.

I don't see any reason why you couldn't create few of them, one for each of your email recipients.

Edit.

For two emails, you have to create two resources:

 EmailSubscription1:
    Type: AWS::SNS::Subscription
    Properties:
      Endpoint: abc@abc.com
      Protocol: email
       TopicArn: !Ref Topic

 EmailSubscription2:
    Type: AWS::SNS::Subscription
    Properties:
      Endpoint: xyz@xyz.com
      Protocol: email
      TopicArn: !Ref Topic
over 4 years ago · Santiago Trujillo Relatório

0

You can use

Resources:
  Topic:
    Type: "AWS::SNS::Topic"
    Properties:
      DisplayName: !Sub "Connect InstanceId ${InstanceId}"
      Subscription:
        - Endpoint: <email_1>
          Protocol: "email"
        - Endpoint: <email_2>
          Protocol: "email"
over 4 years ago · Santiago Trujillo Relatório

0

EmailSubscription: 
  Type: AWS::SNS::Topic
  Properties: 
    Subscription: 
      - Endpoint: "xyz@xyz.com"
        Protocol: "email"
      - Endpoint: "abc@abc.com"
        Protocol: "email"
    TopicName: !Ref Topic                                                            
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