aws-system-manager-automation-unencrypted-to-encrypted-resources icon indicating copy to clipboard operation
aws-system-manager-automation-unencrypted-to-encrypted-resources copied to clipboard

Remediation failed due to python version not supported.

Open ddmewada opened this issue 1 year ago • 0 comments

This is the response by AWS Support: We have identified that the error you are experiencing relates to the AWS Lambda function's runtime. The current Python 3.7 runtime is no longer supported, and an update to Python 3.12 is required.

Extract from our logging to confirm the issue: 2024-02-15T17:48:16.282Z AWS::Lambda::Function DetachVolumeLambda CREATE_FAILED Resource handler returned message: "The runtime parameter of python3.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.12) while creating or updating functions. (Service: Lambda, Status Code: 400, Request ID: 508ce64b-ce09-4bfb-b208-872a0f94c85e)" (RequestToken: 4a067256-c32e-4099-6da5-012a55fa66a1, HandlerErrorCode:

Pertaining to the above log I have changed the python version in the cloudformation stack that is created as below: EncryptEBSVolumesConfigRemediation: Type: AWS::Config::RemediationConfiguration Properties: ConfigRuleName: encrypted-volumes TargetId: Ref: ENCRYPTunencryptedebsvolume TargetType: SSM_DOCUMENT Automatic: false Parameters: automationAssumeRole: StaticValue: Values: - Fn::ImportValue: !Sub "${RoleKeyStackNameParameter}-RoleARN" kmsKeyId: StaticValue: Values: - Fn::ImportValue: !Sub "${RoleKeyStackNameParameter}-KeyID" volumeId: ResourceValue: Value: RESOURCE_ID ResourceType: AWS::EC2::Volume TargetVersion: "1" DependsOn: - ENCRYPTunencryptedebsvolume Metadata: aws:cdk:path: unencrypted-to-encrypted-ebs/EncryptEBSVolumesConfigRemediation CDKMetadata: Type: AWS::CDK::Metadata Properties: Modules: aws-cdk=1.19.0,@aws-cdk/assets=1.19.0,@aws-cdk/aws-cloudwatch=1.19.0,@aws-cdk/aws-config=1.19.0,@aws-cdk/aws-ec2=1.19.0,@aws-cdk/aws-events=1.19.0,@aws-cdk/aws-iam=1.19.0,@aws-cdk/aws-kms=1.19.0,@aws-cdk/aws-lambda=1.19.0,@aws-cdk/aws-logs=1.19.0,@aws-cdk/aws-s3=1.19.0,@aws-cdk/aws-s3-assets=1.19.0,@aws-cdk/aws-sns=1.19.0,@aws-cdk/aws-sqs=1.19.0,@aws-cdk/aws-ssm=1.19.0,@aws-cdk/core=1.19.0,@aws-cdk/cx-api=1.19.0,@aws-cdk/region-info=1.19.0,jsii-runtime=Python/3.12

can you help on the same ?

ddmewada avatar Feb 21 '24 15:02 ddmewada