• SSM Automation 更新AMI镜像


    1、从AMI启动一个实例

    2、检测安装ssm agent

    3、更新软件包

    4、停止实例

    5、根据实例创建一个新的AMI镜像

    6、终止实例

    以上流程完全可以通过ssm 中 Automation 的 AWS-UpdateLinuxAmi 文档搞定。但是在运行过程中一直遇到权限问题(完全按照aws 文档操作配置)。

    后经过google得以解决,整理如下:

    1、配置完毕了实例role 和 ssm自动化服务role,但是运行中报如下错误

    Automation Step Execution fails when it is launching the instance(s). Get Exception from RunInstances API of ec2 Service. 
    Exception Message from RunInstances API: [You are not authorized to perform this operation.
    Encoded authorization failure message: {{BIG NASTY BASE64 ERROR}} (Service: AmazonEC2; Status Code: 403; Error Code:
    UnauthorizedOperation; Request ID: e7feb002-b375–4bfc-3bd4–633943b9e158)]. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.

    2、处理方法:把以下策略添加到 AutomationAssumeRole 角色中可以解决以上问题,我遇到的情况连第二步校验超时问题也同时被解决掉了。

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                  "Sid": "GrantsAccessToIAMRoles",
                  "Effect": "Allow",
                  "Action": [
                     "iam:*"
                   ],
                   "Resource": [
                       "arn:aws:iam::AWS-ACCOUNT-NUMBER:role/*"
                   ]
            }
        ]
    }
  • 相关阅读:
    今天做了个小项目
    了解类与对象
    装机时键盘选择失误?教你修改kali Linux键盘到美式。
    一些模塊的用法
    你也是全员模块?
    金额保留2位小数 xx.00
    maven项目统一管理版本
    启动项目报错——找不到或无法加载主类 io.vertx.core.Launcher
    以jar包方式启动
    支付业务接口功能(二)
  • 原文地址:https://www.cnblogs.com/husbandmen/p/10566601.html
Copyright © 2020-2023  润新知