[aws-eks] cannot define eks cluster and network in different stacks
See original GitHub issuein v1.57.0 stack reference doesn’t work, everything is fine in v1.56.0
Reproduction Steps
network_sg_stack = NetworkSgStack(
scope=app,
id='sg-stack-' + environment,
env=env,
environment=environment,
vpc_id=app.node.try_get_context(target_env)['vpc_id'],
)
eks_stack = EksStack(
scope=app,
id='eks-stack-' + environment,
env=env,
environment=environment,
vpc=network_sg_stack.vpc,
subnet_a_eks=network_sg_stack.subnet_c_eks,
subnet_b_eks=network_sg_stack.subnet_b_eks,
subnet_c_eks=network_sg_stack.subnet_c_eks,
cluster_version=aws_eks.KubernetesVersion.V1_16
tags=tags,
eks_control_plane_role=iam_stack.eks_control_plane_role,
eks_control_plane_sg=network_sg_stack.eks_control_plane_sg,
)
–>
What did you expect to happen?
What actually happened?
jsii.errors.JavaScriptError:
Error: 'sg-stack-develop-cdk2' depends on 'edp-eks-stack-develop-cdk2' (sg-stack-develop-cdk2 -> eks-stack-develop-cdk2/cluster/KubectlProviderSecurityGroup/Resource.GroupId). Adding this dependency (stack-develop-cdk2 -> sg-stack-develop-cdk2/eks-control-plane-sg-develop-cdk2/Resource.GroupId) would create a cyclic reference.
at Stack._addAssemblyDependency (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/stack.js:415:19)
at Object.addDependency (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/deps.js:47:24)
at Stack.addDependency (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/stack.js:194:16)
at resolveValue (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/private/refs.js:85:14)
at Object.resolveReferences (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/private/refs.js:27:30)
at Object.prepareApp (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/private/prepare-app.js:34:16)
at Object.synthesize (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/private/synthesis.js:16:19)
at App.synth (/tmp/jsii-kernel-mpylii/node_modules/@aws-cdk/core/lib/stage.js:78:41)
at /home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7746:51
at Kernel._wrapSandboxCode (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:8398:19)
at /home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7746:25
at Kernel._ensureSync (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:8371:20)
at Kernel.invoke (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7745:26)
at KernelHost.processRequest (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7446:28)
at KernelHost.run (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7384:14)
at Immediate._onImmediate (/home/alexey/.local/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:7387:37)
at processImmediate (internal/timers.js:456:21)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "app.py", line 105, in <module>
app.synth()
File "/home/alexey/.local/lib/python3.7/site-packages/aws_cdk/core/__init__.py", line 11426, in synth
return jsii.invoke(self, "synth", [options])
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 113, in wrapped
return _recursize_dereference(kernel, fn(kernel, *args, **kwargs))
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 296, in invoke
return _callback_till_result(self, response, InvokeResponse)
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 181, in _callback_till_result
response = kernel.sync_complete(response.cbid, None, result, response_type)
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/__init__.py", line 339, in sync_complete
response_type=response_type
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 369, in sync_complete
resp = self._process.send(_CompleteRequest(complete=request), response_type)
File "/home/alexey/.local/lib/python3.7/site-packages/jsii/_kernel/providers/process.py", line 318, in send
raise JSIIError(resp.error) from JavaScriptError(resp.stack)
jsii.errors.JSIIError: 'sg-stack-develop-cdk2' depends on 'eks-stack-develop-cdk2' (sg-stack-develop-cdk2 -> eks-stack-develop-cdk2/cluster/KubectlProviderSecurityGroup/Resource.GroupId). Adding this dependency (eks-stack-develop-cdk2 -> sg-stack-develop-cdk2/eks-control-plane-sg-develop-cdk2/Resource.GroupId) would create a cyclic reference.
Subprocess exited with error 1
Environment
- **CLI Version 1.57.0
- **Framework Version:1.57.0
- **Node.js Version:v12.18.1
- **OS :ubuntu 18.04
- **Language (Version):Python 3.7.5
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How do I resolve cluster creation errors in Amazon EKS?
Resolution · Recreate the cluster in a different Availability Zone · Confirm that you have the correct IAM permissions to create a cluster....
Read more >Amazon EKS networking - AWS Documentation
Your Amazon EKS cluster is created in a VPC. Pod networking is provided by the Amazon VPC Container Network Interface (CNI) plugin.
Read more >Troubleshoot upgrade fails with my Amazon EKS cluster
1. Open the Amazon EKS console in the Region where you created your cluster. · 2. Select Clusters from the sidebar. · 3....
Read more >Troubleshoot eksctl issues with EKS cluster and node group
If you created the Amazon EKS cluster with PrivateOnly networking, then AWS CloudFormation can't create public subnets. This means that export ...
Read more >Create Amazon EKS clusters and node groups without a route ...
1. In the following config file, update the AWS Region and three PrivateOnly subnets that you created in the Create a VPC for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
app.py
network_sg_stack.py
eks_control_plane_stack.py
iam_stack.py
@alexey-boyko Not archive. Just paste the relevant resources. Specifically, i’m interested in exactly how are you instantiating the subnets and the VPC in the
NetworkSgStack
.