CloudFormation 스택 알림 미설정

배포 상태를 필요한 운영 채널로 전달하세요.

설명

CloudFormation은 SNS 토픽을 통해 스택 생성, 업데이트와 롤백 등 상태 변경을 알릴 수 있습니다. 알림이나 대체 모니터링이 없으면 배포 문제를 늦게 발견할 수 있습니다.

잠재적 영향

실패한 배포를 확인하거나 운영 담당자에게 전달하는 데 시간이 더 걸릴 수 있습니다.

해결 방법

알림이 필요하면 notification_arns에 SNS 토픽 ARN을 지정하고 게시 권한, 구독과 알림 수신을 확인하세요.

예시

SNS 알림 대상을 추가하는 예시입니다. 토픽, 템플릿 URL과 매개변수는 실제 환경에 맞게 준비하세요.

변경 전

yaml
- name: CloudFormation 스택 생성
  amazon.aws.cloudformation:
    stack_name: ansible-cloudformation
    state: present
    region: us-east-1
    disable_rollback: true
    template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
    template_parameters:
      KeyName: jmartin
      DiskType: ephemeral
      InstanceType: m1.small
      ClusterSize: 3
    tags:
      Stack: ansible-cloudformation

변경 후

yaml
- name: CloudFormation 스택 생성
  amazon.aws.cloudformation:
    stack_name: ansible-cloudformation
    notification_arns: arn:aws:sns:us-east-1:123456789012:stack-events
    state: present
    region: us-east-1
    disable_rollback: true
    template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
    template_parameters:
      KeyName: jmartin
      DiskType: ephemeral
      InstanceType: m1.small
      ClusterSize: 3
    tags:
      Stack: ansible-cloudformation

참조