Describe the bug
According to AWS custom resource reference, ResponseURL is a required request field.
The behavior of custom resource provider framework was changed in 2.31.0 to not pass it to user function. It's discussed in #20899.
Without ResponseURL, the provider function fails trying to send the response to CloudFormation.
It works as expected in version 2.30.0.
Expected Behavior
Custom resource should be created without errors.
Current Behavior
Custom resource creation fails with following error (Golang function, the ResponseURL in the event it receives is an empty string):
Received response status [FAILED] from custom resource. Message returned: Error: Put "": unsupported protocol scheme ""
Reproduction Steps
Sample custom resource function from:
https://pkg.go.dev/github.com/aws/aws-lambda-go/cfn#readme-sample-function
import { Stack, StackProps, CustomResource } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import {
Code,
Function,
Runtime,
} from 'aws-cdk-lib/aws-lambda';
import {
Provider,
} from 'aws-cdk-lib/custom-resources';
export class DeploymentStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const fn = new Function(this, 'MyFunc', {
runtime: Runtime.GO_1_X,
memorySize: 256,
code: Code.fromAsset('build/'),
handler: 'func',
});
const provider = new Provider(this, 'Provider', {
onEventHandler: fn,
});
new CustomResource(this, 'CustomResource', { serviceToken: provider.serviceToken });
}
}
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.31.0 (build b67950d)
Framework Version
No response
Node.js Version
v16.15.1
OS
Ubuntu
Language
Typescript
Language Version
No response
Other information
No response
Describe the bug
According to AWS custom resource reference,
ResponseURLis a required request field.The behavior of custom resource provider framework was changed in
2.31.0to not pass it to user function. It's discussed in #20899.Without
ResponseURL, the provider function fails trying to send the response to CloudFormation.It works as expected in version
2.30.0.Expected Behavior
Custom resource should be created without errors.
Current Behavior
Custom resource creation fails with following error (Golang function, the
ResponseURLin the event it receives is an empty string):Reproduction Steps
Sample custom resource function from:
https://pkg.go.dev/github.com/aws/aws-lambda-go/cfn#readme-sample-function
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.31.0 (build b67950d)
Framework Version
No response
Node.js Version
v16.15.1
OS
Ubuntu
Language
Typescript
Language Version
No response
Other information
No response