July 2017
Intermediate to advanced
402 pages
9h 38m
English
We will once again edit our nodeserver-cf-template.py script. Open the file with your editor, and in the MonitoringPolicy policy, add the following to allow our EC2 instance to communicate with Firehose and put a record into the stream:
t.add_resource(IAMPolicy(
"MonitoringPolicy",
PolicyName="AllowSendingDataForMonitoring",
PolicyDocument=Policy(
Statement=[
Statement(
Effect=Allow,
Action=[
Action("cloudwatch", "Put*"),
Action("logs", "Create*"),
Action("logs", "Put*"),
Action("logs", "Describe*"),
Action("events", "Put*"),
Action("firehose", "Put*"),
],
Resource=["*"])
]
),
Roles=[Ref("Role")],
))
Save the new script, commit your changes, and, following the same steps as before, deploy ...
Read now
Unlock full access