Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

OOTB generated python CF resource cannot be used with cfn test

Open
#247 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, python
Domain
testing, tooling

Research direction

Reproduce the failure with the listed cloudformation-cli, SAM, macOS arm64, and generated-resource steps, ending with cfn test -- -k contract_create_delete. Then inspect src/cloudformation_cli_python_lib/cipher.py, src/setup.py, and the generated requirements.txt around the aws-encryption-sdk and cryptography constraints. Done means the generated resource can run the contract test without the ObjectIdentifier import error.

Written by the indexing model from the issue text.

Description

investigating

Repro:

  • Install latest cloudformation-cli
  • Install master branch of this repo
  • Generate a new resource type - in my example I used python3.9
  • run cfn submit --dry-run
  • run sam build
  • in new terminal run sam local start-lambda
  • run just one contract test -cfn test -- -k contract_create_delete
  • Error from cryptography library:
  • Unable to import module 'dd_dd_test1.handlers': cannot import name 'ObjectIdentifier' from 'cryptography.hazmat.bindings._rust' (unknown location)

Environment:

  • cfn version - cfn 0.2.28
  • SAM version - SAM CLI, version 1.66.0
  • Operating System - macOS Monterey - 12.3.1
  • Architecture - Apple M1 Pro (arm64)
  • plugin version - cloudformation-cli-python-plugin @ git+https://github.com/aws-cloudformation/cloudformation-cli-python-plugin.git@fad3b0740a76c7bad0be18b08cb46f6e22973bde (master as of 01/17/2023)
  • requirements.txt (generated) - cloudformation-cli-python-lib>=2.1.9
  • Resolved cryptography library - cryptography 39.0.0

Research:

Dominant language
Python
Stars
107
Forks
46
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aws-cloudformation/cloudformation-cli-python-plugin

All issues in aws-cloudformation/cloudformation-cli-python-plugin

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.