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

MalformedPolicyDocument: A condition block must be present for the Cognito provider #98

Open
Kevin4562 opened this issue Mar 11, 2024 · 2 comments

Comments

@Kevin4562
Copy link

I am getting the following errors while trying to install NPK using the cloudshell script. This is causing Terraform to fail with the status code 1.

╷
│ Error: creating IAM Role (cognito_unauthenticated_role_20240311231517316200000001): MalformedPolicyDocument: A condition block must be present for the Cognito provider
│       status code: 400, request id: 8787c32b-3743-437e-b8fb-4838a6a27ff1│ 
│   with aws_iam_role.cognito_unauthenticated,
│   on cognito_iam_roles.tf.json line 277, in resource.aws_iam_role.cognito_unauthenticated:
│  277:             }
│ 
╵
╷
│ Error: creating Lambda Function (compression_pipe): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: c30ac9e3-c142-4dac-a323-908a8abaa7ee, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.compression_pipe,
│   on lambda-compression_pipe.tf.json line 135, in resource.aws_lambda_function.compression_pipe:
│  135:             }
│ 
╵
╷
│ Error: creating Lambda Function (create_campaign): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: 9273fcfb-61eb-49b9-a528-a3c4e7a450bc, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.create_campaign,
│   on lambda-create_campaign.tf.json line 135, in resource.aws_lambda_function.create_campaign:
│  135:             }
│ 
╵
╷
│ Error: creating Lambda Function (delete_campaign): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: b991d573-87a2-47e9-bdaf-09299603c8d4, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.delete_campaign,
│   on lambda-delete_campaign.tf.json line 112, in resource.aws_lambda_function.delete_campaign:
│  112:             }
│ 
╵
╷
│ Error: creating Lambda Function (execute_campaign): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: 93c2cee7-bb20-43d0-a5be-9b50b2bcc2ae, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.execute_campaign,
│   on lambda-execute_campaign.tf.json line 168, in resource.aws_lambda_function.execute_campaign:
│  168:             }
│ 
╵
╷
│ Error: creating Lambda Function (spot_interrupt_catcher): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: 37a542f7-4cd8-4b65-b83a-679b3941aff5, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.spot_interrupt_catcher,
│   on lambda-spot_interrupt_catcher.tf.json line 109, in resource.aws_lambda_function.spot_interrupt_catcher:
│  109:             }
│ 
╵
╷
│ Error: creating Lambda Function (spot_monitor): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: f360ddee-42a2-429a-94af-a83f719b349d, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.spot_monitor,
│   on lambda-spot_monitor.tf.json line 123, in resource.aws_lambda_function.spot_monitor:
│  123:             }
│ 
╵
╷
│ Error: creating Lambda Function (status_reporter): operation error Lambda: CreateFunction, https response error StatusCode: 400, RequestID: 5a9159b1-d21a-4564-916c-54b430b7500a, InvalidParameterValueException: The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating functions.
│ 
│   with aws_lambda_function.status_reporter,
│   on lambda-status_reporter.tf.json line 124, in resource.aws_lambda_function.status_reporter:
│  124:             }
│ 
╵```
@losteris
Copy link

ditto

@losteris
Copy link

use the dev branch until fix merged into main. worked for me.

source <(curl https://npkproject.io/cloudshell_install_dev.sh)

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

No branches or pull requests

2 participants