AWS 凭证#
¥AWS credentials
AWS(IAM)凭证#
¥AWS (IAM) credentials
你可以使用以下凭据验证以下节点:
¥You can use these credentials to authenticate the following nodes:
支持的身份验证方法#
¥Supported authentication methods
- API 访问密钥
¥API access key
相关资源#
¥Related resources
有关服务的更多信息,请参阅 AWS 身份和访问管理文档。
¥Refer to AWS's Identity and Access Management documentation for more information about the service.
使用 API 访问密钥#
¥Using API access key
要配置此凭据,你需要一个 AWS 账户以及:
¥To configure this credential, you'll need an AWS account and:
- 你的 AWS 区域
¥Your AWS Region
- 访问密钥 ID:创建访问密钥时生成。
¥The Access Key ID: Generated when you create an access key.
- 密钥:创建访问密钥时生成。
¥The Secret Access Key: Generated when you create an access key.
创建访问密钥并设置凭据:
¥To create an access key and set up the credential:
- 在你的 n8n 凭证中,选择你的 AWS 区域。
¥In your n8n credential, select your AWS Region. 2. 登录 IAM 控制台。
¥Log in to the IAM console. 3. 在右上角的导航栏中,选择你的用户名,然后选择“安全凭据”。
¥In the navigation bar on the upper right, select your user name and then select Security credentials. 4. 在“访问密钥”部分,选择“创建访问密钥”。
¥In the Access keys section, select Create access key. 5. 在“访问密钥最佳实践和替代方案”页面上,选择你的用例。如果未提示你创建访问密钥,请选择“其他”。
¥On the Access key best practices & alternatives page, choose your use case. If it doesn't prompt you to create an access key, select Other. 6. 选择“下一步”。
¥Select Next.
7. 为访问密钥设置描述标签值,以便于识别,例如 n8n integration。
¥Set a description tag value for the access key to make it easier to identify, for example n8n integration.
8. 选择“创建访问密钥”。
¥Select Create access key. 9. 显示访问密钥 ID 和秘密访问密钥,并将它们输入到 n8n 中。
¥Reveal the Access Key ID and Secret Access Key and enter them in n8n. 10. 要使用临时安全凭据,请启用该选项并添加会话令牌。有关使用临时安全凭证的更多信息,请参阅 AWS 临时安全凭证文档。
1 | |
-
如果你使用 Amazon Virtual Private Cloud (VPC) 托管 n8n,则可以在你的 VPC 和某些应用之间建立连接。使用“自定义端点”为此连接输入相关的自定义端点。此设置适用于以下应用:
¥If you use Amazon Virtual Private Cloud (VPC) to host n8n, you can establish a connection between your VPC and some apps. Use Custom Endpoints to enter relevant custom endpoint(s) for this connection. This setup works with these apps:
-
Rekognition
-
Lambda
-
SNS
-
SES
-
SQS
-
S3
-
你还可以通过 AWS CLI 和 AWS API 生成访问密钥。请参阅 AWS 访问密钥管理文档 以获取使用这些方法生成访问密钥的说明。
¥You can also generate access keys through the AWS CLI and AWS API. Refer to the AWS Managing Access Keys documentation for instructions on generating access keys using these methods.
AWS(Assume Role)凭证#
¥AWS (Assume Role) credentials
你可以使用以下凭据通过 IAM 角色承担增强安全性来验证以下节点:
¥You can use these credentials to authenticate the following nodes with enhanced security through IAM role assumption:
支持的身份验证方法#
¥Supported authentication methods
- 角色代入
¥Role Assumption
相关资源#
¥Related resources
请参阅 AWS IAM 角色文档 和 STS AssumeRole 文档 以获取有关角色承担的更多信息。
¥Refer to AWS's IAM Role documentation and STS AssumeRole documentation for more information about role assumption.
了解 AWS 角色承担#
¥Understanding AWS Role Assumption
AWS 角色承担允许你通过临时承担 IAM 角色来安全地访问 AWS 资源,而无需使用长期有效的访问密钥。这符合 AWS 安全最佳实践,并支持以下功能:
¥AWS Role Assumption allows you to securely access AWS resources by temporarily assuming an IAM role, rather than using long-lived access keys. This follows AWS security best practices and enables:
- 跨账户访问:访问不同 AWS 账户中的资源。
¥Cross-account access: Access resources in different AWS accounts
- 增强安全性:使用自动过期的临时凭证
¥Enhanced security: Use temporary credentials that automatically expire
- 最小权限原则:仅授予特定任务所需的权限
¥Principle of least privilege: Grant only the permissions needed for specific tasks
- 审计跟踪:更好地跟踪谁访问了哪些资源
¥Audit trail: Better tracking of who accessed what resources
设置 AWS Assume Role 凭证#
¥Setting up AWS Assume Role credentials
要配置此凭据,你需要:
¥To configure this credential, you'll need:
必填参数#
¥Required Parameters
- 区域:调用 STS 服务以承担角色的 AWS 区域。
¥Region: The AWS region in which to call the STS service to assume the role.
- 角色 ARN:你要承担的 IAM 角色的 Amazon 资源名称 (ARN)。它的格式为
arn:aws:iam::123456789012:role/MyRole。此角色必须具有允许你的凭据代入的信任策略。
¥Role ARN: The Amazon Resource Name (ARN) of the IAM role you want to assume. It has the format arn:aws:iam::123456789012:role/MyRole. This role must have a trust policy that allows your credentials to assume it.
- 外部 ID:角色信任策略要求的唯一标识符,用于防止 "副手混乱" 问题。这应该是一个秘密值,你需要在角色的信任策略和此凭据中生成并配置该值。将此值视为敏感信息。请勿与你不信任的其他 n8n 用户共享资源。
¥External ID: A unique identifier required by the role's trust policy to prevent the "confused deputy" problem. This should be a secret value that you generate and configure in both the role's trust policy and this credential. Treat this value as sensitive. Don't share it with other n8n users you don't trust.
- 角色会话名称:承担的角色会话的名称(用于审计)。默认值为
n8n-session。此值会出现在 AWS CloudTrail 日志中,以便你识别会话。
¥Role Session Name: A name for the assumed role session (used for auditing). Default values is n8n-session. This value appears in AWS CloudTrail logs so you can identify the session.
STS 凭据(选择一种方法)#
¥STS credentials (Choose one method)
你可以通过两种方式提供凭据以调用 STS AssumeRole:
¥You have two options for providing credentials to make the STS AssumeRole call:
选项 1:使用系统凭据(推荐用于服务器部署)#
¥Option 1: Use system credentials (recommended for server deployments)
如果你的 n8n 服务器已通过以下方式配置了 AWS 凭证,请启用此选项:
¥Enable this option if your n8n server has AWS credentials configured through:
- 环境变量 (
AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY、AWS_SESSION_TOKEN)
¥Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN)
- EC2 实例配置文件
¥EC2 instance profile
- ECS 任务角色
¥ECS task role
- EKS pod 身份
¥EKS pod identity
此选项需要你的 n8n 管理员通过将环境变量 N8N_AWS_SYSTEM_CREDENTIALS_ACCESS_ENABLED 设置为 true 来启用系统凭据访问权限。
¥This option requires your n8n administrator to enable system credentials access by setting environment variable N8N_AWS_SYSTEM_CREDENTIALS_ACCESS_ENABLED to true
选项 2:手动 STS 凭证#
¥Option 2: Manual STS Credentials
如果系统凭据不可用,请手动提供:
¥If system credentials aren't available, provide these manually:
- STS 访问密钥 ID:拥有担任目标角色权限的 IAM 用户或角色的访问密钥 ID。
¥STS Access Key ID: Access Key ID for an IAM user or role that has permission to assume the target role.
- STS 秘密访问密钥:与 STS 访问密钥 ID 对应的秘密访问密钥。
¥STS Secret Access Key: Secret Access Key corresponding to the STS Access Key ID.
- STS 会话令牌(可选):如果使用临时凭据进行 STS 调用,则需要会话令牌。
¥STS Session Token (optional): Session token if using temporary credentials for the STS call.
可选参数#
¥Optional Parameters
- 自定义端点:如果使用 Amazon VPC,你可以为 AWS 服务指定自定义终端节点:
¥Custom Endpoints: If using Amazon VPC, you can specify custom endpoints for AWS services:
-
Rekognition 端点
¥Rekognition Endpoint
-
Lambda 端点
¥Lambda Endpoint
-
SNS 端点
¥SNS Endpoint
-
SES 端点
¥SES Endpoint
-
SQS 端点
¥SQS Endpoint
-
S3 端点
¥S3 Endpoint
-
SSM 端点
¥SSM Endpoint
设置步骤#
¥Setup Steps
- 在目标 AWS 账户中创建 IAM 角色。
¥Create the IAM Role in the target AWS account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
¥Configure the credential in n8n.
-
选择你的 AWS 区域
¥Select your AWS Region
-
输入你创建的角色的角色 ARN。
¥Enter the Role ARN of the role you created
-
设置一个唯一的外部 ID(与信任策略中的 ID 相同)。
¥Set a unique External ID (same as in the trust policy)
-
选择你的 STS 凭据方法
¥Choose your STS credentials method
-
输入角色会话名称(或使用默认值)。
¥Enter the Role Session Name (or use default) 3. 使用内置测试函数测试凭据,以验证角色转换是否有效。
¥Test the credential using the built-in test function to verify the role assumption works.
安全最佳实践#
¥Security Best Practices
- 为每个凭据使用唯一的外部 ID,以防止未经授权的访问。
¥Use unique External IDs for each credential to prevent unauthorized access.
- 轮换用于角色承担的 STS 凭据。
¥Rotate the STS credentials used for role assumption.
- 对授权凭证和目标角色应用最小权限原则。
¥Apply the principle of least privilege to both the assuming credentials and the target role.