Skip to content

(codepipeline): Error: The 'account' property must be a concrete value #19031

Closed
@Nemanjalj66

Description

@Nemanjalj66

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);

new Amazon.CDK.AWS.CodePipeline.StageProps
{
      StageName = "Deploy_Test",
      Actions = new IAction[]
      {
          new LambdaInvokeAction(new LambdaInvokeActionProps() {
              ActionName = "Populate_Parameters",
              Lambda = changeVersionLambda,
              UserParameters = new Dictionary<string, object>
              {
                  ["component"] = "service",
                  ["environment"] = PlatformEnvironment.Test.ToString(),
                  ["version"] = nodeServiceBuildAction.Variable("NEW_VERSION")
              }
          })
      }
}

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

Activity

added
bugThis issue is a bug.
needs-triageThis issue or PR still needs to be triaged.
on Feb 18, 2022
skinny85

skinny85 commented on Feb 18, 2022

@skinny85
Contributor

Hey @Nemanjalj66,

thanks for opening the issue. I assume this is because #18255 was one of the changes that got merged between 2.3.0 and 2.12.0.

Is your pipeline in the same account as the Function you're importing with Function.FromFunctionArn()?

added
response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.
on Feb 18, 2022
github-actions

github-actions commented on Feb 20, 2022

@github-actions
Contributor

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.

added
closing-soonThis issue will automatically close in 4 days unless further comments are made.
on Feb 20, 2022
Nemanjalj66

Nemanjalj66 commented on Feb 21, 2022

@Nemanjalj66
Author

Hey @skinny85,

thanks for the response.

Yes, it is in the same account.

removed
closing-soonThis issue will automatically close in 4 days unless further comments are made.
response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.
on Feb 21, 2022
skinny85

skinny85 commented on Feb 21, 2022

@skinny85
Contributor

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 Function.fromFunctionName() method that allows you to skip all of this dance, and just always assumes the Function is in the same account and region you are importing it to.

added
effort/smallSmall work item – less than a day of effort
and removed
needs-triageThis issue or PR still needs to be triaged.
on Feb 21, 2022

21 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-codepipelineRelated to AWS CodePipelinebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @skinny85@ryparker@Nemanjalj66

    Issue actions

      (codepipeline): Error: The 'account' property must be a concrete value · Issue #19031 · aws/aws-cdk