使用 Amazon SQS 将 ServiceNow 与 Chef 集成



我有一个用例,其中ServiceNow创建了一个SQS主题:

sendMessage(
current.variables.requested_for.u_ad_samaccountname.toString(),
current.variables.ssh_key.toString()
);
function sendMessage(user_name, ssh_key)
{
var formatter = null;
try
{
formatter = new SshKeyMessageCreator(user_name, ssh_key);
}
catch(e)
{
gs.log('DEBUG >>> error: ' + e);
return;
}
var msg = new AwsSqsMessage('https://sqs.us-east-1.amazonaws.com/465310850895/testqueue2', gs.getProperty('aws.sqs.acctprov.id'), gs.getProperty('aws.sqs.acctprov.key'), formatter.message);

我需要访问此消息以触发食谱,以便在厨师服务器中创建用户

我刚刚看了一下:

  1. https://github.com/FastRobot/chef_aws_demo
  2. https://github.com/awslabs/lambda-chef-node-cleanup
  3. https://aws.amazon.com/blogs/apn/automatically-delete-terminated-instances-in-chef-server-with-aws-lambda-and-cloudwatch-events/

参考 Josh 的演示"使用 aws 烹饪",2016 年 7 月",但他正在使用 cloudwatch 警报而不是 SQS

Chef 不是一个基于事件的系统。Chef 中没有任何内容可以侦听 SQS 事件。你必须自己为此写一些东西。

最新更新