Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Changelog

## 9.1.0

- Change the policy name for the Lambda shortcuts to include the stack's LogicalName

## 9.0.0

- Removes:
- Removes:
- aws-sdk as a runtime dependency.
- All node support prior to version 20.
- Adds:
- Adds:
- `@aws-sdk/client-cloudformation` as a runtime dependency.
- Updates:
- Updates:
- bin/validate-template to use `@aws-sdk/client-cloudformation`.
- Lambda shortcut lambda runtime default to use `node22.x`

Expand Down
2 changes: 1 addition & 1 deletion lib/shortcuts/lambda.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class Lambda {
Condition,
DependsOn: (RoleArn) ? undefined : `${LogicalName}Role`,
Properties: {
PolicyName: 'lambda-log-access',
PolicyName: `${LogicalName}-lambda-log-access`,
Roles: [roleName],
PolicyDocument: {
Version: '2012-10-17',
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/event-lambda-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/event-lambda-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
},
"Handler": "index.lambda",
"MemorySize": 128,
"Runtime": "nodejs16.x",
"Runtime": "nodejs22.x",
"Timeout": 30,
"Role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -225,7 +225,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -366,7 +366,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-github-secret-ref.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -372,7 +372,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-github-secret-string.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -366,7 +366,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-github.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -374,7 +374,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -370,7 +370,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-passthrough-alarms.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -354,7 +354,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
},
"Handler": "index.lambda",
"MemorySize": 128,
"Runtime": "nodejs16.x",
"Runtime": "nodejs22.x",
"Timeout": 30,
"Role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -211,7 +211,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -352,7 +352,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -352,7 +352,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -352,7 +352,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-passthrough-logging.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -352,7 +352,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/shortcuts/hookshot-passthrough.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "PassFunctionRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "PassFunction-lambda-log-access",
"Roles": [
{
"Ref": "PassFunctionRole"
Expand Down Expand Up @@ -352,7 +352,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "DestinationRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "Destination-lambda-log-access",
"Roles": [
{
"Ref": "DestinationRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/lambda-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/lambda-docker.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/lambda-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"Condition": "Always",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/lambda-provided-role.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"MyLambdaLogPolicy": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Fn::Select": [
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/lambda-zipfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/queue-lambda-zero.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/queue-lambda.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/scheduled-lambda-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/scheduled-lambda-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/stream-lambda-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/shortcuts/stream-lambda-no-defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"Type": "AWS::IAM::Policy",
"DependsOn": "MyLambdaRole",
"Properties": {
"PolicyName": "lambda-log-access",
"PolicyName": "MyLambda-lambda-log-access",
"Roles": [
{
"Ref": "MyLambdaRole"
Expand Down
Loading