AttachPolicyRequest 中的 AWS 物联网安全身份是什么?

What is AWS iot security identity in AttachPolicyRequest?

我正在尝试在我的 AWS lambda 函数中向 AWSIot 客户端添加证书以激活 bootstrap 证书。我遵循此代码 justInTimeRegistration lambda.js:

AWSIot awsIotClient = AWSIotClientBuilder.defaultClient();
awsIotClient.createPolicy(new CreatePolicyRequest().withPolicyDocument(policy).withPolicyName(policyName));
awsIotClient.attachPolicy(new AttachPolicyRequest().withPolicyName(policyName).withTarget(???));

我不明白什么是'target'。在方法描述中,我读到:

target - 策略附加到的identity

但是 link 中的文档不清楚。在 AttachPrincipalPolicy(已弃用)AttachPrincipalPolicyRequest 中,主体为 "a certificate ARN (as returned from the CreateCertificate operation)" - 很清楚。但是我不清楚身份是什么。它是像 arn 这样的实体还是像 certificateId 这样的随机值?我应该如何指定 target/identity 附加策略?

正如我从这个 docs 例子中看到的,身份(目标)是 arn:

aws iot attach-policy \
--policy-name UpdateDeviceCertPolicy \
--target "arn:aws:iot:us-west-2:123456789012:cert/4f0ba725787aa94d67d2fca420eca022242532e8b3c58e7465c7778b443fd65e"