Skip to content

Commit

Permalink
Update introduction-lambda.mdx
Browse files Browse the repository at this point in the history
Fixing indent issue
  • Loading branch information
jeff-colucci authored Aug 9, 2024
1 parent db13770 commit c514bb6
Showing 1 changed file with 67 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,73 +58,73 @@ Before enabling serverless monitoring using our Lambda layer, you'll need:

Then you'll need to complete the following:

1. Install[AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) configure using `aws configure`. You will need an AWS Access Key ID and AWS Secret Access Key.
2. Install [Python](https://www.python.org/downloads/) version 3.3 or higher.
3. Install the [newrelic-lambda CLI](https://github.com/newrelic/newrelic-lambda-cli#installation). To install, run the following:
```bash
pip3 install newrelic-lambda-cli
```
4. By default, we use the AWS Managed Policy `ReadOnlyAccess`. This allows the Infrastructure integration to see
all the resources in your account, rather than just your Lambda functions and CloudWatch metrics. New Relic
recommends this default, but we understand that some organizations prefer a strict security posture for
third party integrations. If you'd like to limit New Relic's access, the IAM role can be granted with a minimum of these permissions:

```yaml
Resource: "*"
Action:
- "cloudwatch:GetMetricStatistics"
- "cloudwatch:ListMetrics"
- "cloudwatch:GetMetricData"
- "lambda:GetAccountSettings"
- "lambda:ListFunctions"
- "lambda:ListAliases"
- "lambda:ListTags"
- "lambda:ListEventSourceMappings"
```
5. Before running the CLI, you will need to grant New Relic a minimum of these permissions in AWS:

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CLIAccessPolicy",
"Action": [
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:DescribeStacks",
"cloudformation:ExecuteChangeSet",
"iam:AttachRolePolicy",
"iam:CreateRole",
"iam:GetRole",
"iam:PassRole",
"lambda:AddPermission",
"lambda:CreateFunction",
"lambda:GetFunction",
"logs:DeleteSubscriptionFilter",
"logs:DescribeSubscriptionFilters",
"logs:PutSubscriptionFilter",
"s3:GetObject",
"serverlessrepo:CreateCloudFormationChangeSet",
"secretsmanager:CreateSecret"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "NRLogAccessPolicy",
"Effect": "Allow",
"Action": [
"serverlessrepo:CreateCloudFormationTemplate",
"serverlessrepo:GetCloudFormationTemplate"
],
"Resource": "arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion"
}
]
}
```

If you'd like to learn more about our CLI, see [our CLI repo](https://github.com/newrelic/newrelic-lambda-cli#installation).
1. Install[AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) configure using `aws configure`. You will need an AWS Access Key ID and AWS Secret Access Key.
2. Install [Python](https://www.python.org/downloads/) version 3.3 or higher.
3. Install the [newrelic-lambda CLI](https://github.com/newrelic/newrelic-lambda-cli#installation). To install, run the following:
```bash
pip3 install newrelic-lambda-cli
```
4. By default, we use the AWS Managed Policy `ReadOnlyAccess`. This allows the Infrastructure integration to see
all the resources in your account, rather than just your Lambda functions and CloudWatch metrics. New Relic
recommends this default, but we understand that some organizations prefer a strict security posture for
third party integrations. If you'd like to limit New Relic's access, the IAM role can be granted with a minimum of these permissions:
```yaml
Resource: "*"
Action:
- "cloudwatch:GetMetricStatistics"
- "cloudwatch:ListMetrics"
- "cloudwatch:GetMetricData"
- "lambda:GetAccountSettings"
- "lambda:ListFunctions"
- "lambda:ListAliases"
- "lambda:ListTags"
- "lambda:ListEventSourceMappings"
```
5. Before running the CLI, you will need to grant New Relic a minimum of these permissions in AWS:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CLIAccessPolicy",
"Action": [
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:DescribeStacks",
"cloudformation:ExecuteChangeSet",
"iam:AttachRolePolicy",
"iam:CreateRole",
"iam:GetRole",
"iam:PassRole",
"lambda:AddPermission",
"lambda:CreateFunction",
"lambda:GetFunction",
"logs:DeleteSubscriptionFilter",
"logs:DescribeSubscriptionFilters",
"logs:PutSubscriptionFilter",
"s3:GetObject",
"serverlessrepo:CreateCloudFormationChangeSet",
"secretsmanager:CreateSecret"
],
"Effect": "Allow",
"Resource": "*"
},
{
"Sid": "NRLogAccessPolicy",
"Effect": "Allow",
"Action": [
"serverlessrepo:CreateCloudFormationTemplate",
"serverlessrepo:GetCloudFormationTemplate"
],
"Resource": "arn:aws:serverlessrepo:us-east-1:463657938898:applications/NewRelic-log-ingestion"
}
]
}
```
If you'd like to learn more about our CLI, see [our CLI repo](https://github.com/newrelic/newrelic-lambda-cli#installation).

## Recommended AWS Lambda language runtimes [#recommended]

Expand Down

0 comments on commit c514bb6

Please sign in to comment.