利用 AWS Health API

AWS Health API是什么?

通过AWS Health API获取在AWS个人健康仪表盘上收到的事件信息。

AWS Health イベント是指亚马逊云服务(AWS)的健康事件。

AWS Health 事件也被称为 Health 事件,是 AWS Health 代替其他 AWS 服务发送的通知。使用这些事件,您可以了解可能影响您账户的未来变更和计划变更的信息。

从AWS健康的概念来看

有用户特定的事件和公共事件。

可以获取哪些活动?

可以获取事件类型列表中存在的事件

您可以使用AWS Health API的DescribeEventTypes来获取事件类型列表。

aws health describe-event-types --region us-east-1 > types.json

仅支持us-east-1地域的AWS Health API端点

DescribeEventTypes操作的功能是获取与指定的过滤器匹配的事件类型。事件类型是AWS服务中与事件相关的事件类型代码和分类的模板定义。事件类型和事件类似于面向对象编程中的类和对象。AWS Health支持的事件类型数量将随时间增加。

由于受到 AWS Health 支持的操作,因此它们不会列在文档中。您需要通过API进行确认。

已支持的事件类型列表

cat types.json | jq '[.eventTypes[].code] | unique'

事件类型的分类

以下可以分为三类。

    • アカウント通知

codeにNOTIFICATIONやNOTICEとつく

問題

codeにISSUEとつく

予定された変更

codeにMAINTENANCEやSCHEDULEDとつく

服务列表

cat types.json | jq '[.eventTypes[].service] | unique'

2022年12月的CodeCatalyst也支持几个活动类别。

[
  "A2I",
  "A4B",
  "ABUSE",
  "ACCOUNT",
  "ACM",
  "ACMPRIVATECA",
  "ACTIVATECONSOLE",
  "AIRFLOW",
  "AMPLIFY",
  "AMPLIFYADMIN",
  "AMPLIFYUIBUILDER",
  "APIGATEWAY",
  "APPCONFIG",
  "APPFLOW",
  "APPLICATIONINSIGHTS",
  "APPLICATION_AUTOSCALING",
  "APPMESH",
  "APPRUNNER",
  "APPSTREAM",
  "APPSTREAM2",
  "APPSYNC",
  "APS",
  "ATHENA",
  "AUDITMANAGER",
  "AUTOSCALING",
  "AWIS",
  "BACKUP",
  "BATCH",
  "BILLING",
  "BRAKET",
  "CASSANDRA",
  "CHATBOT",
  "CHIME",
  "CLEANROOMS",
  "CLIENT_VPN",
  "CLOUD9",
  "CLOUDDIRECTORY",
  "CLOUDFORMATION",
  "CLOUDFRONT",
  "CLOUDHSM",
  "CLOUDSEARCH",
  "CLOUDSHELL",
  "CLOUDTRAIL",
  "CLOUDWATCH",
  "CLOUDWATCHSYNTHETICS",
  "CODEARTIFACT",
  "CODEBUILD",
  "CODECATALYST",
  "CODECOMMIT",
  "CODEDEPLOY",
  "CODEGURU_PROFILER",
  "CODEGURU_REVIEWER",
  "CODEPIPELINE",
  "CODESTAR",
  "CODEWHISPERER",
  "COGNITO",
  "COMPREHEND",
  "COMPREHENDMEDICAL",
  "COMPUTE_OPTIMIZER",
  "CONFIG",
  "CONNECT",
  "CONSOLEMOBILEAPP",
  "CONTROLTOWER",
  "DATABREW",
  "DATAEXCHANGE",
  "DATAPIPELINE",
  "DATASYNC",
  "DAX",
  "DEEPCOMPOSER",
  "DEEPLENS",
  "DEEPRACER",
  "DETECTIVE",
  "DEVICEFARM",
  "DEVOPS-GURU",
  "DIRECTCONNECT",
  "DISCOVERY",
  "DLM",
  "DMS",
  "DOCDB",
  "DRS",
  "DS",
  "DYNAMODB",
  "E2M",
  "EBS",
  "EBSONOUTPOSTS",
  "EC2",
  "ECR",
  "ECR_PUBLIC",
  "ECS",
  "EKS",
  "ELASTICACHE",
  "ELASTICBEANSTALK",
  "ELASTICFILESYSTEM",
  "ELASTICLOADBALANCING",
  "ELASTICMAPREDUCE",
  "ELASTICTRANSCODER",
  "ELEMENTAL",
  "EMR_SERVERLESS",
  "ES",
  "EVENTS",
  "EVENTS_SCHEDULER",
  "EVIDENTLY",
  "FARGATE",
  "FINSPACE",
  "FIREHOSE",
  "FIS",
  "FMS",
  "FORECAST",
  "FRAUDDETECTOR",
  "FREERTOS",
  "FSX",
  "GAMELIFT",
  "GAMESPARKS",
  "GEO",
  "GLACIER",
  "GLOBALACCELERATOR",
  "GLUE",
  "GRAFANA",
  "GREENGRASS",
  "GROUNDSTATION",
  "GUARDDUTY",
  "HEALTH",
  "HEALTHLAKE",
  "IAM",
  "IAMIDENTITYCENTER",
  "IAMROLESANYWHERE",
  "IMAGEBUILDER",
  "IMPORTEXPORT",
  "INFRASTRUCTUREPERFORMANCE",
  "INSPECTOR",
  "INSPECTOR2",
  "INTERNETCONNECTIVITY",
  "INTERNETMONITOR",
  "INTERREGIONVPCPEERING",
  "IOT",
  "IOT1CLICK",
  "IOTROBORUNNER",
  "IOTTWINMAKER",
  "IOT_ANALYTICS",
  "IOT_DEVICE_ADVISOR",
  "IOT_DEVICE_DEFENDER",
  "IOT_DEVICE_MANAGEMENT",
  "IOT_EVENTS",
  "IOT_FLEETWISE",
  "IOT_SITEWISE",
  "IQ",
  "IVS",
  "KAFKA",
  "KENDRA",
  "KENDRA_RANKING",
  "KINESIS",
  "KINESISANALYTICS",
  "KINESISSTREAMS",
  "KINESIS_VIDEO",
  "KMS",
  "LAKEFORMATION",
  "LAMBDA",
  "LAUNCHWIZARD",
  "LEX",
  "LICENSE_MANAGER",
  "LIGHTSAIL",
  "LOCATION",
  "LOOKOUTMETRICS",
  "LOOKOUTVISION",
  "MACHINELEARNING",
  "MACIE",
  "MAINFRAME_MODERNIZATION",
  "MANAGEDBLOCKCHAIN",
  "MANAGEMENTCONSOLE",
  "MARKETPLACE",
  "MEDIACONNECT",
  "MEDIACONVERT",
  "MEDIALIVE",
  "MEDIAPACKAGE",
  "MEDIASTORE",
  "MEDIATAILOR",
  "MEMORYDB",
  "MGH",
  "MGN",
  "MIGRATIONHUBORCHESTRATOR",
  "MIGRATIONHUBSTRATEGY",
  "MOBILEANALYTICS",
  "MOBILEHUB",
  "MOBILETARGETING",
  "MONITRON",
  "MQ",
  "MULTIPLE_SERVICES",
  "NATGATEWAY",
  "NEPTUNE",
  "NETWORKFIREWALL",
  "NETWORK_ACCESS_ANALYZER",
  "NIMBLE",
  "NOTIFICATIONS",
  "OPSWORKS",
  "OPSWORKS-CM",
  "OPSWORKS_CHEF",
  "OPSWORKS_PUPPET",
  "ORGANIZATIONS",
  "OUTPOSTS",
  "PANORAMA",
  "PERSONALIZE",
  "POLLY",
  "PRICING",
  "PROTON",
  "QLDB",
  "QUICKSIGHT",
  "RAM",
  "RDS",
  "REACHABILITY_ANALYZER",
  "REDSHIFT",
  "REFACTOR_SPACES",
  "REKOGNITION",
  "RESILIENCEHUB",
  "RESOURCEEXPLORER",
  "RESOURCE_GROUPS",
  "RISK",
  "ROBOMAKER",
  "ROUTE53",
  "ROUTE53APPRECOVERYCONTROLLER",
  "ROUTE53DOMAINREGISTRATION",
  "ROUTE53PRIVATEDNS",
  "ROUTE53RESOLVER",
  "RUM",
  "S3",
  "S3_OUTPOSTS",
  "S3_REPLICATION_TIME_CONTROL",
  "SAGEMAKER",
  "SDB",
  "SDK",
  "SECRETSMANAGER",
  "SECURITY",
  "SECURITYHUB",
  "SECURITYLAKE",
  "SERVERLESSREPO",
  "SERVICECATALOG",
  "SERVICEDISCOVERY",
  "SERVICEQUOTAS",
  "SES",
  "SHIELD",
  "SIGNIN",
  "SIMSPACEWEAVER",
  "SMS",
  "SNOWBALL",
  "SNS",
  "SQS",
  "SSM",
  "SSM-SAP",
  "SSM_INCIDENTS",
  "SSO",
  "STATES",
  "STORAGEGATEWAY",
  "SUMERIAN",
  "SUPPORTCENTER",
  "SWF",
  "TAG",
  "TEXTRACT",
  "TIMESTREAM",
  "TNB",
  "TRAFFICMIRRORING",
  "TRANSCRIBE",
  "TRANSFER",
  "TRANSIT_GATEWAY",
  "TRANSLATE",
  "TRUSTEDADVISOR",
  "VMIMPORTEXPORT",
  "VPC",
  "VPCE_PRIVATELINK",
  "VPN",
  "WAF",
  "WELLARCHITECTED",
  "WICKR",
  "WORKDOCS",
  "WORKMAIL",
  "WORKSPACES",
  "WORKSPACESWEB",
  "XRAY"
]

有没有无法获得的事件?

似乎是这样的。

RDS维护信息并不是所有内容都会通过邮件或个人健康仪表盘(PHD)通知(已确认支持)。如果想了解此类信息,可以使用 describe-pending-maintenance-actions 命令进行获取。

尝试实际获取活动情况

您可以使用AWS Health API的DescribeEvents方法获取事件列表。

aws health describe-events --region us-east-1 > events.json

如果不在过滤器中指定日期和时间,只能获取过去90天的数据。

印象

可以利用API来获取信息,似乎可以运用于通知的机制等方面!

由于已与EventBridge集成,我们也可以使用EventBridge来监控事件,因此我打算进行另外的验证。

EventBridge平台上,

只有与账户相关的AWS Health事件会被传送

根据所述,获取公开事件可能需要使用AWS Health API。

AWS Health 将以最佳努力基础上提供事件传递。并不保证事件会始终传递到 EventBridge。

所以,AWS Health API似乎也可以应用于这个的覆盖。

广告
将在 10 秒后关闭
bannerAds