-
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
(codepipeline): Imported pipeline has incorrect account id #27816
Comments
@khushail Any Updates? This issue is blocking me currently |
I am not sure if the imported pipeline.env should return the imported pipeline env because fromPipelineArn() basically returns IPipeline which implements IResource that comes with the |
@pahud I'm not sure if I can follow. Shouldn't the pipeline return the env that it belongs to? For example: I create a pipeline in the AWS console and it is deployed in eu-west-1. Then I call the To see why this is an issue, see the recent comments in the pull request #27799 |
@daschaa yes I agree with you. Generally, when we import existing resource with the Now, if IPipeline.env represents the env of the imported pipeline from another account, we should assume all other existing CDK imported resources would have exactly the same behavior but I doubt that. For example, the imported Lambda function IFunction.env would not represent the resource environment of the cross-account function owner.
I guess maybe we can create something like IPipeline.ownerEnv that represents the pipeline owner env which can be retrieved from the pipeline arn while IPipeline.env remains to represent current owner env, which has been implemented as a consistent behavior across all imported resources. But this definitely need more discussion. We will bring this to the core team this week. |
Hey @daschaa , could you please tell us more about your use case and what is blocking you in the current implementation? |
@vinayak-kukreja I'm working on #27799 where a reviewer suggests I should implement a fix for this issue. There is a workaround available (as done in the PR) but I agree with the reviewer that it should probably be solved in the |
I agree. This makes sense. |
I believe this issue is also fixed in #27799. Going to mark this issue as resolved. Feel free to re-open if you have additional questions. |
|
Describe the bug
When importing a pipeline from an pipeline arn, the imported pipeline has the environment from the stack its imported to, not from the pipeline arn.
Expected Behavior
The
env
property has the same account id than the arn where it is imported from.Current Behavior
The
env
property has the account id from the scope.Reproduction Steps
Possible Solution
Change the
fromPipelineArn
method to use theenvironmentFromArn
parameter from theImport
class.aws-cdk/packages/aws-cdk-lib/aws-codepipeline/lib/pipeline.ts
Lines 322 to 329 in 3c3ee44
to following:
Additional Information/Context
No response
CDK CLI Version
2.103.1
Framework Version
No response
Node.js Version
18.12.1
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: