View a markdown version of this page

CloudWatch 管道扩展 - Amazon CloudWatch
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

CloudWatch 管道扩展

CloudWatch 管道扩展可为管道提供其他功能。您可以使用 Amazon Secrets Manager 集成进行凭证管理。

Amazon Secrets Manager 扩展

配置对 Amazon Secrets Manager 的访问权限,以检索凭证和敏感配置值。只有需要身份验证凭证的第三方来源才支持此扩展。

配置

使用以下参数配置 Amazon Secrets Manager 扩展:

extension: aws: secrets: <secret-name>: secret_id: "<secret arn>" region: "<secret region>" sts_role_arn: "arn:aws:iam::123456789012:role/Example-Role" refresh_interval: PT1H disable_refresh: false
Parameters
aws.secrets.<secret-name>.secret_id(必需)

包含凭证的 Amazon Secrets Manager 密钥的 ARN。

aws.secrets.<secret-name>.region(必需)

在其中存储密钥的 Amazon 区域。

aws.secrets.<secret-name>.sts_role_arn(必需)

访问 Amazon Secrets Manager 密钥时需担任的 IAM 角色的 ARN。

aws.secrets.<secret-name>.refresh_interval(可选)

刷新 Amazon Secrets Manager 中密钥的频率。使用 ISO 8601 持续时间格式。默认为 PT1H(1 小时)。

aws.secrets.<secret-name>.disable_refresh(可选)

是否禁用自动密钥刷新。默认值为 false。

密钥引用语法

使用以下语法引用管道配置中的密钥:

${{aws_secrets:<secret-name>:<key>}}

例如,要引用客户端 ID 和密钥,请执行以下操作:

source: microsoft_office365: authentication: oauth2: client_id: "${{aws_secrets:office365-creds:client_id}}" client_secret: "${{aws_secrets:office365-creds:client_secret}}"

要求和限制

密钥格式

密钥必须作为 JSON 键值对存储在 Amazon Secrets Manager 中。

跨区域访问

可以从任何可使用 Amazon Secrets Manager 的区域访问密钥。

刷新间隔限制

最长刷新间隔为 5 分钟(PT5M)。最长为 24 小时(PT24H)。

最大密钥数量

一个管道最多可以引用 10 个不同的密钥。

重要

使用密钥时,请考虑以下事项:

  • 确保 IAM 角色具有访问密钥的相应权限

  • 使用 Amazon CloudTrail 监控密钥访问

  • 为不同环境(开发、生产)使用单独的密钥