-
Describe the bugI attempted to add a I added Expected BehaviorAllow the code build role to assume the cross account roles Current BehaviorThe code build role is missing Reproduction StepsAdd a Possible SolutionAdd I think that is the correct place. Additional Information/ContextNo response CDK CLI Version2.45.0 (build af1fb7c) Framework VersionNo response Node.js Versionv16.16.0 OSWindows 10 Pro 19043.1889 LanguageTypescript Language VersionTypeScript 4.8.3 Other informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
This is intentional - lookup values are cached in This is explained here: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html#context-lookups |
Beta Was this translation helpful? Give feedback.
-
Then I think there is a problem with the caching because it was throwing an error trying to query across accounts instead of using the cached value. |
Beta Was this translation helpful? Give feedback.
-
You would need to open a new issue for that and include more information in it. |
Beta Was this translation helpful? Give feedback.
-
@gshpychka I just had a thought. It might be because the cached value changed. Should the cached value change if the associated stack needed to be rebuilt? Or would I need to remove the cached value if that happens? |
Beta Was this translation helpful? Give feedback.
-
The cache key is a combination of account, region and input to the lookup function. If any of those change, that will cause a new lookup to happen. The cached value will not automatically be invalidated. You are responsible for removing the cache key (by editing This isn't really a bug report. Moving this to discussions. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
This is intentional - lookup values are cached in
cdk.context.json
, which should be committed to Git. After you do that, there will be no further lookups during synth. I understand that may be limiting sometimes and not cover all use-cases, but it's the best practice.This is explained here: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines-readme.html#context-lookups