Lambda function - Node.js
const AWS = require('aws-sdk')
exports.handler = async (event) => {
var appconfig = new AWS.AppConfig({ apiVersion: '2019-10-09' })
var params = {
ApplicationId: '6xeris1',
ConfigurationProfileId: '0ck2ijf'
}
const data = await appconfig.getConfigurationProfile(params).promise().catch(err => {
console.log(err)
})
if (data) {
console.log(data)
const response = {
statusCode: 200,
headers: {
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'OPTIONS,POST,GET'
},
body: JSON.stringify(data)
}
return response
} else {
const response = {
statusCode: 500,
headers: {
'Access-Control-Allow-Headers': 'Content-Type',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'OPTIONS,POST,GET'
},
body: {}
}
return response
}
}
When getConfigurationProfile
is called there is no response. No data, no error and the function get timeout.
I added below inline policy to Lambda execution IAM role, but it didn't work.
"Action": "appconfig:*"
Anyone solved this issue before me? Thank you.