-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(codepipeline): Error: The 'account' property must be a concrete value #19031
Comments
Hey @Nemanjalj66, thanks for opening the issue. I assume this is because #18255 was one of the changes that got merged between Is your pipeline in the same account as the Function you're importing with |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Hey @skinny85, thanks for the response. Yes, it is in the same account. |
OK, that's good. That means you should be able to unblock yourself by specifying the account (and probably region) of the pipeline Stack to the same values as are present in the Lambda function's ARN. However, long-term, I think we should introduce a |
After aws#18255 has been merged, the account and region of the Function's imported ARN is correctly recognized. Unfortunately, this has surfaced a few cases where that causes problems, like when using an imported Function as the target of a CodePipeline invoke Action (the pipeline construct needs to verify that the target Function is in the same account and region as the pipeline). Add a `Function.fromFunctionName()` method that allows you to import a Function in the same account and region. Fixes aws#19031
After #18255 has been merged, the account and region of the Function's imported ARN is correctly recognized. Unfortunately, this has surfaced a few cases where that causes problems, like when using an imported Function as the target of a CodePipeline invoke Action (the pipeline construct needs to verify that the target Function is in the same account and region as the pipeline). Add a `Function.fromFunctionName()` method that allows you to import a Function in the same account and region. Fixes #19031 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
After aws#18255 has been merged, the account and region of the Function's imported ARN is correctly recognized. Unfortunately, this has surfaced a few cases where that causes problems, like when using an imported Function as the target of a CodePipeline invoke Action (the pipeline construct needs to verify that the target Function is in the same account and region as the pipeline). Add a `Function.fromFunctionName()` method that allows you to import a Function in the same account and region. Fixes aws#19031 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The account and region that are present in the lambda ARN are already explicitly stated in the Environment property of the pipeline stack. That was already done when I opened the issue. |
Can you show what is |
Here's the definition: Here's the value: Here' the pipeline stack instantiation:
Account id from the ARN and the pipeline stack are matching. |
Yes, so I see the problem. The ARN of the Function is a dynamic (deploy-time only) value. Because of that, the CDK cannot figure out whether the Function and the Pipeline are in the same account/region, or not. You said:
Is there any chance you can remove that explicit Thanks, |
Thank you for the answer. Creating an environment-agnostic pipeline stack did help. However, this may cause a problem when this kind of stack is not appropriate. If StringParameter.FromStringParameterName causes the problem, then the alternative maybe should be Adding "fromFunctionName" method should solve all of these issues? Edit: One potential workaround for the ARN issue is to store only the Lambda function name in the Parameter store (this enables getting the information in the compile-time) and create the ARN from the environment data (account, region) from the Pipeline stack. |
Yes, the
Absolutely, this workaround would work too.
Yes, that should work. Sorry for encountering some many obstacles here 😕. Hopefully, your workaround with formatting the ARN "manually" from above should unblock you until we release a version with the Apologies for the bad experience! |
OK, thank you for your help! |
Of course! And apologies again for the bad experience. I'm going to close this one, please comment if you need anything else form our side for this issue. |
|
What is the problem?
After updating Amazon.CDK.Lib from 2.3.0 to 2.12.0 the LambdaInvokeAction fails to synthesize.
Reproduction Steps
Run CDK synth of the following code:
var changeVersionLambda = Function.FromFunctionArn(this, "changeVersionLambda", changeVersionLambdaArn);
What did you expect to happen?
CDK synth executes successfully.
What actually happened?
CDK synth fails.
Exception: Amazon.JSII.Runtime.JsiiException: The 'account' property must be a concrete value (action: 'Populate_Version_Parameters')
CDK CLI Version
2.12.0
Framework Version
No response
Node.js Version
v14.17.0
OS
Windows
Language
.NET
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: