So far, my code looks like this:
const AWS = require('aws-sdk');
AWS.config.update({ region: 'eu-west-1' });
const CF = new AWS.CloudFormation({ apiVersion: '2010-05-15' });
const updateParams = {
StackName: myStackName,
UsePreviousTemplate: true,
Parameters: [
{
ParameterKey: "StackOffline",
ParameterValue: "Online"
}
],
Capabilities: [
"CAPABILITY_IAM",
"CAPABILITY_AUTO_EXPAND"
]
};
exports.handler = async (event) => {
CF.updateStack(updateParams, (err, data) => {
if (err)
console.log(err, err.stack);
else
console.log(data);
});
// ...
};
The problem is... it doesn't do anything. When it's run, it doesn't actually log anything; not data, nor an error message.
I tried using both the stack name and the unique stack ID, but neither worked.
Finally, I saved the return value (Request, I think) of updateStack() and here's its response property:
response: Response {
request: [Circular *1],
data: null,
error: null,
retryCount: 0,
redirectCount: 0,
httpResponse: HttpResponse {
statusCode: undefined,
headers: {},
body: undefined,
streaming: false,
stream: null,
_abortCallback: [Function: callNextListener]
},
maxRetries: 3,
maxRedirects: 10
}
(I can also post the entire Request, if needed. I didn't because it's enormous, and I don't know if it contains any sensitive information.)
I assume those null values are a problem. Where am I going wrong?