CloudFormation 스택 알림 미설정

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

설명

CloudFormation의 생성·업데이트·롤백 상태를 SNS로 받으려면 Ansible 작업에 notification_arns를 지정하세요.

잠재적 영향

다른 모니터링 경로가 없으면 담당자가 배포 실패를 뒤늦게 알 수 있습니다.

해결 방법

운영 SNS 주제에 게시할 권한을 확인하고 담당자의 구독을 설정하세요. 실제 스택 이벤트가 담당자에게 전달되는지 시험하세요.

예시

두 번째 작업은 us-east-1의 stack-events 주제를 추가합니다. 주제 ARN, 템플릿 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

참조