Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: provide a sample iam policy #91

Closed
wants to merge 1 commit into from
Closed

docs: provide a sample iam policy #91

wants to merge 1 commit into from

Conversation

Nr18
Copy link

@Nr18 Nr18 commented Jul 17, 2020

Issue #, if available: N/A

Description of changes:

The AWS::Serverless::Function resource will give the proper IAM policies for the logger and tracing automatically but you need to provide an additional policy if you want to make use of the Metrics utility.

Checklist

Breaking change checklist

RFC issue #:

  • Migration process documented
  • Implement warnings (if it can live side by side)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The AWS::Serverless::Function resource will give the proper IAM policies for the logger and tracing automatically but you need to provide an additional policy if you want to make use of the Metrics utility.
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2020

Codecov Report

Merging #91 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #91   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          474       474           
  Branches        42        42           
=========================================
  Hits           474       474           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6db7263...65d340c. Read the comment docs.

@nmoutschen
Copy link
Contributor

Hey Joris!

Where/when would this policy be needed? The Powertools use EMF to create metrics, so as long as the function can emit logs, this should work.

@Nr18
Copy link
Author

Nr18 commented Jul 17, 2020

@nmoutschen ah I see 🤔 I will retest I did not see any metrics until I added the policy.

I will get back to you on this one

@nmoutschen
Copy link
Contributor

I just checked on the permissions from the CreateOrder function in the aws-serverless-ecommerce-platform sample and it only has permissions for logs, X-Ray, API Gateway and DynamoDB.

By the way, have you decorated the handler with @metrics.log_metrics? It happened to me when I made the switch to Powertools for metrics. 😅

@Nr18
Copy link
Author

Nr18 commented Jul 17, 2020

Right I added the decorator around the same time I added the IAM policy 😆 , I will close the issue!

@Nr18 Nr18 closed this Jul 17, 2020
@Nr18 Nr18 deleted the patch-1 branch July 17, 2020 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants