---
- name: Get cfn stack outputs
  cloudformation_facts:
    stack_name: "{{ stack_name }}"
    region: "{{ region }}"
  register: stack

- name: Set s3 facts
  set_fact:
    s3user_id: "{{ stack['ansible_facts']['cloudformation'][stack_name]['stack_outputs']['S3UserAccessId'] }}"
    s3user_secret: "{{ stack['ansible_facts']['cloudformation'][stack_name]['stack_outputs']['S3UserSecretKey'] }}"
    s3_bucket_name: "{{ stack['ansible_facts']['cloudformation'][stack_name]['stack_outputs']['S3Bucket'] }}"
