(aws_cdk.aws_codecommit): AttributeError: module 'aws_cdk.aws_codecommit' has no attribute 'Code'
See original GitHub issueDescribe the bug
codecommit has a class Code
per the documentation: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.Code.html
When attempting to access the class…
repo = codecommit.Repository(
self,
"repo",
repository_name="repo_name",
description="My repo",
code=codecommit.Code.from_directory("./mydirectory","main" )
)
An error is returned…
File "/.../infrastructure.py", line 453, in __init__
code=codecommit.Code.from_directory("./mydirectory","main" )
AttributeError: module 'aws_cdk.aws_codecommit' has no attribute 'Code'
Expected Behavior
codecommit successfully creates a repo initialized based on the code.
Current Behavior
An error is returned…
File "/.../infrastructure.py", line 453, in __init__
code=codecommit.Code.from_directory("./mydirectory","main" )
AttributeError: module 'aws_cdk.aws_codecommit' has no attribute 'Code'
Reproduction Steps
repo = codecommit.Repository(
self,
"repo",
repository_name="repo_name",
description="MWAA Dag",
code=codecommit.Code.from_directory("./mydirectory","main" )
)
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.20.0 (build 738ef49)
Framework Version
No response
Node.js Version
v16.6.1
OS
ProductName: macOS ProductVersion: 11.6.5 BuildVersion: 20G527
Language
Python
Language Version
Python 3.8.3
Other information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
aws-cdk/aws-codepipeline-actions module
This module contains Actions that allows you to deploy to CloudFormation from AWS CodePipeline. For example, the following code fragment defines a pipeline...
Read more >awslabs/aws-cdk - Gitter
another issue I have is granting access for a new Lambda in a CDK stack access to ... AttributeError: module 'aws_cdk.core' has no...
Read more >CDK AttributeError: module 'aws_cdk.cx_api' has no attribute ...
I believe this an error of the aws_cdk library of core is this because it thinks I am mixing AWS CDK V1 and...
Read more >How to upgrade CDK from CDKv1 to CDKv2 in an existing ...
When working with CDK version 1, every package/module which is needed for ... aws-cdk.aws-codecommit==1.136.0 aws-cdk.aws-codebuild==1.136.0 ...
Read more >aws-cdk-lib - npm
For CDK apps, declare them under the dependencies section only. Use in your code. Classic import. You can use a classic import to...
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 Free
Top 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
Yes, you were using
aws-cdk-lib
in version2.2.0
, while this functionality was released in version2.4.0
.⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.