{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2329","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2329/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2329/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2329/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2329","id":157226107,"number":2329,"title":"New module cloudformation_facts","user":{"login":"jmenga","id":16098232,"avatar_url":"https://avatars.githubusercontent.com/u/16098232?v=3","gravatar_id":"","url":"https://api.github.com/users/jmenga","html_url":"https://github.com/jmenga","followers_url":"https://api.github.com/users/jmenga/followers","following_url":"https://api.github.com/users/jmenga/following{/other_user}","gists_url":"https://api.github.com/users/jmenga/gists{/gist_id}","starred_url":"https://api.github.com/users/jmenga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmenga/subscriptions","organizations_url":"https://api.github.com/users/jmenga/orgs","repos_url":"https://api.github.com/users/jmenga/repos","events_url":"https://api.github.com/users/jmenga/events{/privacy}","received_events_url":"https://api.github.com/users/jmenga/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/cloud","name":"cloud","color":"c7def8"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/needs_revision","name":"needs_revision","color":"eb6420"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/new_plugin","name":"new_plugin","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-05-27T15:01:07Z","updated_at":"2016-08-24T22:26:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/2329","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2329","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/2329.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/2329.patch"},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - New Module Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task  -->\r\ncloudformation_facts\r\n\r\n##### ANSIBLE VERSION\r\n```\r\n<!--- Paste verbatim output from “ansible --version” between quotes -->\r\nansible 2.1.0.0\r\n  config file =\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\nProvides facts about AWS CloudFormation stacks.  Note there is another open pull request #1230  however my module has much more functionality.\r\n\r\nIn its most basic form, it will return stack description and also provides some useful transformations (`stack_outputs` and `stack_parameters` in the example below) to make stack outputs and stack parameters easier to work with:\r\n\r\n```\r\n{\r\n        \"changed\": false,\r\n        \"stack_description\": {\r\n            \"CreationTime\": \"2016-05-27T02:02:23.997000+00:00\",\r\n            \"DisableRollback\": false,\r\n            \"NotificationARNs\": [],\r\n            \"Parameters\": [\r\n                {\r\n                    \"ParameterKey\": \"SomeParameter\",\r\n                    \"ParameterValue\": \"sg-abcd1234\"\r\n                },\r\n                {\r\n                    \"ParameterKey\": \"DBInstanceClass\",\r\n                    \"ParameterValue\": \"db.t2.medium\"\r\n                },\r\n                {\r\n                    \"ParameterKey\": \"myVPC\",\r\n                    \"ParameterValue\": \"vpc-abcd1234\"\r\n                }\r\n            ],\r\n            \"Outputs\": [\r\n                {\r\n                    \"Description\": \"Stack Name\",\r\n                    \"OutputKey\": \"StackName\",\r\n                    \"OutputValue\": \"demo-stack\"\r\n                },\r\n                {\r\n                    \"Description\": \"Some Output\",\r\n                    \"OutputKey\": \"SomeOutput\",\r\n                    \"OutputValue\": \"some-output-here\"\r\n                }\r\n            ],\r\n            \"StackId\": \"arn:aws:cloudformation:ap-southeast-2:12345678:stack/demo-stack/0dcd0dd0-23af-11e6-bb66-50fae957fce6\",\r\n            \"StackName\": \"demo-stack\",\r\n            \"StackStatus\": \"CREATE_COMPLETE\",\r\n            \"Tags\": []\r\n        },\r\n        \"stack_outputs\": {\r\n            \"StackName\": \"demo-stack\",\r\n            \"SomeOutput\": \"some-output-here\",\r\n        },\r\n        \"stack_parameters\": {\r\n            \"SomeParameter\": \"sg-abcd1234\",\r\n            \"DBInstanceClass\": \"db.t2.medium\",\r\n            \"myVPC\": \"vpc-abcd1234\"\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nA number of optional parameters can be specified to include the following additional stack information:\r\n\r\n- Stack Policy\r\n- Stack Template\r\n- Stack Events\r\n- Stack Resources\r\n\r\n**Example Usage:**\r\n```\r\n# Output basic facts\r\n- cloudformation_facts:\r\n    stack_name: demo-stack\r\n\r\n# Output all facts\r\n- cloudformation_facts:\r\n    stack_name: demo-stack\r\n    all_facts: true\r\n\r\n# Output basic facts + stack resources + stack template\r\n- cloudformation_facts:\r\n    stack_name: demo-stack\r\n    stack_resources: true\r\n    stack_template: true\r\n```\r\n\r\n**Example expanded outputs:**\r\n```\r\n{\r\n        \"changed\": false,\r\n        \"stack_description\": {\r\n            \"CreationTime\": \"2016-05-27T02:02:23.997000+00:00\",\r\n            \"DisableRollback\": false,\r\n            \"NotificationARNs\": [],\r\n            \"Parameters\": [\r\n                {\r\n                    \"ParameterKey\": \"SomeParameter\",\r\n                    \"ParameterValue\": \"sg-abcd1234\"\r\n                },\r\n                {\r\n                    \"ParameterKey\": \"DBInstanceClass\",\r\n                    \"ParameterValue\": \"db.t2.medium\"\r\n                },\r\n                {\r\n                    \"ParameterKey\": \"myVPC\",\r\n                    \"ParameterValue\": \"vpc-abcd1234\"\r\n                }\r\n            ],\r\n            \"Outputs\": [\r\n                {\r\n                    \"Description\": \"Stack Name\",\r\n                    \"OutputKey\": \"StackName\",\r\n                    \"OutputValue\": \"demo-stack\"\r\n                },\r\n                {\r\n                    \"Description\": \"Some Output\",\r\n                    \"OutputKey\": \"SomeOutput\",\r\n                    \"OutputValue\": \"some-output-here\"\r\n                }\r\n            ],\r\n            \"StackId\": \"arn:aws:cloudformation:ap-southeast-2:12345678:stack/demo-stack/0dcd0dd0-23af-11e6-bb66-50fae957fce6\",\r\n            \"StackName\": \"demo-stack\",\r\n            \"StackStatus\": \"CREATE_COMPLETE\",\r\n            \"Tags\": []\r\n        },\r\n        # This is a dictionary mapping OutputKey values to OutputValue values\r\n        \"stack_outputs\": {\r\n            \"StackName\": \"demo-stack\",\r\n            \"SomeOutput\": \"some-output-here\",\r\n        },\r\n        # This is a dictionary mapping ParameterKey values to ParameterValue values\r\n        \"stack_parameters\": {\r\n            \"SomeParameter\": \"sg-abcd1234\",\r\n            \"DBInstanceClass\": \"db.t2.medium\",\r\n            \"myVPC\": \"vpc-abcd1234\"\r\n        },\r\n       \"stack_events\": [\r\n            {\r\n                \"EventId\": \"cef9c330-23b0-11e6-9836-50fae957fc4a\",\r\n                \"LogicalResourceId\": \"my-rds\",\r\n                \"PhysicalResourceId\": \"arn:aws:cloudformation:ap-southeast-2:12345678:stack/demo-stack/0dcd0dd0-23af-11e6-bb66-50fae957fce6\",\r\n                \"ResourceStatus\": \"CREATE_COMPLETE\",\r\n                \"ResourceType\": \"AWS::CloudFormation::Stack\",\r\n                \"StackId\": \"arn:aws:cloudformation:ap-southeast-2:12345678:stack/demo-stack/0dcd0dd0-23af-11e6-bb66-50fae957fce6\",\r\n                \"StackName\": \"demo-stack\",\r\n                \"Timestamp\": \"2016-05-27T02:14:57.439000+00:00\"\r\n            },\r\n           ....\r\n        ],\r\n       \"stack_policy\": {},\r\n       \"stack_resource_list\": [\r\n            {\r\n                \"LogicalResourceId\": \"DBinstance\",\r\n                \"PhysicalResourceId\": \"my-rds\",\r\n                \"ResourceStatus\": \"CREATE_COMPLETE\",\r\n                \"ResourceType\": \"AWS::RDS::DBInstance\",\r\n                \"StackId\": \"arn:aws:cloudformation:ap-southeast-2:12345678:stack/demo-stack/0dcd0dd0-23af-11e6-bb66-50fae957fce6\",\r\n                \"StackName\": \"demo-stack\",\r\n                \"Timestamp\": \"2016-05-27T02:14:55.879000+00:00\"\r\n            },\r\n            ...\r\n       ],\r\n       # This is a dictionary mapping LogicalResourceID values to PhysicalResourceID values\r\n       \"stack_resources\": {\r\n            \"DBinstance\": \"my-rds\",\r\n            ...\r\n       },\r\n       \"stack_template\": {\r\n            \"AWSTemplateFormatVersion\": \"2010-09-09\",\r\n            \"Parameters\": {\r\n                ....\r\n            },\r\n            \"Resources\": {\r\n                ....\r\n            },\r\n           ...  \r\n     }\r\n}\r\n```\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/242227998","html_url":"https://github.com/ansible/ansible-modules-extras/pull/2329#issuecomment-242227998","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/2329","id":242227998,"user":{"login":"gregdek","id":252125,"avatar_url":"https://avatars.githubusercontent.com/u/252125?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdek","html_url":"https://github.com/gregdek","followers_url":"https://api.github.com/users/gregdek/followers","following_url":"https://api.github.com/users/gregdek/following{/other_user}","gists_url":"https://api.github.com/users/gregdek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdek/subscriptions","organizations_url":"https://api.github.com/users/gregdek/orgs","repos_url":"https://api.github.com/users/gregdek/repos","events_url":"https://api.github.com/users/gregdek/events{/privacy}","received_events_url":"https://api.github.com/users/gregdek/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T22:26:49Z","updated_at":"2016-08-24T22:26:49Z","body":"Thanks @jmenga for this PR. This PR requires revisions, either because it fails to build or by reviewer request. Please make the suggested revisions. When you are done, please comment with text 'ready_for_review' and we will put this PR back into review.\n\n[This message brought to you by your friendly Ansibull-bot.]"}}
{"actor":{"display_login":"gregdek"}}