Attempting to deploy an authorizer resource via cdk. The authorizer references a lambda deployed and exported via another stack. This resource fails to create with the following error:
Resource handler returned message: "Unable to complete operation due to concurrent modification. Please try again later. (Service: ApiGateway, Status Code: 409, Request ID: fae3043f-7328-4d91-91e2-ea18f654b6e4)" (RequestToken: ad9e3a2f-54ea-86ce-e87b-278b997d351f, HandlerErrorCode: AlreadyExists)
I get this error every time. Trying again doesn't seem to be helping. Iv'e done some research on this which has led me to investigating the possibility of another resource existing with the same id and that is not the case. I also saw that a 409 error can be related to a caller reference issue but that seems to be related to calling a deployed api and I am experiencing this issue on deploy. Any ideas would be much appreciated.
//This lambda is exported from another stack deployed to the same environment
const authLambdaArn = cdk.Fn.importValue(`arn-of-auth-lambda`)
const eHApi = new apigateway.RestApi(this, `${stackName}-Api`, {
deployOptions: {
stageName: 'dev'
},
endpointConfiguration: {
types: [apigateway.EndpointType.REGIONAL]
},
minimumCompressionSize: 1000,
})
const eHAuthorizer = new CfnAuthorizer(this, 'EhAuthorizer', {
restApiId: `${stackName}-Api`,
type: 'TOKEN',
name: `${stackName}-Authorizer`,
authorizerUri: `arn:aws:apigateway:${region}:lambda:path/2015-03-31/functions/${authLambdaArn}/invocations`,
identitySource: "method.request.header.Cookie",
authorizerCredentials: eHApiAuthorizerCredentials,
authorizerResultTtlInSeconds: 0
})