-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-certificatemanager): Cannot pass role to ACM DnsValidatedCertificate #12657
Comments
|
The problem is that you define there the lambda execution role and this can't be a cross account role (https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-assume-iam-role/). I have the same need (creating the DNS record in a different account). Has anybody a solution? |
I haven't seen any solutions for this, and I have searched and searched. It seems to me like this would be a common pattern - configuring DNS in one hosted zone and then adding/removing records from another account. Is there a way we could pass in a crossAccountResourceRole and then apply the appropriate policy statements to allow the function to assume the role? |
It is a common pattern - but to do so the lambda needs to support this and this is currently not the case. Imho it shouldn’t be a big effort to implement it. I will take a Look if I can create a pr for this. |
@lober-io is correct in the cause of the error. I believe (read: not tested) that one workaround in this scenario is to create a Role in the account where the certificate will be created, and grant it access to modify the hosted zone in the other account. Essentially, flip the above around so the role is in the certificate stack, rather than the zone stack. I consider this a duplicate of #8934, which is the general feature request to make the |
|
❓ General Issue
The Question
Why is the CertificateRequestorFunction failing due to "Cross-account pass role is not allowed"?
I'm getting a role by ARN (from another account with the hosted zone) and passing it to ACM DnsValidatedCertificate as the customResourceRole. The CertificateRequestorFunction fails due to "Cross-account pass role is not allowed".
The role's trust policy is:
Here's a snippet of the stack code:
Why is the CertificateRequestorFunction failing due to "Cross-account pass role is not allowed"?
Environment
Other information
Stack trace:
0/15 | 1:58:59 AM | CREATE_FAILED | AWS::Lambda::Function | ***Certificate/CertificateRequestorFunction (***CertificateCertificateRequestorFunctionAA2C865E) Cross-account pass role is not allowed. (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: ***; Proxy: null)
The text was updated successfully, but these errors were encountered: