Skip to content
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: Only one of artifact bucket and cross region replication buckets can be specified! #26164

Open
2 tasks
makr11 opened this issue Jun 29, 2023 · 5 comments
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@makr11
Copy link

makr11 commented Jun 29, 2023

Describe the feature

I couldn't find an explanation of this constraint. It would be extremely beneficial to be able to specify cross region replication bucket to be reused for all project pipelines which create cross region resources.

Use Case

Large amount of pipelines created with CDK creates a near limit amount of S3 Buckets, I would like to specify cross region replication bucket alongside artifact bucket.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.78.0

Environment details (OS name and version, etc.)

Ubuntu 22.04

@makr11 makr11 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jun 29, 2023
@github-actions github-actions bot added the @aws-cdk/aws-codepipeline Related to AWS CodePipeline label Jun 29, 2023
@pahud
Copy link
Contributor

pahud commented Jun 29, 2023

What error messages did you see? Can you share more details about that?

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 29, 2023
@makr11
Copy link
Author

makr11 commented Jul 4, 2023

Hi pahud,

This is the full error log:

jsii.errors.JavaScriptError:
Error: Only one of artifactBucket and crossRegionReplicationBuckets can be specified!
at new Pipeline (/tmp/jsii-kernel-upQH8B/node_modules/aws-cdk-lib/aws-codepipeline/lib/pipeline.js:1:3732)
at Kernel._create (/tmp/tmpb55dxvbx/lib/program.js:9964:29)
at Kernel.create (/tmp/tmpb55dxvbx/lib/program.js:9693:29)
at KernelHost.processRequest (/tmp/tmpb55dxvbx/lib/program.js:11544:36)
at KernelHost.run (/tmp/tmpb55dxvbx/lib/program.js:11504:22)
at Immediate._onImmediate (/tmp/tmpb55dxvbx/lib/program.js:11505:46)
at process.processImmediate (node:internal/timers:476:21)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/esg/app.py", line 9, in
Pipeline(app, f"Pipeline-{environment}", environment, env=cdk.Environment(account="xxxxxxx", region="xxxx"))
File "/home/-esg/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 112, in call
inst = super().call(*args, **kwargs)
File "/home/-esg/infra/pipeline.py", line 40, in init
pipeline = codepipeline.Pipeline(self, "BasePipeline",
File "/home/esg/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 112, in call
inst = super().call(*args, **kwargs)
File "/home/esg/.venv/lib/python3.9/site-packages/aws_cdk/aws_codepipeline/init.py", line 5937, in init
jsii.create(self.class, self, [scope, id, props])
File "/home/esg/.venv/lib/python3.9/site-packages/jsii/_kernel/init.py", line 334, in create
response = self.provider.create(
File "/home/esg/.venv/lib/python3.9/site-packages/jsii/_kernel/providers/process.py", line 363, in create
return self._process.send(request, CreateResponse)
File "/home/esg/.venv/lib/python3.9/site-packages/jsii/_kernel/providers/process.py", line 340, in send
raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: Only one of artifactBucket and crossRegionReplicationBuckets can be specified!

@makr11
Copy link
Author

makr11 commented Aug 1, 2023

Hey, any update around this issue?

@pahud
Copy link
Contributor

pahud commented Dec 15, 2023

Hi @makr11

For cross-region and/or cross-account issues with codepipeline, we have a p1 issue for tracking at #24051 and please report to that issue instead.

If you are looking for a working sample for your reference, please check this out.
#26557 (comment)

@kareldonk
Copy link

I am getting the same error. I would like to use a single bucket for artifacts and replication buckets because otherwise we reach the 100 bucket limit quickly. If a single bucket cannot be used, at least 2 buckets, one for artifacts and one for replication would also be good.

const artifactBucket = Bucket.fromBucketName(this, `ID`, 'existing_bucketname');

const pipeline = new CodePipeline(this, `ID`, {
    artifactBucket: artifactBucket,
    crossRegionReplicationBuckets: {
        'us-east-1': artifactBucket,
    },
   ...
};

Results in: Error: Only one of artifactBucket and crossRegionReplicationBuckets can be specified! when trying to do cdk synth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants